Skip to content

Commit

Permalink
fixing code analysis: use static::assertContains
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Jun 1, 2017
1 parent 9d3c450 commit fea1684
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');
$this->assertContains('subsite-' . $subsite2->ID, $keys);
static::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 @@ -242,16 +242,16 @@ public function testPageTypesBlacklistInCMSMain()
Subsite::changeSubsite($s1);
$hints = Convert::json2array($cmsmain->SiteTreeHints());
$classes = $hints['Root']['disallowedChildren'];
$this->assertContains(ErrorPage::class, $classes);
$this->assertContains(SiteTreeSubsitesTest_ClassA::class, $classes);
$this->assertNotContains(SiteTreeSubsitesTest_ClassB::class, $classes);
static::assertContains(ErrorPage::class, $classes);
static::assertContains(SiteTreeSubsitesTest_ClassA::class, $classes);
static::assertNotContains(SiteTreeSubsitesTest_ClassB::class, $classes);

Subsite::changeSubsite($s2);
$hints = Convert::json2array($cmsmain->SiteTreeHints());
$classes = $hints['Root']['disallowedChildren'];
$this->assertNotContains(ErrorPage::class, $classes);
$this->assertNotContains(SiteTreeSubsitesTest_ClassA::class, $classes);
$this->assertNotContains(SiteTreeSubsitesTest_ClassB::class, $classes);
static::assertNotContains(ErrorPage::class, $classes);
static::assertNotContains(SiteTreeSubsitesTest_ClassA::class, $classes);
static::assertNotContains(SiteTreeSubsitesTest_ClassB::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 @@ -41,9 +41,9 @@ public function testCanView() {
$this->assertEquals(200, $result->getStatusCode());
$this->assertEquals('text/json', $result->getHeader('Content-Type'));
$body = $result->getBody();
$this->assertContains('Main site', $body);
$this->assertContains('Test 1', $body);
$this->assertContains('Test 2', $body);
$this->assertContains('Test 3', $body);
static::assertContains('Main site', $body);
static::assertContains('Test 1', $body);
static::assertContains('Test 2', $body);
static::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,9 +97,9 @@ public function testFileLinkRewritingOnVirtualPages()
$file->write();

// Verify that the draft and publish virtual pages both have the corrected link
$this->assertContains('<img src="/assets/SubsitesVirtualPageTest/464dedb70a/renamed-test-file.pdf"',
static::assertContains('<img src="/assets/SubsitesVirtualPageTest/464dedb70a/renamed-test-file.pdf"',
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $svp->ID")->value());
$this->assertContains('<img src="/assets/SubsitesVirtualPageTest/464dedb70a/renamed-test-file.pdf"',
static::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 fea1684

Please sign in to comment.