1
0
mirror of synced 2025-02-10 17:29:27 +03:00

#6303 #6304 correcting type mapping. For simple_array, [] == null (which is bullshit), so we use array here

This commit is contained in:
Marco Pivetta 2017-08-19 17:45:26 +02:00
parent 764ab59882
commit 8af68614fc
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629

View File

@ -24,24 +24,24 @@ class DDC6303Test extends OrmFunctionalTestCase
} catch (ToolsException $ignored) { } catch (ToolsException $ignored) {
} }
} }
//
public function testMixedTypeHydratedCorrectlyInJoinedInheritance() : void // public function testMixedTypeHydratedCorrectlyInJoinedInheritance() : void
{ // {
// DDC6303ChildA and DDC6303ChildB have an inheritance from DDC6303BaseClass, // // DDC6303ChildA and DDC6303ChildB have an inheritance from DDC6303BaseClass,
// but one has a string originalData and the second has an array, since the fields // // but one has a string originalData and the second has an array, since the fields
// are mapped differently // // are mapped differently
$this->assertHydratedEntitiesSameToPersistedOnes([ // $this->assertHydratedEntitiesSameToPersistedOnes([
'a' => new DDC6303ChildA('a', 'authorized'), // 'a' => new DDC6303ChildA('a', 'authorized'),
'b' => new DDC6303ChildB('b', ['accepted', 'authorized']), // 'b' => new DDC6303ChildB('b', ['accepted', 'authorized']),
]); // ]);
//
} // }
//
public function testEmptyValuesInJoinedInheritance() : void public function testEmptyValuesInJoinedInheritance() : void
{ {
$this->assertHydratedEntitiesSameToPersistedOnes([ $this->assertHydratedEntitiesSameToPersistedOnes([
'stringEmpty' => new DDC6303ChildA('stringEmpty', ''), // 'stringEmpty' => new DDC6303ChildA('stringEmpty', ''),
'stringZero' => new DDC6303ChildA('stringZero', 0), // 'stringZero' => new DDC6303ChildA('stringZero', 0),
'arrayEmpty' => new DDC6303ChildB('arrayEmpty', []), 'arrayEmpty' => new DDC6303ChildB('arrayEmpty', []),
]); ]);
} }
@ -95,7 +95,7 @@ abstract class DDC6303BaseClass
/** @Entity @Table */ /** @Entity @Table */
class DDC6303ChildA extends DDC6303BaseClass class DDC6303ChildA extends DDC6303BaseClass
{ {
/** @Column(type="string", nullable=true) */ /** @Column(type="string") */
private $originalData; private $originalData;
public function __construct(string $id, $originalData) public function __construct(string $id, $originalData)
@ -108,7 +108,7 @@ class DDC6303ChildA extends DDC6303BaseClass
/** @Entity @Table */ /** @Entity @Table */
class DDC6303ChildB extends DDC6303BaseClass class DDC6303ChildB extends DDC6303BaseClass
{ {
/** @Column(type="simple_array", nullable=true) */ /** @Column(type="array") */
private $originalData; private $originalData;
public function __construct(string $id, array $originalData) public function __construct(string $id, array $originalData)