MINOR Fixing assertType() assertions with assertInstanceOf()

This commit is contained in:
Sean Harvey 2012-05-09 23:06:55 +12:00
parent dedb9d0461
commit c72bae3a8e
3 changed files with 8 additions and 8 deletions

View File

@ -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);
}

View File

@ -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();

View File

@ -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);
}
/**