X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FORM%2FMapping%2FYamlMappingDriverTest.php;fp=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FORM%2FMapping%2FYamlMappingDriverTest.php;h=91dd7e3bd5ce8446bbb20752b8f44f047290366a;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php new file mode 100644 index 0000000..91dd7e3 --- /dev/null +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php @@ -0,0 +1,57 @@ +markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); + } + + return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); + } + + /** + * @group DDC-671 + * + * Entities for this test are in AbstractMappingDriverTest + */ + public function testJoinTablesWithMappedSuperclassForYamlDriver() + { + $yamlDriver = $this->_loadDriver(); + $yamlDriver->getLocator()->addPaths(array(__DIR__ . DIRECTORY_SEPARATOR . 'yaml')); + + $em = $this->_getTestEntityManager(); + $em->getConfiguration()->setMetadataDriverImpl($yamlDriver); + $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); + $factory->setEntityManager($em); + + $classPage = new ClassMetadata('Doctrine\Tests\Models\DirectoryTree\File'); + $classPage = $factory->getMetadataFor('Doctrine\Tests\Models\DirectoryTree\File'); + $this->assertEquals('Doctrine\Tests\Models\DirectoryTree\File', $classPage->associationMappings['parentDirectory']['sourceEntity']); + + $classDirectory = new ClassMetadata('Doctrine\Tests\Models\DirectoryTree\Directory'); + $classDirectory = $factory->getMetadataFor('Doctrine\Tests\Models\DirectoryTree\Directory'); + $this->assertEquals('Doctrine\Tests\Models\DirectoryTree\Directory', $classDirectory->associationMappings['parentDirectory']['sourceEntity']); + } + + /** + * @group DDC-1468 + * + * @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() + { + $this->createClassMetadata('Doctrine\Tests\Models\Generic\SerializationModel'); + } + +}