diff --git a/core/modules/rest/src/Tests/Views/StyleSerializerTest.php b/core/modules/rest/src/Tests/Views/StyleSerializerTest.php index 2699323..443be45 100644 --- a/core/modules/rest/src/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/src/Tests/Views/StyleSerializerTest.php @@ -181,9 +181,13 @@ public function testSerializerResponses() { $actual_xml = $this->drupalGetWithFormat('test/serialize/entity', 'xml'); $this->assertIdentical($actual_xml, $expected, 'The expected XML output was found.'); + // Set the site to maintenance mode. $this->container->get('state')->set('system.maintenance_mode', TRUE); - \Drupal::service('page_cache_kill_switch')->trigger(); + + // Invalidate all page caches. + \Drupal::cache('render')->invalidateAll(); + $this->drupalGetWithFormat('test/serialize/entity', 'json'); // Verify that the endpoint is unavailable for anonymous users. $this->assertResponse(503);