Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Fixed DataObjectTest->testNewClassInstance() to use same ancest…

…ry classes, broken in dc36725
  • Loading branch information...
commit 00b1bf8ef7e1e0d8d12976ef451276032156f0f9 1 parent d157e6e
@chillu chillu authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 tests/model/DataObjectTest.php
View
19 tests/model/DataObjectTest.php
@@ -697,20 +697,21 @@ function testPopulateDefaults() {
}
function testNewClassInstance() {
- $dataObject = $this->objFromFixture('DataObjectTest_TeamComment', 'comment1');
- $changedDO = $dataObject->newClassInstance('File');
+ $dataObject = $this->objFromFixture('DataObjectTest_Team', 'team1');
+ $changedDO = $dataObject->newClassInstance('DataObjectTest_SubTeam');
$changedFields = $changedDO->getChangedFields();
// Don't write the record, it will reset changed fields
- $this->assertType('File', $changedDO);
- $this->assertEquals($changedDO->ClassName, 'File');
+ $this->assertType('DataObjectTest_SubTeam', $changedDO);
+ $this->assertEquals($changedDO->ClassName, 'DataObjectTest_SubTeam');
$this->assertContains('ClassName', array_keys($changedFields));
- $this->assertEquals($changedFields['ClassName']['before'], 'DataObjectTest_TeamComment');
- $this->assertEquals($changedFields['ClassName']['after'], 'File');
-
+ $this->assertEquals($changedFields['ClassName']['before'], 'DataObjectTest_Team');
+ $this->assertEquals($changedFields['ClassName']['after'], 'DataObjectTest_SubTeam');
+
$changedDO->write();
- $this->assertType('File', $changedDO);
- $this->assertEquals($changedDO->ClassName, 'File');
+
+ $this->assertType('DataObjectTest_SubTeam', $changedDO);
+ $this->assertEquals($changedDO->ClassName, 'DataObjectTest_SubTeam');
}
function testManyManyExtraFields() {
Please sign in to comment.
Something went wrong with that request. Please try again.