From c72bae3a8e5bb9c737641f829d620eea65f7d68b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 9 May 2012 23:06:55 +1200 Subject: [PATCH] MINOR Fixing assertType() assertions with assertInstanceOf() --- tests/controller/CMSMainTest.php | 8 ++++---- tests/model/SiteTreeActionsTest.php | 4 ++-- tests/model/SiteTreeTest.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/controller/CMSMainTest.php b/tests/controller/CMSMainTest.php index 1d49e457..49ae97ff 100644 --- a/tests/controller/CMSMainTest.php +++ b/tests/controller/CMSMainTest.php @@ -151,7 +151,7 @@ class CMSMainTest extends FunctionalTest { $response = $this->get('admin/cms/getitem?ID=' . $pageID . '&ajax=1'); $livePage = Versioned::get_one_by_stage("SiteTree", "Live", "\"SiteTree\".\"ID\" = $pageID"); - $this->assertType('SiteTree', $livePage); + $this->assertInstanceOf('SiteTree', $livePage); $this->assertTrue($livePage->canDelete()); // Check that the 'restore' button exists as a simple way of checking that the correct page is returned. @@ -175,12 +175,12 @@ class CMSMainTest extends FunctionalTest { $this->assertNull($cmsMain->getRecord('asdf')); // Pages that are on draft and aren't on draft should both work - $this->assertType('Page', $cmsMain->getRecord($page1ID)); - $this->assertType('Page', $cmsMain->getRecord($this->idFromFixture('Page','page2'))); + $this->assertInstanceOf('Page', $cmsMain->getRecord($page1ID)); + $this->assertInstanceOf('Page', $cmsMain->getRecord($this->idFromFixture('Page','page2'))); // This functionality isn't actually used any more. $newPage = $cmsMain->getRecord('new-Page-5'); - $this->assertType('Page', $newPage); + $this->assertInstanceOf('Page', $newPage); $this->assertEquals('5', $newPage->ParentID); } diff --git a/tests/model/SiteTreeActionsTest.php b/tests/model/SiteTreeActionsTest.php index 0cf51195..f49cd18d 100644 --- a/tests/model/SiteTreeActionsTest.php +++ b/tests/model/SiteTreeActionsTest.php @@ -64,7 +64,7 @@ class SiteTreeActionsTest extends FunctionalTest { // Get the live version of the page $page = Versioned::get_one_by_stage("SiteTree", "Live", "\"SiteTree\".\"ID\" = $pageID"); - $this->assertType("SiteTree", $page); + $this->assertInstanceOf("SiteTree", $page); // Check that someone without the right permission can't delete the page $editor = $this->objFromFixture('Member', 'cmsnodeleteeditor'); @@ -116,7 +116,7 @@ class SiteTreeActionsTest extends FunctionalTest { // Get the live version of the page $page = Versioned::get_one_by_stage("SiteTree", "Live", "\"SiteTree\".\"ID\" = $pageID"); - $this->assertType('SiteTree', $page); + $this->assertInstanceOf('SiteTree', $page); $actions = $page->getCMSActions(); diff --git a/tests/model/SiteTreeTest.php b/tests/model/SiteTreeTest.php index 1e7e9b7c..de6e8d85 100644 --- a/tests/model/SiteTreeTest.php +++ b/tests/model/SiteTreeTest.php @@ -157,7 +157,7 @@ class SiteTreeTest extends SapphireTest { $child->Title = 'Page Title'; $child->setParent($parent); - $this->assertType("SiteTree", $child->Parent); + $this->assertInstanceOf("SiteTree", $child->Parent); $this->assertEquals("Section Title", $child->Parent->Title); } @@ -166,7 +166,7 @@ class SiteTreeTest extends SapphireTest { $child = new SiteTreeTest_PageNode(); $child->setParent($parent); - $this->assertType('SiteTreeTest_PageNode', $child->Parent); + $this->assertInstanceOf('SiteTreeTest_PageNode', $child->Parent); } /**