@@ 67-74 (lines=8) @@ | ||
64 | $this->commandTester = null; |
|
65 | } |
|
66 | ||
67 | public function testExecuteXmlWithBundle() : void |
|
68 | { |
|
69 | $this->commandTester->execute(['name' => 'ImportMappingTestFooBundle']); |
|
70 | ||
71 | $expectedMetadataPath = sys_get_temp_dir() . '/import_mapping_bundle/Resources/config/doctrine/Product.orm.xml'; |
|
72 | $this->assertFileExists($expectedMetadataPath); |
|
73 | $this->assertContains('"Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity\Product"', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
|
74 | } |
|
75 | ||
76 | public function testExecuteAnnotationsWithBundle() : void |
|
77 | { |
|
@@ 76-86 (lines=11) @@ | ||
73 | $this->assertContains('"Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity\Product"', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
|
74 | } |
|
75 | ||
76 | public function testExecuteAnnotationsWithBundle() : void |
|
77 | { |
|
78 | $this->commandTester->execute([ |
|
79 | 'name' => 'ImportMappingTestFooBundle', |
|
80 | 'mapping-type' => 'annotation', |
|
81 | ]); |
|
82 | ||
83 | $expectedMetadataPath = sys_get_temp_dir() . '/import_mapping_bundle/Entity/Product.php'; |
|
84 | $this->assertFileExists($expectedMetadataPath); |
|
85 | $this->assertContains('namespace Doctrine\Bundle\DoctrineBundle\Tests\Command\Entity;', file_get_contents($expectedMetadataPath), 'File contains correct namespace'); |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * @expectedException \InvalidArgumentException |