1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Fix for DDC-944

This commit is contained in:
Benjamin Eberlei 2010-12-22 00:17:50 +01:00
parent 6988b55f50
commit e46c65db09
2 changed files with 13 additions and 2 deletions

View File

@ -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)

View File

@ -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');
}
}