|
27 | 27 | abstract class BaseCommandTest extends TestCase
|
28 | 28 | {
|
29 | 29 | /**
|
30 |
| - * @var SessionInterface|MockObject |
| 30 | + * @var SessionInterface&MockObject |
31 | 31 | * */
|
32 | 32 | public $session;
|
33 | 33 |
|
34 | 34 | /**
|
35 |
| - * @var WorkspaceInterface|MockObject |
| 35 | + * @var WorkspaceInterface&MockObject |
36 | 36 | */
|
37 | 37 | public $workspace;
|
38 | 38 |
|
39 | 39 | /**
|
40 |
| - * @var RepositoryInterface|MockObject |
| 40 | + * @var RepositoryInterface&MockObject |
41 | 41 | */
|
42 | 42 | public $repository;
|
43 | 43 |
|
44 | 44 | /**
|
45 |
| - * @var PhpcrConsoleDumperHelper|MockObject |
| 45 | + * @var PhpcrConsoleDumperHelper&MockObject |
46 | 46 | */
|
47 | 47 | public $dumperHelper;
|
48 | 48 |
|
49 | 49 | /**
|
50 |
| - * @var NodeInterface|MockObject |
| 50 | + * @var NodeInterface&MockObject |
51 | 51 | */
|
52 | 52 | public $node1;
|
53 | 53 |
|
54 | 54 | /**
|
55 |
| - * @var RowInterface|MockObject |
| 55 | + * @var RowInterface&MockObject |
56 | 56 | */
|
57 | 57 | public $row1;
|
58 | 58 |
|
59 | 59 | /**
|
60 |
| - * @var QueryManagerInterface|MockObject |
| 60 | + * @var QueryManagerInterface&MockObject |
61 | 61 | */
|
62 | 62 | public $queryManager;
|
63 | 63 |
|
@@ -113,18 +113,14 @@ public function setUp(): void
|
113 | 113 | /**
|
114 | 114 | * Build and execute the command tester.
|
115 | 115 | *
|
116 |
| - * @param string $name command name |
117 |
| - * @param array $args command arguments |
118 |
| - * @param int $status expected return status |
119 |
| - * |
120 |
| - * @return CommandTester |
| 116 | + * @param mixed[] $arguments |
121 | 117 | */
|
122 |
| - public function executeCommand($name, $args, $status = 0) |
| 118 | + public function executeCommand(string $commandName, array $arguments, int $expectedReturnStatus = 0): CommandTester |
123 | 119 | {
|
124 |
| - $command = $this->application->find($name); |
| 120 | + $command = $this->application->find($commandName); |
125 | 121 | $commandTester = new CommandTester($command);
|
126 |
| - $args = array_merge(['command' => $command->getName()], $args); |
127 |
| - $this->assertEquals($status, $commandTester->execute($args)); |
| 122 | + $arguments = array_merge(['command' => $command->getName()], $arguments); |
| 123 | + $this->assertEquals($expectedReturnStatus, $commandTester->execute($arguments)); |
128 | 124 |
|
129 | 125 | return $commandTester;
|
130 | 126 | }
|
|
0 commit comments