[DDC-2700] Add test and fix CS.
This commit is contained in:
parent
a75d73b889
commit
53ed898684
@ -1031,12 +1031,14 @@ class ClassMetadataInfo implements ClassMetadata
|
||||
*/
|
||||
public function isIdentifier($fieldName)
|
||||
{
|
||||
if (0 == count($this->identifier)) {
|
||||
if ( ! $this->identifier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $this->isIdentifierComposite) {
|
||||
return $fieldName === $this->identifier[0];
|
||||
}
|
||||
|
||||
return in_array($fieldName, $this->identifier);
|
||||
}
|
||||
|
||||
|
@ -1091,6 +1091,25 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
|
||||
|
||||
$this->assertEquals(array('sequenceName' => 'foo', 'quoted' => true), $cm->sequenceGeneratorDefinition);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group DDC-2700
|
||||
*/
|
||||
public function testIsIdentifierMappedSuperClass()
|
||||
{
|
||||
$class = new ClassMetadata(__NAMESPACE__ . '\\DDC2700MappedSuperClass');
|
||||
|
||||
$this->assertFalse($class->isIdentifier('foo'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @MappedSuperclass
|
||||
*/
|
||||
class DDC2700MappedSuperClass
|
||||
{
|
||||
/** @Column */
|
||||
private $foo;
|
||||
}
|
||||
|
||||
class MyNamespacedNamingStrategy extends \Doctrine\ORM\Mapping\DefaultNamingStrategy
|
||||
|
Loading…
x
Reference in New Issue
Block a user