PHPMappingDriverTest.php 895B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Doctrine\Tests\ORM\Mapping;
  3. use Doctrine\ORM\Mapping\ClassMetadata,
  4. Doctrine\ORM\Mapping\Driver\PHPDriver,
  5. Doctrine\ORM\Tools\Export\ClassMetadataExporter;
  6. require_once __DIR__ . '/../../TestInit.php';
  7. class PHPMappingDriverTest extends AbstractMappingDriverTest
  8. {
  9. protected function _loadDriver()
  10. {
  11. $path = __DIR__ . DIRECTORY_SEPARATOR . 'php';
  12. /*
  13. // Convert YAML mapping information to PHP
  14. // Uncomment this code if the YAML changes and you want to update the PHP code
  15. // for the same mapping information
  16. $cme = new ClassMetadataExporter();
  17. $cme->addMappingSource(__DIR__ . DIRECTORY_SEPARATOR . 'yaml');
  18. $exporter = $cme->getExporter('php', $path);
  19. $exporter->setMetadatas($cme->getMetadatas());
  20. $exporter->export();
  21. */
  22. return new PHPDriver($path);
  23. }
  24. }