Skip to content

Commit

Permalink
fixing code analysis: phpunit: use assertInstanceOf
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Jun 1, 2017
1 parent 25754e1 commit 849c006
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/php/FileSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testTrivialFeatures()
$this->assertEquals(' * FileTitle', $file->alternateTreeTitle());
$file->SubsiteID = $this->objFromFixture(Subsite::class, 'domaintest1')->ID;
$this->assertEquals('FileTitle', $file->getTreeTitle());
$this->assertTrue(singleton(Folder::class)->getCMSFields() instanceof FieldList);
$this->assertInstanceOf(FieldList::class, singleton(Folder::class)->getCMSFields());
Subsite::changeSubsite(1);
$this->assertEquals('subsite-1', $file->getExtensionInstance(FileSubsites::class)->cacheKeyComponent());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/php/GroupSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function testTrivialFeatures()
{
$this->assertTrue(is_array(singleton(GroupSubsites::class)->extraStatics()));
$this->assertTrue(is_array(singleton(GroupSubsites::class)->providePermissions()));
$this->assertTrue(singleton(Group::class)->getCMSFields() instanceof FieldList);
$this->assertInstanceOf(FieldList::class, singleton(Group::class)->getCMSFields());
}

public function testAlternateTreeTitle()
Expand Down
6 changes: 3 additions & 3 deletions tests/php/SiteTreeSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public function testPagesInDifferentSubsitesCanShareURLSegment()

public function testBasicSanity()
{
$this->assertTrue(singleton(SiteTree::class)->getSiteConfig() instanceof SiteConfig);
$this->assertInstanceOf(SiteConfig::class, singleton(SiteTree::class)->getSiteConfig());
// The following assert is breaking in Translatable.
$this->assertTrue(singleton(SiteTree::class)->getCMSFields() instanceof FieldList);
$this->assertTrue(singleton(SubsitesVirtualPage::class)->getCMSFields() instanceof FieldList);
$this->assertInstanceOf(FieldList::class, singleton(SiteTree::class)->getCMSFields());
$this->assertInstanceOf(FieldList::class, singleton(SubsitesVirtualPage::class)->getCMSFields());
$this->assertTrue(is_array(singleton(SiteTreeSubsites::class)->extraStatics()));
}

Expand Down

0 comments on commit 849c006

Please sign in to comment.