diff --git a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php b/core/modules/system/src/Tests/Ajax/ElementValidationTest.php index 81ed62de90cdfcd8524a04cb497f2f385baf6858..a6e9daa916f3f626fb4eb4470a718f63ea31ce3c 100644 --- a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php +++ b/core/modules/system/src/Tests/Ajax/ElementValidationTest.php @@ -28,11 +28,10 @@ public static function getInfo() { * 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 @@ function testAjaxElementValidation() { $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 2f4689bc26a5cec12305b97a15ba823726a02610..9997813db073c623d0a9306a8446a68b8b9bffd2 100644 --- a/core/modules/system/src/Tests/Common/AddFeedTest.php +++ b/core/modules/system/src/Tests/Common/AddFeedTest.php @@ -68,7 +68,7 @@ function testBasicFeedAddNoTitle() { $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 fd6ac63ba9dd5516f1c6ff4dacce1ccc8f0ac574..f4ac5ff5249201026247a9fe3f0f7ce92106ab54 100644 --- a/core/modules/system/src/Tests/Common/WriteRecordTest.php +++ b/core/modules/system/src/Tests/Common/WriteRecordTest.php @@ -75,7 +75,7 @@ function testDrupalWriteRecord() { $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 @@ function testDrupalWriteRecord() { $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 @@ function testDrupalWriteRecord() { // 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 @@ function testDrupalWriteRecord() { // 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 @@ function testDrupalWriteRecord() { // 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 0aa4d5bdbae26fd02d6b8c0992f75c809995a23f..da14f5c4c98ee55a89179060097fd3b70856f2d5 100644 --- a/core/modules/system/src/Tests/Database/DatabaseTestBase.php +++ b/core/modules/system/src/Tests/Database/DatabaseTestBase.php @@ -76,7 +76,7 @@ static function addSampleData() { )) ->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 62d4d2ab17ae2b06e5361e31f421ab37f3559fe8..9e20c8a014bbfdc456bd3421c85a14c0b587d599 100644 --- a/core/modules/system/src/Tests/Database/SelectOrderedTest.php +++ b/core/modules/system/src/Tests/Database/SelectOrderedTest.php @@ -25,7 +25,7 @@ public static function getInfo() { */ 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 @@ function testSimpleSelectOrdered() { */ 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 @@ function testSimpleSelectMultiOrdered() { */ 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 8a2fbe7ac4ccb151752d2fa2d72dfbba236001c7..5d65632f933d575be59a78110ba34400c2f665a2 100644 --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php @@ -68,7 +68,6 @@ public function setUp() { 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 9ce3fb2fbae5f672185397a3f2b853557cb6a443..5bc8314b02814bca50091ac189bc64eb3606d861 100644 --- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php +++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php @@ -166,11 +166,11 @@ function testMultipleTrueOptionchecker() { ); // 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 @@ function testMultipleFalseOptionchecker() { ); // 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 d105c10ab151e2cfea4a2c6b7d4732e8b973e2b0..6b68385d599c8f7dba4b8fa4f2d1130338af27e3 100644 --- a/core/modules/system/src/Tests/Lock/LockFunctionalTest.php +++ b/core/modules/system/src/Tests/Lock/LockFunctionalTest.php @@ -61,7 +61,6 @@ public function testLockAcquire() { // 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 336c2cbd7e0668f0419a962d9d5586d682c48244..f017fafb228d133945191c9ad67939d58caaca76 100644 --- a/core/modules/system/src/Tests/System/FrontPageTest.php +++ b/core/modules/system/src/Tests/System/FrontPageTest.php @@ -52,7 +52,7 @@ public function testDrupalFrontPage() { '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 a1cdfaf888f21293852ab0e38dd6745981aac038..199a44f5cf9ced1b7ca7eeb55dfff01ffc28c9f8 100644 --- a/core/modules/system/tests/src/Controller/SystemControllerTest.php +++ b/core/modules/system/tests/src/Controller/SystemControllerTest.php @@ -125,8 +125,6 @@ public function providerTestSetLinkActiveClass() { 'language' => 'nl', 'query' => array(), ); - // Nothing to do. - $markup = 'bar'; $situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array()); // Matching path, plus all matching variations. $attributes = array( @@ -162,8 +160,6 @@ public function providerTestSetLinkActiveClass() { 'language' => 'nl', 'query' => array('foo' => 'bar'), ); - // Nothing to do. - $markup = 'bar'; $situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array()); // Matching path, plus all matching variations. $attributes = array( @@ -195,8 +191,6 @@ public function providerTestSetLinkActiveClass() { 'language' => 'nl', 'query' => array('foo' => 'bar'), ); - // Nothing to do. - $markup = 'bar'; $situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array()); // Matching path, plus all matching variations. $attributes = array( @@ -232,8 +226,6 @@ public function providerTestSetLinkActiveClass() { 'language' => 'en', 'query' => array('foo' => 'bar'), ); - // Nothing to do. - $markup = 'bar'; $situations[] = array('context' => $context, 'is active' => FALSE, 'attributes' => array()); // Matching path, plus all matching variations. $attributes = array(