示例#1
0
 public function testFindMappingFileNotFound()
 {
     $path = __DIR__ . "/_files";
     $prefix = "Foo";
     $locator = new SymfonyFileLocator(array($path => $prefix), ".yml");
     $this->setExpectedException("Doctrine\\Common\\Persistence\\Mapping\\MappingException", "No mapping file found named '" . __DIR__ . "/_files/stdClass2.yml' for class 'Foo\\stdClass2'.");
     $locator->findMappingFile("Foo\\stdClass2");
 }
 public function testFindMappingFileMostSpecificNamespaceFirst()
 {
     $prefixes = array();
     $prefixes[__DIR__ . "/_match_ns/Bar"] = "Foo\\Bar";
     $prefixes[__DIR__ . "/_match_ns"] = "Foo";
     $locator = new SymfonyFileLocator($prefixes, ".yml");
     $this->assertEquals(__DIR__ . "/_match_ns/Bar/barEntity.yml", $locator->findMappingFile("Foo\\Bar\\barEntity"));
 }