/
GH927Test.php
54 lines (45 loc) · 1.1 KB
/
GH927Test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
declare(strict_types=1);
namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Doctrine\ODM\MongoDB\Tests\BaseTest;
class GH927Test extends BaseTest
{
public function testInheritedClassHasAssociationMapping(): void
{
$parentMetadata = $this->dm->getClassMetadata(GH927Parent::class);
$this->assertArrayHasKey('reference', $parentMetadata->associationMappings);
$childMetadata = $this->dm->getClassMetadata(GH927Child::class);
$this->assertArrayHasKey('reference', $childMetadata->associationMappings);
}
}
/** @ODM\Document */
class GH927Parent
{
/**
* @ODM\Id
*
* @var string|null
*/
protected $id;
/**
* @ODM\ReferenceOne(targetDocument=Doctrine\ODM\MongoDB\Tests\Functional\Ticket\GH927Reference::class)
*
* @var GH927Reference|null
*/
protected $reference;
}
/** @ODM\Document */
class GH927Child extends GH927Parent
{
}
/** @ODM\Document */
class GH927Reference
{
/**
* @ODM\Id
*
* @var string|null
*/
protected $id;
}