Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Fixing assertType() assertions with assertInstanceOf()

  • Loading branch information...
commit c72bae3a8e5bb9c737641f829d620eea65f7d68b 1 parent dedb9d0
Sean Harvey halkyon authored
8 tests/controller/CMSMainTest.php
View
@@ -151,7 +151,7 @@ function testDraftDeletedPageCanBeOpenedInCMS() {
$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 @@ function testGetRecord() {
$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);
}
4 tests/model/SiteTreeActionsTest.php
View
@@ -64,7 +64,7 @@ function testActionsNoDeletePublishedRecord() {
// 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 @@ function testActionsDeletedFromStageRecord() {
// 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();
4 tests/model/SiteTreeTest.php
View
@@ -157,7 +157,7 @@ function testParentNodeCachedInMemory() {
$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 @@ function testParentModelReturnType() {
$child = new SiteTreeTest_PageNode();
$child->setParent($parent);
- $this->assertType('SiteTreeTest_PageNode', $child->Parent);
+ $this->assertInstanceOf('SiteTreeTest_PageNode', $child->Parent);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.