mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
fixing code analysis: phpunit: use assertInstanceOf
This commit is contained in:
parent
25754e1158
commit
849c0061e8
@ -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());
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -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()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user