Skip to content

Commit ed77f86

Browse files
committed
Merge pull request #92 from ciaranmcnulty/master
Pin deps to phpspec 2.1.1 and fix test suite
2 parents 1e93a59 + a9d9a64 commit ed77f86

File tree

4 files changed

+62
-29
lines changed

4 files changed

+62
-29
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "library",
66
"license": "MIT",
77
"require": {
8-
"phpspec/phpspec": "~2.1.0",
8+
"phpspec/phpspec": "~2.1.1",
99
"symfony/dependency-injection": "*",
1010
"symfony/config": "*",
1111
"shanethehat/pretty-xml": "~1.0.1"

composer.lock

+22-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Fake;
4+
5+
use PhpSpec\Console\Prompter;
6+
use Symfony\Component\Console\Helper\DialogHelper;
7+
use Symfony\Component\Console\Output\OutputInterface;
8+
9+
class YesDialogHelper extends DialogHelper
10+
{
11+
public function askConfirmation(OutputInterface $output, $question, $default = true)
12+
{
13+
return 'Y';
14+
}
15+
16+
}

features/bootstrap/FeatureContext.php

+23-13
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
use Behat\Behat\Tester\Exception\PendingException;
44
use Behat\Behat\Context\SnippetAcceptingContext;
5-
use Console\ApplicationTester;
5+
use Fake\YesDialogHelper;
66
use OutputSpecification\ClassSpecification;
77
use OutputSpecification\ObjectSpecification;
88
use OutputSpecification\SpecSpecification;
99
use PhpSpec\Console\Application;
10+
use Symfony\Component\Console\Tester\ApplicationTester;
1011
use Symfony\Component\Filesystem\Filesystem;
1112

1213

@@ -118,11 +119,11 @@ public function iDescribeA($objectType)
118119
{
119120

120121
$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'
126127
),
127128
array('decorated' => false)
128129
);
@@ -233,10 +234,17 @@ public function thatThereIsASpec($objectType)
233234
*/
234235
public function magespecRunsTheSpec()
235236
{
236-
$this->applicationTester->putToInputStream("y\n");
237237
$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+
)
240248
);
241249
}
242250

@@ -371,10 +379,11 @@ public function theConfigXmlFileShouldContainAnElement($objectType)
371379
public function iDescribeANonMagentoObject()
372380
{
373381
$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'
378387
),
379388
array('decorated' => false)
380389
);
@@ -422,6 +431,7 @@ private function createApplicationTester()
422431
{
423432
$application = new Application('version');
424433
$application->setAutoExit(false);
434+
$application->getHelperSet()->set(new YesDialogHelper());
425435

426436
return new ApplicationTester($application);
427437
}

0 commit comments

Comments
 (0)