diff core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php	Thu May 09 15:34:47 2019 +0100
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\statistics\Functional;
 
+use Drupal\Core\Database\Database;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\node\Entity\Node;
 
@@ -82,7 +83,7 @@
       ->save();
 
     // Clear the logs.
-    db_truncate('node_counter');
+    Database::getConnection()->truncate('node_counter');
     $this->client = \Drupal::httpClient();
   }
 
@@ -99,13 +100,13 @@
     // Verify that logging scripts are not found on a non-node page.
     $this->drupalGet('node');
     $settings = $this->getDrupalSettings();
-    $this->assertNoPattern($expected_library, 'Statistics library JS not found on node page.');
+    $this->assertSession()->responseNotMatches($expected_library, 'Statistics library JS not found on node page.');
     $this->assertFalse(isset($settings['statistics']), 'Statistics settings not found on node page.');
 
     // Verify that logging scripts are not found on a non-existent node page.
     $this->drupalGet('node/9999');
     $settings = $this->getDrupalSettings();
-    $this->assertNoPattern($expected_library, 'Statistics library JS not found on non-existent node page.');
+    $this->assertSession()->responseNotMatches($expected_library, 'Statistics library JS not found on non-existent node page.');
     $this->assertFalse(isset($settings['statistics']), 'Statistics settings not found on node page.');
 
     // Verify that logging scripts are found on a valid node page.