Skip to content

Commit

Permalink
FIX Replace static assertions with instance calls
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Aug 29, 2017
1 parent 7ffaf61 commit c081de1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/php/SiteConfigSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
12 changes: 6 additions & 6 deletions tests/php/SiteTreeSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/php/SubsiteXHRControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions tests/php/SubsitesVirtualPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down

0 comments on commit c081de1

Please sign in to comment.