|
2 | 2 |
|
3 | 3 | use Behat\Behat\Tester\Exception\PendingException;
|
4 | 4 | use Behat\Behat\Context\SnippetAcceptingContext;
|
5 |
| -use Console\ApplicationTester; |
| 5 | +use Fake\YesDialogHelper; |
6 | 6 | use OutputSpecification\ClassSpecification;
|
7 | 7 | use OutputSpecification\ObjectSpecification;
|
8 | 8 | use OutputSpecification\SpecSpecification;
|
9 | 9 | use PhpSpec\Console\Application;
|
| 10 | +use Symfony\Component\Console\Tester\ApplicationTester; |
10 | 11 | use Symfony\Component\Filesystem\Filesystem;
|
11 | 12 |
|
12 | 13 |
|
@@ -118,11 +119,11 @@ public function iDescribeA($objectType)
|
118 | 119 | {
|
119 | 120 |
|
120 | 121 | $this->applicationTester->run(
|
121 |
| - sprintf( |
122 |
| - 'describe:%s --no-interaction --config %s %s', |
123 |
| - $objectType, |
124 |
| - $this->configFile, |
125 |
| - strtolower($this->namespace) . '/test' |
| 122 | + array( |
| 123 | + 'command' => sprintf('describe:%s', $objectType), |
| 124 | + '--no-interaction' => true, |
| 125 | + '--config' => $this->configFile, |
| 126 | + 'alias' => strtolower($this->namespace) . '/test' |
126 | 127 | ),
|
127 | 128 | array('decorated' => false)
|
128 | 129 | );
|
@@ -233,10 +234,17 @@ public function thatThereIsASpec($objectType)
|
233 | 234 | */
|
234 | 235 | public function magespecRunsTheSpec()
|
235 | 236 | {
|
236 |
| - $this->applicationTester->putToInputStream("y\n"); |
237 | 237 | $this->applicationTester->run(
|
238 |
| - sprintf('run --config %s --no-rerun %s', $this->configFile, $this->currentSpec), |
239 |
| - array('interactive' => true, 'decorated' => false) |
| 238 | + array( |
| 239 | + 'command' =>'run', |
| 240 | + '--config' => $this->configFile, |
| 241 | + '--no-rerun' => true, |
| 242 | + $this->currentSpec |
| 243 | + ), |
| 244 | + array( |
| 245 | + 'interactive' => true, |
| 246 | + 'decorated' => false |
| 247 | + ) |
240 | 248 | );
|
241 | 249 | }
|
242 | 250 |
|
@@ -371,10 +379,11 @@ public function theConfigXmlFileShouldContainAnElement($objectType)
|
371 | 379 | public function iDescribeANonMagentoObject()
|
372 | 380 | {
|
373 | 381 | $this->applicationTester->run(
|
374 |
| - sprintf( |
375 |
| - 'describe --no-interaction --config %s %s', |
376 |
| - $this->configFile, |
377 |
| - 'Behat/Test' |
| 382 | + array( |
| 383 | + 'command' => 'describe', |
| 384 | + '--no-interaction' => true, |
| 385 | + '--config' => $this->configFile, |
| 386 | + 'class' => 'Behat/Test' |
378 | 387 | ),
|
379 | 388 | array('decorated' => false)
|
380 | 389 | );
|
@@ -422,6 +431,7 @@ private function createApplicationTester()
|
422 | 431 | {
|
423 | 432 | $application = new Application('version');
|
424 | 433 | $application->setAutoExit(false);
|
| 434 | + $application->getHelperSet()->set(new YesDialogHelper()); |
425 | 435 |
|
426 | 436 | return new ApplicationTester($application);
|
427 | 437 | }
|
|
0 commit comments