diff -u b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php --- b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -151,10 +151,10 @@ * Tests the ::cronRun() method. */ public function testCronRun() { - $last_cron_time = $this->container->get('state')->get('system.cron_last'); + $last_cron_time = \Drupal::state()->get('system.cron_last'); $this->cronRun(); $this->assertSession()->statusCodeEquals(204); - $next_cron_time = $this->container->get('state')->get('system.cron_last'); + $next_cron_time = \Drupal::state()->get('system.cron_last'); $this->assertGreaterThan($last_cron_time, $next_cron_time); } diff -u b/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php b/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php --- b/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php +++ b/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php @@ -11,7 +11,7 @@ * Runs cron on the test site. */ protected function cronRun() { - $this->drupalGet('cron/' . $this->container->get('state')->get('system.cron_key')); + $this->drupalGet('cron/' . \Drupal::state()->get('system.cron_key')); } }