Skip to content
This repository was archived by the owner on Feb 14, 2021. It is now read-only.

Commit 7fccbbf

Browse files
committed
Merge pull request #2 from norzechowicz/interactive
Fixed interactive call
2 parents 2d6f94e + a8e0c7e commit 7fccbbf

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

features/bootstrap/Console/ApplicationTester.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ public function __construct(Application $application)
4242
*/
4343
public function run($input, array $options = array())
4444
{
45-
$this->input = new StringInput($input);
46-
if (isset($options['interactive'])) {
47-
$this->input->setInteractive($options['interactive']);
45+
if (isset($options['interactive']) && $options['interactive']) {
46+
$this->input = new InteractiveStringInput($input);
47+
} else {
48+
$this->input = new StringInput($input);
49+
$this->input->setInteractive(false);
4850
}
4951

5052
$this->output = new StreamOutput(fopen('php://memory', 'w', false));
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Symfony\Component\Console\Input\StringInput;
4+
5+
class InteractiveStringInput extends StringInput
6+
{
7+
public function setInteractive($interactive)
8+
{
9+
//this function is disabled to prevent setting non interactive mode on string input after posix_isatty return
10+
//false
11+
}
12+
}

features/bootstrap/PhpSpecContext.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ public function iRunPhpspec()
6161
*/
6262
public function iRunPhpspecAndAnswerToTheFirstQuestion($answer)
6363
{
64-
// @todo this step is now broken, since --no-interaction has been fixed in phpspec...
65-
6664
$this->applicationTester = $this->createApplicationTester();
6765
$this->applicationTester->putToInputStream(sprintf("%s\n", $answer));
68-
$this->applicationTester->run('run --no-interaction');
66+
$this->applicationTester->run('run', array('interactive' => true));
6967
}
7068

7169
/**

features/describing_a_class.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Feature: Describing a class
3232
When I run phpspec
3333
Then I should see "class Scenario2\Bundle\DemoBundle\Model\User does not exist"
3434

35-
@disabled
3635
Scenario: Generating a class
3736
Given I described the "Scenario3/Bundle/DemoBundle/Model/User"
3837
When I run phpspec and answer "y" to the first question

features/describing_a_controller.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Feature: Describing a controller
2727
2828
"""
2929

30-
@disabled
3130
Scenario: Generating a controller
3231
Given I described the "Scenario4/Bundle/DemoBundle/Controller/UserController"
3332
When I run phpspec and answer "y" to the first question

0 commit comments

Comments
 (0)