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

Start using behat3 #1

Merged
merged 1 commit into from
May 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
default:
suites:
default:
contexts:
- FeatureContext
- PHPSpecContext
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"phpspec/phpspec": "2.0.*"
},
"require-dev": {
"behat/behat": "2.4.*@stable",
"behat/behat": "3.0.*@stable",
"symfony/filesystem": "~2.3",
"guzzle/http": "~3.0",
"bossa/phpspec2-expect": "dev-master"
Expand Down
1 change: 1 addition & 0 deletions features/bootstrap/Console/ApplicationTester.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace Console;

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\StringInput;
Expand Down
9 changes: 4 additions & 5 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php

use Behat\Behat\Context\BehatContext;
use Behat\Behat\Context\Context;

/**
* Features context.
*/
class FeatureContext extends BehatContext
class FeatureContext implements Context
{
/**
* Initializes context.
* Every scenario gets it's own context object.
*
* @param array $parameters context parameters (set them up through behat.yml)
*/
public function __construct(array $parameters)
public function __construct(array $parameters = array())
{
$this->useContext('phpspec', new PHPSpecContext());

}
}
9 changes: 4 additions & 5 deletions features/bootstrap/PHPSpecContext.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

use Behat\Behat\Context\BehatContext;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Symfony\Component\Filesystem\Filesystem;
use PhpSpec\Console\Application;

class PHPSpecContext extends BehatContext
class PHPSpecContext implements SnippetAcceptingContext
{
/**
* @var string
Expand Down Expand Up @@ -78,7 +77,7 @@ public function iRunPhpspec()
$application = new Application('2.0-dev');
$application->setAutoExit(false);

$this->applicationTester = new ApplicationTester($application);
$this->applicationTester = new Console\ApplicationTester($application);
$this->applicationTester->run('run --no-interaction -f pretty');
}

Expand All @@ -91,7 +90,7 @@ public function itShouldPass()
}

/**
* @Given /^I should see "([^"]*)"$/
* @Given /^I should see :message"$/
*/
public function iShouldSee($message)
{
Expand Down