From 849c0061e888cc4dfc71203d1b090dddd6c49e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Werner=20M=2E=20Krau=C3=9F?= Date: Thu, 1 Jun 2017 15:12:18 +0200 Subject: [PATCH] fixing code analysis: phpunit: use assertInstanceOf --- tests/php/FileSubsitesTest.php | 2 +- tests/php/GroupSubsitesTest.php | 2 +- tests/php/SiteTreeSubsitesTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/php/FileSubsitesTest.php b/tests/php/FileSubsitesTest.php index 57ab4f31..b18001ec 100644 --- a/tests/php/FileSubsitesTest.php +++ b/tests/php/FileSubsitesTest.php @@ -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()); } diff --git a/tests/php/GroupSubsitesTest.php b/tests/php/GroupSubsitesTest.php index 73b30952..d936583a 100644 --- a/tests/php/GroupSubsitesTest.php +++ b/tests/php/GroupSubsitesTest.php @@ -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() diff --git a/tests/php/SiteTreeSubsitesTest.php b/tests/php/SiteTreeSubsitesTest.php index 9348f5c5..5d29a06c 100644 --- a/tests/php/SiteTreeSubsitesTest.php +++ b/tests/php/SiteTreeSubsitesTest.php @@ -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())); }