diff --git a/behat/symfony2-extension/2.1/behat.yml.dist b/behat/symfony2-extension/2.1/behat.yml.dist new file mode 100644 index 00000000..49f422b4 --- /dev/null +++ b/behat/symfony2-extension/2.1/behat.yml.dist @@ -0,0 +1,13 @@ +default: + suites: + default: + contexts: + - FeatureContext: + kernel: '@kernel' + + extensions: + Behat\Symfony2Extension: + kernel: + bootstrap: features/bootstrap/bootstrap.php + path: src/Kernel.php + class: App\Kernel diff --git a/behat/symfony2-extension/2.1/features/bootstrap/FeatureContext.php b/behat/symfony2-extension/2.1/features/bootstrap/FeatureContext.php new file mode 100644 index 00000000..0835b5c7 --- /dev/null +++ b/behat/symfony2-extension/2.1/features/bootstrap/FeatureContext.php @@ -0,0 +1,40 @@ +kernel = $kernel; + } + + /** + * @When this is a demo scenario that sends a request to :path + */ + public function thisIsADemoScenarioThatSendsARequestTo(string $path) + { + $this->response = $this->kernel->handle(Request::create($path, 'GET')); + } + + /** + * @Then the response should be received + */ + public function theResponseShouldBeReceived() + { + assert($this->response !== null); + } +} diff --git a/behat/symfony2-extension/2.1/features/bootstrap/bootstrap.php b/behat/symfony2-extension/2.1/features/bootstrap/bootstrap.php new file mode 100644 index 00000000..a330c8a4 --- /dev/null +++ b/behat/symfony2-extension/2.1/features/bootstrap/bootstrap.php @@ -0,0 +1,10 @@ +load(__DIR__.'/../../.env'); +} diff --git a/behat/symfony2-extension/2.1/features/demo.feature b/behat/symfony2-extension/2.1/features/demo.feature new file mode 100644 index 00000000..99a20383 --- /dev/null +++ b/behat/symfony2-extension/2.1/features/demo.feature @@ -0,0 +1,8 @@ +Feature: + In order to proves that the Behat Symfony extension is correctly installed + As a user + I want to have a demo scenario + + Scenario: It receives a response from Symfony's kernel + When this is a demo scenario that sends a request to "/" + Then the response should be received diff --git a/behat/symfony2-extension/2.1/manifest.json b/behat/symfony2-extension/2.1/manifest.json new file mode 100644 index 00000000..a99c2a75 --- /dev/null +++ b/behat/symfony2-extension/2.1/manifest.json @@ -0,0 +1,7 @@ +{ + "copy-from-recipe": { + "behat.yml.dist": "behat.yml.dist", + "features/": "features/" + }, + "aliases": ["behat"] +} diff --git a/behat/symfony2-extension/2.1/post-install.txt b/behat/symfony2-extension/2.1/post-install.txt new file mode 100644 index 00000000..174c1204 --- /dev/null +++ b/behat/symfony2-extension/2.1/post-install.txt @@ -0,0 +1,2 @@ + Next for Behat/SymfonyExtension + Run vendor/bin/behat to run the demo tests.