Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
parameters:
ignoreErrors:
-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
count: 1
path: src/DependencyInjection/Configuration.php
26 changes: 17 additions & 9 deletions src/Test/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,31 @@ protected static function ajax(string $method, string $uri, array $params = [],
/**
* Execute a command and return output.
*
* @param string $name Command name (e.g. "app:send")
* @param Command $command Command instance (e.g. new SendCommand())
* @param array $arguments Possible command arguments and options
* @param array $otherCommands Possible other commands to define
* @param ?array $inputs Possible inputs to set inside command
* @param string $name Command name (e.g. "app:send")
* @param callable|object $command Command instance (e.g. new SendCommand())
* @param array $arguments Possible command arguments and options
* @param array $otherCommands Possible other commands to define
* @param ?array $inputs Possible inputs to set inside command
*/
protected static function commandTest(
string $name,
Command $command,
callable|object $command,
array $arguments = [],
array $otherCommands = [],
?array $inputs = null,
): string {
$application = new Application(self::$client->getKernel());
$application->add($command);
foreach ($otherCommands as $otherCommand) {
$application->add($otherCommand);
// @phpstan-ignore-next-line function.alreadyNarrowedType
if (\method_exists($application, 'addCommand')) {
$application->addCommand($command);
foreach ($otherCommands as $otherCommand) {
$application->addCommand($otherCommand);
}
} else {
$application->add($command);
foreach ($otherCommands as $otherCommand) {
$application->add($otherCommand);
}
}
$cmd = $application->find($name);
$commandTester = new CommandTester($cmd);
Expand Down