Skip to content

Commit e15eb63

Browse files
committed
[ci] handle 6.2 router resource namespace config
1 parent 52ea899 commit e15eb63

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Maker/MakeCrudTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ public function getTestDetails(): \Generator
122122
Yaml::dump(['maker' => ['root_namespace' => 'Custom']])
123123
);
124124

125+
// @legacy Conditional can be removed when Symfony 5.4 support is dropped
126+
if (60000 <= $runner->getSymfonyVersion()) {
127+
// Symfony 6.2 sets the path and namespace for router resources
128+
$runner->modifyYamlFile('config/routes.yaml', function (array $config) {
129+
if (!isset($config['controllers']['resource']['namespace'])) {
130+
return $config;
131+
}
132+
133+
$config['controllers']['resource']['namespace'] = 'Custom\Controller';
134+
135+
return $config;
136+
});
137+
}
138+
125139
$runner->copy(
126140
'make-crud/SweetFood-custom-namespace.php',
127141
'src/Entity/SweetFood.php'

0 commit comments

Comments
 (0)