Skip to content

Commit 04f8fea

Browse files
committed
keep it simple
1 parent 6141f6c commit 04f8fea

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tests/Maker/MakeEntityTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,10 @@ private function createMakeEntityTest(bool $withDatabase = true): MakerTestDetai
3030
{
3131
return $this->createMakerTest()
3232
->preRun(function (MakerTestRunner $runner) use ($withDatabase) {
33-
$config = $runner->readYaml('config/packages/doctrine.yaml');
34-
$appMapping = $config['doctrine']['orm']['mappings']['App'] ?? [];
35-
3633
/* @legacy Refactor when annotations are no longer supported. */
37-
if (isset($appMapping['type']) && $this->useAttributes($runner)) {
38-
// We want to use attributes by default in tests if they're supported.
39-
$runner->replaceInFile(
40-
'config/packages/doctrine.yaml',
41-
'type: annotation',
42-
'type: attribute'
43-
);
44-
} elseif (!empty($appMapping) && !$this->useAttributes($runner)) {
45-
// Flex assumes attributes are supported based on package versions.
46-
// When PHP <8.0, we have to use annotations.
34+
if (!$this->useAttributes($runner)) {
35+
// Attributes are only supported w/ PHP 8, FrameworkBundle >=5.2,
36+
// ORM >=2.9, & DoctrineBundle >=2.4
4737
$runner->modifyYamlFile('config/packages/doctrine.yaml', function (array $data) {
4838
$data['doctrine']['orm']['mappings']['App']['type'] = 'annotation';
4939

0 commit comments

Comments
 (0)