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