diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php
index 81ed62d..a6e9daa 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/ElementValidationTest.php
+++ b/core/modules/system/lib/Drupal/system/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/lib/Drupal/system/Tests/Common/AddFeedTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
index b871710..b9dcbb4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
@@ -70,7 +70,7 @@ function testBasicFeedAddNoTitle() {
       ),
     );
 
-    foreach ($urls as $description => $feed_info) {
+    foreach ($urls as $feed_info) {
       $build['#attached']['drupal_add_feed'][] = array($feed_info['input_url'], $feed_info['title']);
     }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php
index ffe5fdb..e9eeadf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php
@@ -73,7 +73,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.');
@@ -84,7 +84,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.');
@@ -93,7 +93,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();
@@ -103,7 +103,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.');
@@ -111,20 +111,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/lib/Drupal/system/Tests/Database/DatabaseTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php
index 0aa4d5b..da14f5c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php
+++ b/core/modules/system/lib/Drupal/system/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/lib/Drupal/system/Tests/Database/SelectOrderedTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php
index 62d4d2a..9e20c8a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php
+++ b/core/modules/system/lib/Drupal/system/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/lib/Drupal/system/Tests/Form/ProgrammaticTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
index 6753239..e6cdba5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
@@ -33,10 +33,6 @@ public static function getInfo() {
    * Test the programmatic form submission workflow.
    */
   function testSubmissionWorkflow() {
-    // Backup the current batch status and reset it to avoid conflicts while
-    // processing the dummy form submit handler.
-    $current_batch = $batch =& batch_get();
-    $batch = array();
 
     // Test that a programmatic form submission is rejected when a required
     // textfield is omitted and correctly processed when it is provided.
@@ -60,9 +56,6 @@ function testSubmissionWorkflow() {
     $this->submitForm(array('op' => 'Submit with limited validation', 'field_to_validate' => 'all'), FALSE);
     $this->submitForm(array('op' => 'Submit with limited validation', 'field_to_validate' => 'textfield'), FALSE);
     $this->submitForm(array('op' => 'Submit with limited validation', 'field_to_validate' => 'field_to_validate'), TRUE);
-
-    // Restore the current batch status.
-    $batch = $current_batch;
   }
 
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php
index d105c10..6b68385 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php
+++ b/core/modules/system/lib/Drupal/system/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/lib/Drupal/system/Tests/System/FrontPageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
index 336c2cb..f017faf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
+++ b/core/modules/system/lib/Drupal/system/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/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php b/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php
index b407fe8..49593a8 100644
--- a/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/MimeTypeMatcherTest.php
@@ -106,7 +106,7 @@ public function testNoRouteFound() {
     // This should throw NotAcceptableHttpException.
     $request = Request::create('path/two', 'GET');
     $request->headers->set('Accept', 'application/json, text/xml;q=0.9');
-    $routes = $matcher->filter($routes, $request);
+    $matcher->filter($routes, $request);
   }
 
 }
