File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,25 @@ instead of
104
104
105
105
$command = $application->find('demo:greet');
106
106
$commandTester = new CommandTester($command);
107
- $commandTester->execute(array('command' => $command->getName()));
107
+ $commandTester->execute(
108
+ array(
109
+ 'command' => $command->getName(),
110
+ 'name' => 'Fabien',
111
+ '--yell' => true,
112
+ )
113
+ );
108
114
109
115
$this->assertRegExp('/.../', $commandTester->getDisplay());
110
116
111
117
// ...
112
118
}
113
119
}
114
120
121
+ .. note ::
122
+
123
+ In the specific case above, the ``name `` parameter and the ``--yell `` option are not
124
+ mandatory for the command to work well, but they are shown for the example.
125
+
115
126
To be able to use the fully set up service container for your console tests
116
127
you can extend your test from
117
128
:class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ WebTestCase `::
@@ -133,7 +144,13 @@ you can extend your test from
133
144
134
145
$command = $application->find('demo:greet');
135
146
$commandTester = new CommandTester($command);
136
- $commandTester->execute(array('command' => $command->getName()));
147
+ $commandTester->execute(
148
+ array(
149
+ 'command' => $command->getName(),
150
+ 'name' => 'Fabien',
151
+ '--yell' => true,
152
+ )
153
+ );
137
154
138
155
$this->assertRegExp('/.../', $commandTester->getDisplay());
139
156
You can’t perform that action at this time.
0 commit comments