Permalink
Browse files

Moving exception throwing for invalid file mappings to Doctrine\Commo…

…n\Persistence\Mapping\Driver\FileDriver
  • Loading branch information...
Ocramius committed Jan 17, 2012
1 parent 03fb734 commit ccace8cb8bbfe0ef49e336c1f4e81ba4272879ac
@@ -41,20 +41,4 @@
*/
abstract class AbstractFileDriver extends FileDriver implements Driver
{
- /**
- * Get the element of schema meta data for the class from the mapping file.
- * This will lazily load the mapping file if it is not loaded yet
- *
- * @return array $element The element of schema meta data
- * @throws MappingException
- * @todo move behavior to FileDriver
- */
- public function getElement($className)
- {
- $result = parent::getElement($className);
- if($result === null) {
- throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
- }
- return $result;
- }
}
@@ -78,11 +78,6 @@ public static function mappingFileNotFound($entityName, $fileName)
return new self("No mapping file found named '$fileName' for class '$entityName'.");
}
- public static function invalidMappingFile($entityName, $fileName)
- {
- return new self("Invalid mapping file '$fileName' for class '$entityName'.");
- }
-
/**
* Exception for invalid property name override.
*
@@ -144,7 +139,7 @@ public static function missingResultSetMappingFieldName($entity, $resultName)
{
return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.');
}
-
+
public static function nameIsMandatoryForSqlResultSetMapping($className)
{
return new self("Result set mapping name on entity class '$className' is not defined.");
@@ -55,7 +55,7 @@ public function testIdentifierWithAssociationKey()
/**
* @group DDC-1468
*
- * @expectedException Doctrine\ORM\Mapping\MappingException
+ * @expectedException Doctrine\Common\Persistence\Mapping\MappingException
* @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'.
*/
public function testInvalidMappingFileException()
@@ -46,7 +46,7 @@ public function testJoinTablesWithMappedSuperclassForYamlDriver()
/**
* @group DDC-1468
*
- * @expectedException Doctrine\ORM\Mapping\MappingException
+ * @expectedException Doctrine\Common\Persistence\Mapping\MappingException
* @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'.
*/
public function testInvalidMappingFileException()

0 comments on commit ccace8c

Please sign in to comment.