mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Partially reverted r114744
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114745 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7280a64d6b
commit
3d2552a453
@ -1154,7 +1154,6 @@ class Translatable extends DataObjectDecorator implements PermissionProvider {
|
|||||||
$newTranslation = new $class;
|
$newTranslation = new $class;
|
||||||
|
|
||||||
// copy all fields from owner (apart from ID)
|
// copy all fields from owner (apart from ID)
|
||||||
var_dump($this->owner->toMap());
|
|
||||||
$newTranslation->update($this->owner->toMap());
|
$newTranslation->update($this->owner->toMap());
|
||||||
|
|
||||||
// If the object has Hierarchy extension,
|
// If the object has Hierarchy extension,
|
||||||
|
@ -5,23 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
class DataObjectTest extends SapphireTest {
|
class DataObjectTest extends SapphireTest {
|
||||||
|
|
||||||
function testToMap() {
|
|
||||||
$obj = $this->objFromFixture('DataObjectTest_SubTeam', 'subteam1');
|
|
||||||
|
|
||||||
$map = $obj->toMap();
|
|
||||||
|
|
||||||
$this->assertArrayHasKey('ID', $map, 'Contains base fields');
|
|
||||||
$this->assertArrayHasKey('Title', $map, 'Contains fields from parent class');
|
|
||||||
$this->assertArrayHasKey('SubclassDatabaseField', $map, 'Contains fields from concrete class');
|
|
||||||
|
|
||||||
$this->assertEquals($obj->ID, $map['ID'], 'Contains values from base fields');
|
|
||||||
$this->assertEquals($obj->Title, $map['Title'], 'Contains values from parent class fields');
|
|
||||||
$this->assertEquals($obj->SubclassDatabaseField, $map['SubclassDatabaseField'], 'Contains values from concrete class fields');
|
|
||||||
|
|
||||||
$newObj = new DataObjectTest_SubTeam();
|
|
||||||
$this->assertArrayHasKey('Title', $map, 'Contains null fields');
|
|
||||||
}
|
|
||||||
|
|
||||||
static $fixture_file = 'sapphire/tests/DataObjectTest.yml';
|
static $fixture_file = 'sapphire/tests/DataObjectTest.yml';
|
||||||
|
|
||||||
protected $extraDataObjects = array(
|
protected $extraDataObjects = array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user