From c081de1202eaea701ab1073b5ef09ad10b2c57ae Mon Sep 17 00:00:00 2001 From: Robbie Averill <robbie@silverstripe.com> Date: Tue, 29 Aug 2017 17:30:22 +1200 Subject: [PATCH] FIX Replace static assertions with instance calls --- tests/php/SiteConfigSubsitesTest.php | 2 +- tests/php/SiteTreeSubsitesTest.php | 12 ++++++------ tests/php/SubsiteXHRControllerTest.php | 8 ++++---- tests/php/SubsitesVirtualPageTest.php | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/php/SiteConfigSubsitesTest.php b/tests/php/SiteConfigSubsitesTest.php index 5bf62b38..1631e294 100644 --- a/tests/php/SiteConfigSubsitesTest.php +++ b/tests/php/SiteConfigSubsitesTest.php @@ -40,6 +40,6 @@ public function testEachSubsiteHasAUniqueSiteConfig() $this->assertEquals('Subsite2', SiteConfig::current_site_config()->Title); $keys = SiteConfig::current_site_config()->extend('cacheKeyComponent'); - static::assertContains('subsite-' . $subsite2->ID, $keys); + $this->assertContains('subsite-' . $subsite2->ID, $keys); } } diff --git a/tests/php/SiteTreeSubsitesTest.php b/tests/php/SiteTreeSubsitesTest.php index 4269edfe..4103f02a 100644 --- a/tests/php/SiteTreeSubsitesTest.php +++ b/tests/php/SiteTreeSubsitesTest.php @@ -255,16 +255,16 @@ public function testPageTypesBlacklistInCMSMain() Subsite::changeSubsite($s1); $hints = Convert::json2array($cmsmain->SiteTreeHints()); $classes = $hints['Root']['disallowedChildren']; - static::assertContains(ErrorPage::class, $classes); - static::assertContains(TestClassA::class, $classes); - static::assertNotContains(TestClassB::class, $classes); + $this->assertContains(ErrorPage::class, $classes); + $this->assertContains(TestClassA::class, $classes); + $this->assertNotContains(TestClassB::class, $classes); Subsite::changeSubsite($s2); $hints = Convert::json2array($cmsmain->SiteTreeHints()); $classes = $hints['Root']['disallowedChildren']; - static::assertNotContains(ErrorPage::class, $classes); - static::assertNotContains(TestClassA::class, $classes); - static::assertNotContains(TestClassB::class, $classes); + $this->assertNotContains(ErrorPage::class, $classes); + $this->assertNotContains(TestClassA::class, $classes); + $this->assertNotContains(TestClassB::class, $classes); } /** diff --git a/tests/php/SubsiteXHRControllerTest.php b/tests/php/SubsiteXHRControllerTest.php index f1c18009..6f30e5b0 100644 --- a/tests/php/SubsiteXHRControllerTest.php +++ b/tests/php/SubsiteXHRControllerTest.php @@ -37,9 +37,9 @@ public function testCanView() $this->assertEquals(200, $result->getStatusCode()); $this->assertEquals('text/json', $result->getHeader('Content-Type')); $body = $result->getBody(); - static::assertContains('Main site', $body); - static::assertContains('Test 1', $body); - static::assertContains('Test 2', $body); - static::assertContains('Test 3', $body); + $this->assertContains('Main site', $body); + $this->assertContains('Test 1', $body); + $this->assertContains('Test 2', $body); + $this->assertContains('Test 3', $body); } } diff --git a/tests/php/SubsitesVirtualPageTest.php b/tests/php/SubsitesVirtualPageTest.php index 5e1004c6..472da719 100644 --- a/tests/php/SubsitesVirtualPageTest.php +++ b/tests/php/SubsitesVirtualPageTest.php @@ -97,11 +97,11 @@ public function testFileLinkRewritingOnVirtualPages() $file->write(); // Verify that the draft and publish virtual pages both have the corrected link - static::assertContains( + $this->assertContains( '<img src="/assets/SubsitesVirtualPageTest/464dedb70a/renamed-test-file.pdf"', DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $svp->ID")->value() ); - static::assertContains( + $this->assertContains( '<img src="/assets/SubsitesVirtualPageTest/464dedb70a/renamed-test-file.pdf"', DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $svp->ID")->value() );