@@ 52-61 (lines=10) @@ | ||
49 | $this->commandTester = null; |
|
50 | } |
|
51 | ||
52 | public function testExecuteXmlWithBundle() |
|
53 | { |
|
54 | $this->commandTester->execute(['name' => 'ImportMappingTestFooBundle']); |
|
55 | ||
56 | $expectedMetadataPath = sys_get_temp_dir() . '/import_mapping_bundle/Resources/config/doctrine/Product.orm.xml'; |
|
57 | $this->assertFileExists($expectedMetadataPath); |
|
58 | $this->assertContains('"Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity\Product"', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
|
59 | } |
|
60 | ||
61 | public function testExecuteAnnotationsWithBundle() |
|
62 | { |
|
63 | $this->commandTester->execute([ |
|
64 | 'name' => 'ImportMappingTestFooBundle', |
|
@@ 61-71 (lines=11) @@ | ||
58 | $this->assertContains('"Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity\Product"', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
|
59 | } |
|
60 | ||
61 | public function testExecuteAnnotationsWithBundle() |
|
62 | { |
|
63 | $this->commandTester->execute([ |
|
64 | 'name' => 'ImportMappingTestFooBundle', |
|
65 | 'mapping-type' => 'annotation', |
|
66 | ]); |
|
67 | ||
68 | $expectedMetadataPath = sys_get_temp_dir() . '/import_mapping_bundle/Entity/Product.php'; |
|
69 | $this->assertFileExists($expectedMetadataPath); |
|
70 | $this->assertContains('namespace Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity;', file_get_contents($expectedMetadataPath), 'File contains correct namespace'); |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * @expectedException \InvalidArgumentException |