Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Doctrine/ORM/Mapping/ReflectionEnumProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public function __construct(ReflectionProperty $originalReflectionProperty, stri
{
$this->originalReflectionProperty = $originalReflectionProperty;
$this->enumType = $enumType;

parent::__construct(
$originalReflectionProperty->getDeclaringClass()->getName(),
$originalReflectionProperty->getName()
);
}

/**
Expand Down
16 changes: 14 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\Tests\ORM\Functional;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\Tools\SchemaTool;
Expand All @@ -22,11 +23,11 @@ class EnumTest extends OrmFunctionalTestCase
{
public function setUp(): void
{
parent::setUp();

$this->_em = $this->getEntityManager(null, new AttributeDriver([dirname(__DIR__, 2) . '/Models/Enums']));
$this->_schemaTool = new SchemaTool($this->_em);

parent::setUp();

if ($this->isSecondLevelCacheEnabled) {
$this->markTestSkipped();
}
Expand Down Expand Up @@ -101,4 +102,15 @@ public function provideCardClasses(): array
TypedCard::class => [TypedCard::class],
];
}

public function testGetAttributesDelegate(): void
Comment thread
beberlei marked this conversation as resolved.
Outdated
{
$metadata = $this->_em->getClassMetadata(Card::class);
$property = $metadata->getReflectionProperty('suit');

$attributes = $property->getAttributes();

$this->assertCount(1, $attributes);
$this->assertEquals(Column::class, $attributes[0]->getName());
}
}