Fix for DDC-944
This commit is contained in:
parent
6988b55f50
commit
e46c65db09
@ -68,9 +68,9 @@ class MappingException extends \Doctrine\ORM\ORMException
|
||||
return new self("No mapping file found named '$fileName' for class '$entityName'.");
|
||||
}
|
||||
|
||||
public static function mappingNotFound($fieldName)
|
||||
public static function mappingNotFound($className, $fieldName)
|
||||
{
|
||||
return new self("No mapping found for field '$fieldName'.");
|
||||
return new self("No mapping found for field '$fieldName' on class '$className'.");
|
||||
}
|
||||
|
||||
public static function oneToManyRequiresMappedBy($fieldName)
|
||||
|
@ -289,4 +289,15 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
|
||||
$cm->setIdentifier(array('name', 'username'));
|
||||
$this->assertTrue($cm->isIdentifierComposite);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group DDC-944
|
||||
*/
|
||||
public function testMappingNotFound()
|
||||
{
|
||||
$cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');
|
||||
|
||||
$this->setExpectedException('Doctrine\ORM\Mapping\MappingException', "No mapping found for field 'foo' on class 'Doctrine\Tests\Models\CMS\CmsUser'.");
|
||||
$cm->getFieldMapping('foo');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user