Skip to content

Commit 296bad4

Browse files
authored
test(symfony): mock uses Application::addCommand instead of add (#7210)
1 parent b2b5f99 commit 296bad4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Symfony/Bundle/Command/DebugResourceCommandTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ private function getCommandTester(?DataDumperInterface $dumper = null): CommandT
3737
$application->setCatchExceptions(false);
3838
$application->setAutoExit(false);
3939

40-
$application->add(new DebugResourceCommand(new AttributesResourceMetadataCollectionFactory(), new VarCloner(), $dumper ?? new CliDumper()));
40+
if (method_exists($application, 'addCommand')) {
41+
$application->addCommand(new DebugResourceCommand(new AttributesResourceMetadataCollectionFactory(), new VarCloner(), $dumper ?? new CliDumper()));
42+
} else {
43+
$application->add(new DebugResourceCommand(new AttributesResourceMetadataCollectionFactory(), new VarCloner(), $dumper ?? new CliDumper()));
44+
}
4145

4246
$command = $application->find('debug:api-resource');
4347

0 commit comments

Comments
 (0)