|
@@ 83-93 (lines=11) @@
|
| 80 |
|
$this->commandTester->execute(['name' => 'Some\Namespace']); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
public function testExecuteXmlWithNamespace() |
| 84 |
|
{ |
| 85 |
|
$this->commandTester->execute([ |
| 86 |
|
'name' => 'Some\Namespace\Entity', |
| 87 |
|
'--path' => $this->getProjectDir($this->kernel) . '/config/doctrine', |
| 88 |
|
]); |
| 89 |
|
|
| 90 |
|
$expectedMetadataPath = $this->getProjectDir($this->kernel) . '/config/doctrine/Product.orm.xml'; |
| 91 |
|
$this->assertFileExists($expectedMetadataPath); |
| 92 |
|
$this->assertContains('"Some\Namespace\Entity\Product"', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
public function testExecuteAnnotationsWithNamespace() |
| 96 |
|
{ |
|
@@ 95-106 (lines=12) @@
|
| 92 |
|
$this->assertContains('"Some\Namespace\Entity\Product"', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
public function testExecuteAnnotationsWithNamespace() |
| 96 |
|
{ |
| 97 |
|
$this->commandTester->execute([ |
| 98 |
|
'name' => 'Some\Namespace\Entity', |
| 99 |
|
'--path' => $this->getProjectDir($this->kernel) . '/src/Entity', |
| 100 |
|
'mapping-type' => 'annotation', |
| 101 |
|
]); |
| 102 |
|
|
| 103 |
|
$expectedMetadataPath = $this->getProjectDir($this->kernel) . '/src/Entity/Product.php'; |
| 104 |
|
$this->assertFileExists($expectedMetadataPath); |
| 105 |
|
$this->assertContains('namespace Some\Namespace\Entity;', file_get_contents($expectedMetadataPath), 'Metadata contains correct namespace'); |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
/** |
| 109 |
|
* BC layer to support Symfony < 4.2 and Symfony >= 5.0. Once support for Symfony < 4.2 has been removed, this method can be dropped. |