X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FCommon%2FEarlyRenderingControllerTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FCommon%2FEarlyRenderingControllerTest.php;h=9d6c0af5d10be511791aec72a7e217098f10c40b;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=1afdd4eeb37955d0b7501dd8259d8c88fb7a5b23;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php b/web/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php similarity index 84% rename from web/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php rename to web/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php index 1afdd4eeb..9d6c0af5d 100644 --- a/web/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php +++ b/web/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php @@ -1,16 +1,16 @@ drupalGet(Url::fromRoute('early_rendering_controller_test.response')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response.early')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); // Response object with attachments: non-early & early. $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response-with-attachments')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response-with-attachments.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\AttachmentsTestResponse.'); @@ -69,7 +69,7 @@ class EarlyRenderingControllerTest extends WebTestBase { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-response')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-response.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\CacheableTestResponse.'); @@ -78,17 +78,17 @@ class EarlyRenderingControllerTest extends WebTestBase { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object')); $this->assertResponse(200); $this->assertRaw('TestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object.early')); $this->assertResponse(200); $this->assertRaw('TestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); // Basic domain object with attachments: non-early & early. $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object-with-attachments')); $this->assertResponse(200); $this->assertRaw('AttachmentsTestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object-with-attachments.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\AttachmentsTestDomainObject.'); @@ -97,14 +97,14 @@ class EarlyRenderingControllerTest extends WebTestBase { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-domain-object')); $this->assertResponse(200); $this->assertRaw('CacheableTestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-domain-object.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\CacheableTestDomainObject.'); // The exceptions are expected. Do not interpret them as a test failure. // Not using File API; a potential error must trigger a PHP warning. - unlink(\Drupal::root() . '/' . $this->siteDirectory . '/error.log'); + unlink($this->root . '/' . $this->siteDirectory . '/error.log'); } }