fixing code analysis: phpunit: use assertInstanceOf

This commit is contained in:
Werner M. Krauß 2017-06-01 15:12:18 +02:00
parent 25754e1158
commit 849c0061e8
3 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class FileSubsitesTest extends BaseSubsiteTest
$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());
}

View File

@ -16,7 +16,7 @@ class GroupSubsitesTest extends BaseSubsiteTest
{
$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()

View File

@ -67,10 +67,10 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
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()));
}