summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-06-13 02:36:25 (GMT)
committerwebchick2014-06-13 02:36:25 (GMT)
commitd8505d2eb2569ec737d88ff9b929548ac808474a (patch)
treea7930d4e7fe666b3e4cac52899fc0d3a12f8879c
parent3a42e91de1035e67ce0d484e49c9250c740fe05d (diff)
Issue #2080343 by connork, izus, rahul.shinde, lokapujya | mrsinguyen: Remove Unused local variables from system module.
-rw-r--r--core/modules/system/src/Tests/Ajax/ElementValidationTest.php5
-rw-r--r--core/modules/system/src/Tests/Common/AddFeedTest.php2
-rw-r--r--core/modules/system/src/Tests/Common/WriteRecordTest.php14
-rw-r--r--core/modules/system/src/Tests/Database/DatabaseTestBase.php2
-rw-r--r--core/modules/system/src/Tests/Database/SelectOrderedTest.php6
-rw-r--r--core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php1
-rw-r--r--core/modules/system/src/Tests/Form/ElementsTableSelectTest.php8
-rw-r--r--core/modules/system/src/Tests/Lock/LockFunctionalTest.php1
-rw-r--r--core/modules/system/src/Tests/System/FrontPageTest.php2
-rw-r--r--core/modules/system/tests/src/Controller/SystemControllerTest.php8
10 files changed, 19 insertions, 30 deletions
diff --git a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php b/core/modules/system/src/Tests/Ajax/ElementValidationTest.php
index 81ed62d..a6e9daa 100644
--- a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php
+++ b/core/modules/system/src/Tests/Ajax/ElementValidationTest.php
@@ -28,11 +28,10 @@ class ElementValidationTest extends AjaxTestBase {
* Ajax-enabled field fails due to the required field being empty.
*/
function testAjaxElementValidation() {
- $web_user = $this->drupalCreateUser();
$edit = array('drivertext' => t('some dumb text'));
// Post with 'drivertext' as the triggering element.
- $post_result = $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivertext');
+ $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivertext');
// Look for a validation failure in the resultant JSON.
$this->assertNoText(t('Error message'), 'No error message in resultant JSON');
$this->assertText('ajax_forms_test_validation_form_callback invoked', 'The correct callback was invoked');
@@ -41,7 +40,7 @@ class ElementValidationTest extends AjaxTestBase {
$edit = array('drivernumber' => 12345);
// Post with 'drivernumber' as the triggering element.
- $post_result = $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivernumber');
+ $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivernumber');
// Look for a validation failure in the resultant JSON.
$this->assertNoText(t('Error message'), 'No error message in resultant JSON');
$this->assertText('ajax_forms_test_validation_number_form_callback invoked', 'The correct callback was invoked');
diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php
index 2f4689b..9997813 100644
--- a/core/modules/system/src/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/src/Tests/Common/AddFeedTest.php
@@ -68,7 +68,7 @@ class AddFeedTest extends WebTestBase {
$html_page = new HtmlPage();
- foreach ($urls as $description => $feed_info) {
+ foreach ($urls as $feed_info) {
$feed_link = new FeedLinkElement($feed_info['title'], $feed_info['url']);
$html_page->addLinkElement($feed_link);
}
diff --git a/core/modules/system/src/Tests/Common/WriteRecordTest.php b/core/modules/system/src/Tests/Common/WriteRecordTest.php
index fd6ac63..f4ac5ff 100644
--- a/core/modules/system/src/Tests/Common/WriteRecordTest.php
+++ b/core/modules/system/src/Tests/Common/WriteRecordTest.php
@@ -75,7 +75,7 @@ class WriteRecordTest extends DrupalUnitTestBase {
$person->name = 'Ringo';
$person->age = NULL;
$person->job = NULL;
- $insert_result = drupal_write_record('test', $person);
+ drupal_write_record('test', $person);
$this->assertTrue(isset($person->id), 'Primary key is set on record created with drupal_write_record().');
$result = db_query("SELECT * FROM {test} WHERE id = :id", array(':id' => $person->id))->fetchObject();
$this->assertIdentical($result->name, 'Ringo', 'Name field set.');
@@ -86,7 +86,7 @@ class WriteRecordTest extends DrupalUnitTestBase {
$person = new \stdClass();
$person->name = 'Paul';
$person->age = NULL;
- $insert_result = drupal_write_record('test_null', $person);
+ drupal_write_record('test_null', $person);
$this->assertTrue(isset($person->id), 'Primary key is set on record created with drupal_write_record().');
$result = db_query("SELECT * FROM {test_null} WHERE id = :id", array(':id' => $person->id))->fetchObject();
$this->assertIdentical($result->name, 'Paul', 'Name field set.');
@@ -95,7 +95,7 @@ class WriteRecordTest extends DrupalUnitTestBase {
// Insert a record - do not specify the value of a column that allows NULL.
$person = new \stdClass();
$person->name = 'Meredith';
- $insert_result = drupal_write_record('test_null', $person);
+ drupal_write_record('test_null', $person);
$this->assertTrue(isset($person->id), 'Primary key is set on record created with drupal_write_record().');
$this->assertIdentical($person->age, 0, 'Age field set to default value.');
$result = db_query("SELECT * FROM {test_null} WHERE id = :id", array(':id' => $person->id))->fetchObject();
@@ -105,7 +105,7 @@ class WriteRecordTest extends DrupalUnitTestBase {
// Update the newly created record.
$person->name = 'Mary';
$person->age = NULL;
- $update_result = drupal_write_record('test_null', $person, array('id'));
+ drupal_write_record('test_null', $person, array('id'));
$result = db_query("SELECT * FROM {test_null} WHERE id = :id", array(':id' => $person->id))->fetchObject();
$this->assertIdentical($result->name, 'Mary', 'Name field set.');
$this->assertIdentical($result->age, NULL, 'Age field set.');
@@ -113,20 +113,20 @@ class WriteRecordTest extends DrupalUnitTestBase {
// Insert a record - the "data" column should be serialized.
$person = new \stdClass();
$person->name = 'Dave';
- $update_result = drupal_write_record('test_serialized', $person);
+ drupal_write_record('test_serialized', $person);
$result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
$this->assertIdentical($result->name, 'Dave', 'Name field set.');
$this->assertIdentical($result->info, NULL, 'Info field set.');
$person->info = array();
- $update_result = drupal_write_record('test_serialized', $person, array('id'));
+ drupal_write_record('test_serialized', $person, array('id'));
$result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
$this->assertIdentical(unserialize($result->info), array(), 'Info field updated.');
// Update the serialized record.
$data = array('foo' => 'bar', 1 => 2, 'empty' => '', 'null' => NULL);
$person->info = $data;
- $update_result = drupal_write_record('test_serialized', $person, array('id'));
+ drupal_write_record('test_serialized', $person, array('id'));
$result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
$this->assertIdentical(unserialize($result->info), $data, 'Info field updated.');
diff --git a/core/modules/system/src/Tests/Database/DatabaseTestBase.php b/core/modules/system/src/Tests/Database/DatabaseTestBase.php
index 0aa4d5b..da14f5c 100644
--- a/core/modules/system/src/Tests/Database/DatabaseTestBase.php
+++ b/core/modules/system/src/Tests/Database/DatabaseTestBase.php
@@ -76,7 +76,7 @@ abstract class DatabaseTestBase extends DrupalUnitTestBase {
))
->execute();
- $ringo = db_insert('test')
+ db_insert('test')
->fields(array(
'name' => 'Ringo',
'age' => 28,
diff --git a/core/modules/system/src/Tests/Database/SelectOrderedTest.php b/core/modules/system/src/Tests/Database/SelectOrderedTest.php
index 62d4d2a..9e20c8a 100644
--- a/core/modules/system/src/Tests/Database/SelectOrderedTest.php
+++ b/core/modules/system/src/Tests/Database/SelectOrderedTest.php
@@ -25,7 +25,7 @@ class SelectOrderedTest extends DatabaseTestBase {
*/
function testSimpleSelectOrdered() {
$query = db_select('test');
- $name_field = $query->addField('test', 'name');
+ $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
$query->orderBy($age_field);
$result = $query->execute();
@@ -46,7 +46,7 @@ class SelectOrderedTest extends DatabaseTestBase {
*/
function testSimpleSelectMultiOrdered() {
$query = db_select('test');
- $name_field = $query->addField('test', 'name');
+ $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
$job_field = $query->addField('test', 'job');
$query->orderBy($job_field);
@@ -77,7 +77,7 @@ class SelectOrderedTest extends DatabaseTestBase {
*/
function testSimpleSelectOrderedDesc() {
$query = db_select('test');
- $name_field = $query->addField('test', 'name');
+ $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
$query->orderBy($age_field, 'DESC');
$result = $query->execute();
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index 8a2fbe7..5d65632 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -68,7 +68,6 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
if ($this->entity->getEntityType()->isFieldable()) {
// Add field, so we can modify the Field and FieldInstance entities to
// verify that changes to those indeed clear cache tags.
- $field_name = drupal_strtolower($this->randomName());
entity_create('field_config', array(
'name' => 'configurable_field',
'entity_type' => $this->entity->getEntityTypeId(),
diff --git a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
index 9ce3fb2..5bc8314 100644
--- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
@@ -166,11 +166,11 @@ class ElementsTableSelectTest extends WebTestBase {
);
// Test with a valid value.
- list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => array('row1' => 'row1')));
+ list(, , $errors) = $this->formSubmitHelper($form, array('tableselect' => array('row1' => 'row1')));
$this->assertFalse(isset($errors['tableselect']), 'Option checker allows valid values for checkboxes.');
// Test with an invalid value.
- list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => array('non_existing_value' => 'non_existing_value')));
+ list(, , $errors) = $this->formSubmitHelper($form, array('tableselect' => array('non_existing_value' => 'non_existing_value')));
$this->assertTrue(isset($errors['tableselect']), 'Option checker disallows invalid values for checkboxes.');
}
@@ -191,11 +191,11 @@ class ElementsTableSelectTest extends WebTestBase {
);
// Test with a valid value.
- list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => 'row1'));
+ list(, , $errors) = $this->formSubmitHelper($form, array('tableselect' => 'row1'));
$this->assertFalse(isset($errors['tableselect']), 'Option checker allows valid values for radio buttons.');
// Test with an invalid value.
- list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => 'non_existing_value'));
+ list(, , $errors) = $this->formSubmitHelper($form, array('tableselect' => 'non_existing_value'));
$this->assertTrue(isset($errors['tableselect']), 'Option checker disallows invalid values for radio buttons.');
}
diff --git a/core/modules/system/src/Tests/Lock/LockFunctionalTest.php b/core/modules/system/src/Tests/Lock/LockFunctionalTest.php
index d105c10..6b68385 100644
--- a/core/modules/system/src/Tests/Lock/LockFunctionalTest.php
+++ b/core/modules/system/src/Tests/Lock/LockFunctionalTest.php
@@ -61,7 +61,6 @@ class LockFunctionalTest extends WebTestBase {
// Check the shut-down function.
$lock_acquired_exit = 'TRUE: Lock successfully acquired in system_test_lock_exit()';
- $lock_not_acquired_exit = 'FALSE: Lock not acquired in system_test_lock_exit()';
$this->drupalGet('system-test/lock-exit');
$this->assertText($lock_acquired_exit, 'Lock acquired by the other request before exit.', 'Lock');
$this->assertTrue($lock->acquire('system_test_lock_exit'), 'Lock acquired by this request after the other request exits.', 'Lock');
diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php
index 336c2cb..f017faf 100644
--- a/core/modules/system/src/Tests/System/FrontPageTest.php
+++ b/core/modules/system/src/Tests/System/FrontPageTest.php
@@ -52,7 +52,7 @@ class FrontPageTest extends WebTestBase {
'title' => $this->randomName(8),
'promote' => 1,
);
- $node = $this->drupalCreateNode($settings);
+ $this->drupalCreateNode($settings);
$this->drupalGet('');
$this->assertTitle('Home | Drupal');
diff --git a/core/modules/system/tests/src/Controller/SystemControllerTest.php b/core/modules/system/tests/src/Controller/SystemControllerTest.php
index a1cdfaf..199a44f 100644
--- a/core/modules/system/tests/src/Controller/SystemControllerTest.php
+++ b/core/modules/system/tests/src/Controller/SystemControllerTest.php
@@ -125,8 +125,6 @@ class SystemControllerTest extends UnitTestCase {
'language' => 'nl',
'query' => array(),
);
- // Nothing to do.
- $markup = '<foo>bar</foo>';
$situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array());
// Matching path, plus all matching variations.
$attributes = array(
@@ -162,8 +160,6 @@ class SystemControllerTest extends UnitTestCase {
'language' => 'nl',
'query' => array('foo' => 'bar'),
);
- // Nothing to do.
- $markup = '<foo>bar</foo>';
$situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array());
// Matching path, plus all matching variations.
$attributes = array(
@@ -195,8 +191,6 @@ class SystemControllerTest extends UnitTestCase {
'language' => 'nl',
'query' => array('foo' => 'bar'),
);
- // Nothing to do.
- $markup = '<foo>bar</foo>';
$situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array());
// Matching path, plus all matching variations.
$attributes = array(
@@ -232,8 +226,6 @@ class SystemControllerTest extends UnitTestCase {
'language' => 'en',
'query' => array('foo' => 'bar'),
);
- // Nothing to do.
- $markup = '<foo>bar</foo>';
$situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array());
// Matching path, plus all matching variations.
$attributes = array(