diff --git a/composer.lock b/composer.lock deleted file mode 100644 index ae7ef99..0000000 --- a/composer.lock +++ /dev/null @@ -1,794 +0,0 @@ -{ - "hash": "d2903346162638f5f7deb527eef61078", - "packages": [ - - ], - "packages-dev": [ - { - "name": "behat/behat", - "version": "v2.4.4", - "source": { - "type": "git", - "url": "git://github.com/Behat/Behat.git", - "reference": "v2.4.4" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/Behat/zipball/v2.4.4", - "reference": "v2.4.4", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "behat/gherkin": ">=2.2.4,<2.3.0-dev", - "symfony/console": ">=2.0.0,<2.2.0-dev", - "symfony/config": ">=2.0.0,<2.2.0-dev", - "symfony/dependency-injection": ">=2.0.0,<2.2.0-dev", - "symfony/event-dispatcher": ">=2.0.0,<2.2.0-dev", - "symfony/translation": ">=2.0.0,<2.2.0-dev", - "symfony/yaml": ">=2.0.0,<2.2.0-dev", - "symfony/finder": ">=2.0.0,<2.2.0-dev" - }, - "suggest": { - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework", - "behat/mink-extension": "for integration with Mink testing framework" - }, - "time": "2012-09-04 07:59:18", - "bin": [ - "bin/behat" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Behat": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Scenario-oriented BDD framework for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Symfony2", - "BDD", - "Behat" - ] - }, - { - "name": "behat/gherkin", - "version": "v2.2.5", - "source": { - "type": "git", - "url": "git://github.com/Behat/Gherkin.git", - "reference": "v2.2.5" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/Gherkin/zipball/v2.2.5", - "reference": "v2.2.5", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/finder": ">=2.0,<2.2-dev" - }, - "require-dev": { - "symfony/yaml": ">=2.0,<2.2-dev", - "symfony/translation": ">=2.0,<2.2-dev", - "symfony/config": ">=2.0,<2.2-dev" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files", - "symfony/translation": "If you want to use Symfony2 translations adapter", - "symfony/config": "If you want to use Config component to manage resources" - }, - "time": "2012-09-26 03:03:21", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Symfony2", - "BDD", - "parser", - "DSL", - "Behat" - ] - }, - { - "name": "behat/mink", - "version": "dev-develop", - "source": { - "type": "git", - "url": "git://github.com/Behat/Mink.git", - "reference": "f05e658f90bffaad6d077e30ab96217729953330" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/Mink/archive/f05e658f90bffaad6d077e30ab96217729953330.zip", - "reference": "f05e658f90bffaad6d077e30ab96217729953330", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": ">=2.0.0,<2.2.0-dev" - }, - "require-dev": { - "behat/mink-goutte-driver": "*", - "behat/mink-sahi-driver": "*", - "behat/mink-selenium-driver": "*", - "behat/mink-selenium2-driver": "*", - "behat/mink-zombie-driver": "*", - "symfony/finder": ">=2.0.0,<2.2.0-dev" - }, - "suggest": { - "behat/mink-goutte-driver": "to enable Goutte support", - "behat/mink-sahi-driver": "to enable Sahi.JS support", - "behat/mink-selenium-driver": "to enable Selenium1 support", - "behat/mink-selenium2-driver": "to enable Selenium2 (webdriver support)", - "behat/mink-zombie-driver": "to enable Zombie.js support" - }, - "time": "1352164762", - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "1.4.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Behat\\Mink": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Web acceptance testing framework for PHP 5.3", - "homepage": "http://mink.behat.org/", - "keywords": [ - "testing", - "browser", - "web" - ] - }, - { - "name": "behat/mink-extension", - "version": "dev-master", - "source": { - "type": "git", - "url": "git://github.com/Behat/MinkExtension.git", - "reference": "880fc457e056924694f7bb396842548ef2d8b3a1" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/MinkExtension/archive/880fc457e056924694f7bb396842548ef2d8b3a1.zip", - "reference": "880fc457e056924694f7bb396842548ef2d8b3a1", - "shasum": "" - }, - "require": { - "php": ">=5.3.2", - "behat/behat": ">=2.4.0,<2.5.0", - "behat/mink": ">=1.4.0,<1.5.0" - }, - "require-dev": { - "behat/mink-goutte-driver": "*" - }, - "time": "1353457348", - "type": "behat-extension", - "installation-source": "source", - "autoload": { - "psr-0": { - "Behat\\MinkExtension": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Mink extension for Behat", - "homepage": "http://mink.behat.org", - "keywords": [ - "test", - "browser", - "web", - "gui" - ] - }, - { - "name": "mockery/mockery", - "version": "0.7.2", - "source": { - "type": "git", - "url": "git://github.com/padraic/mockery.git", - "reference": "0.7.2" - }, - "dist": { - "type": "zip", - "url": "https://github.com/padraic/mockery/zipball/0.7.2", - "reference": "0.7.2", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "suggest": { - "Hamcrest": "1.0.0" - }, - "time": "2012-01-24 12:22:39", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "license": [ - "New BSD" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", - "keywords": [ - "testing", - "library", - "BDD", - "TDD", - "test", - "mockery", - "mock", - "stub", - "test double", - "mock objects" - ] - }, - { - "name": "phpspec/php-diff", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "8d82ac415225fac373a4073ba14b1fe286aa2312" - }, - "dist": { - "type": "zip", - "url": "https://github.com/phpspec/php-diff/archive/8d82ac415225fac373a4073ba14b1fe286aa2312.zip", - "reference": "8d82ac415225fac373a4073ba14b1fe286aa2312", - "shasum": "" - }, - "time": "1352364945", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "Diff": "lib/" - } - }, - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton" - } - ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays)." - }, - { - "name": "phpspec/phpspec2", - "version": "dev-develop", - "source": { - "type": "git", - "url": "https://github.com/phpspec/phpspec2.git", - "reference": "1b96ca860acac2345a7464b719c175a86f24dcb3" - }, - "dist": { - "type": "zip", - "url": "https://github.com/phpspec/phpspec2/archive/1b96ca860acac2345a7464b719c175a86f24dcb3.zip", - "reference": "1b96ca860acac2345a7464b719c175a86f24dcb3", - "shasum": "" - }, - "require": { - "mockery/mockery": "0.7.*", - "phpspec/php-diff": "*@dev", - "php": ">=5.3.3", - "symfony/console": ">=2.1,<3.0", - "symfony/event-dispatcher": ">=2.1,<3.0", - "symfony/finder": ">=2.1,<3.0", - "symfony/yaml": ">=2.1,<3.0" - }, - "time": "1353789164", - "bin": [ - "bin/phpspec" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "1.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "PHPSpec2": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Specification-oriented BDD framework for PHP 5.3+", - "homepage": "http://phpspec.net/", - "keywords": [ - "testing", - "BDD", - "TDD", - "spec", - "tests", - "SpecBDD", - "specification" - ] - }, - { - "name": "symfony/config", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/Config", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config", - "reference": "f12982ffa9843be853c9b61fd5a7896f00aa5fd7" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Config/archive/f12982ffa9843be853c9b61fd5a7896f00aa5fd7.zip", - "reference": "f12982ffa9843be853c9b61fd5a7896f00aa5fd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "1352368308", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Config": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/console", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/Console", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console", - "reference": "528b030bd94d74b06735c9da9fd9495db0567800" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Console/archive/528b030bd94d74b06735c9da9fd9495db0567800.zip", - "reference": "528b030bd94d74b06735c9da9fd9495db0567800", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "1352451171", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Console": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/css-selector", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/CssSelector", - "source": { - "type": "git", - "url": "https://github.com/symfony/CssSelector", - "reference": "abf8279792230c6685234eb0fa95b0a85e9e9c7a" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/CssSelector/archive/abf8279792230c6685234eb0fa95b0a85e9e9c7a.zip", - "reference": "abf8279792230c6685234eb0fa95b0a85e9e9c7a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "1352368308", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\CssSelector": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/dependency-injection", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/DependencyInjection", - "source": { - "type": "git", - "url": "https://github.com/symfony/DependencyInjection", - "reference": "eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/DependencyInjection/archive/eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5.zip", - "reference": "eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/yaml": "2.1.*", - "symfony/config": "2.1.*" - }, - "suggest": { - "symfony/yaml": "2.1.*", - "symfony/config": "2.1.*" - }, - "time": "1352635176", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\DependencyInjection": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/event-dispatcher", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/EventDispatcher", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher", - "reference": "b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/EventDispatcher/archive/b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485.zip", - "reference": "b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/dependency-injection": "2.1.*" - }, - "suggest": { - "symfony/dependency-injection": "2.1.*", - "symfony/http-kernel": "2.1.*" - }, - "time": "1352368308", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/finder", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/Finder", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder", - "reference": "24e814560125249010dd08717f4d17079c061e98" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Finder/archive/24e814560125249010dd08717f4d17079c061e98.zip", - "reference": "24e814560125249010dd08717f4d17079c061e98", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "1352368308", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Finder": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/translation", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/Translation", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation", - "reference": "806431a802d237e15fe38dca0b0460d512854652" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Translation/archive/806431a802d237e15fe38dca0b0460d512854652.zip", - "reference": "806431a802d237e15fe38dca0b0460d512854652", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/config": "2.1.*", - "symfony/yaml": "2.1.*" - }, - "suggest": { - "symfony/config": "2.1.*", - "symfony/yaml": "2.1.*" - }, - "time": "1353512262", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Translation": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/yaml", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml", - "reference": "e1aff6871fd39607d7ce638ff6b1f971cde6fe6a" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Yaml/archive/e1aff6871fd39607d7ce638ff6b1f971cde6fe6a.zip", - "reference": "e1aff6871fd39607d7ce638ff6b1f971cde6fe6a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "1352368308", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" - } - ], - "aliases": [ - - ], - "minimum-stability": "dev", - "stability-flags": { - "phpspec/phpspec2": 20, - "behat/behat": 0 - } -} diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index ba3291b..1b804f8 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -41,4 +41,252 @@ public function __construct(array $parameters) // doSomethingWith($argument); // } // + + /** + * @Given /^I am "([^"]*)"$/ + */ + public function iAm($arg1) + { + throw new PendingException(); + } + + /** + * @Given /^I Want to start a game$/ + */ + public function iWantToStartAGame() + { + throw new PendingException(); + } + + /** + * @Then /^I should get a new grid$/ + */ + public function iShouldGetANewGrid() + { + throw new PendingException(); + } + + /** + * @Given /^I want to start a game$/ + */ + public function iWantToStartAGame2() + { + throw new PendingException(); + } + + /** + * @Then /^I should wait for "([^"]*)" to start a game$/ + */ + public function iShouldWaitForToStartAGame($arg1) + { + throw new PendingException(); + } + + /** + * @Given /^I am a "([^"]*)"$/ + */ + public function iAmA($arg1) + { + throw new PendingException(); + } + + /** + * @Given /^"([^"]*)" is not assigned$/ + */ + public function isNotAssigned($arg1) + { + throw new PendingException(); + } + + /** + * @Then /^assign player to "([^"]*)"$/ + */ + public function assignPlayerTo($arg1) + { + throw new PendingException(); + } + + /** + * @Given /^"([^"]*)" is assigned$/ + */ + public function isAssigned($arg1) + { + throw new PendingException(); + } + + /** + * @Given /^I am on the "([^"]*)"$/ + */ + public function iAmOnThe($arg1) + { + throw new PendingException(); + } + + /** + * @When /^The game results in a draw$/ + */ + public function theGameResultsInADraw() + { + throw new PendingException(); + } + + /** + * @Then /^I should see a message saying "([^"]*)"$/ + */ + public function iShouldSeeAMessageSaying($arg1) + { + throw new PendingException(); + } + + /** + * @When /^I win the game$/ + */ + public function iWinTheGame() + { + throw new PendingException(); + } + + /** + * @Then /^I should not see a message saying "([^"]*)"$/ + */ + public function iShouldNotSeeAMessageSaying($arg1) + { + throw new PendingException(); + } + + /** + * @When /^I lose the game$/ + */ + public function iLoseTheGame() + { + throw new PendingException(); + } + + /** + * @When /^The game starts$/ + */ + public function theGameStarts() + { + throw new PendingException(); + } + + /** + * @When /^My opponent makes a move$/ + */ + public function myOpponentMakesAMove() + { + throw new PendingException(); + } + + /** + * @When /^I complete my move$/ + */ + public function iCompleteMyMove() + { + throw new PendingException(); + } + + /** + * @When /^A game ends$/ + */ + public function aGameEnds() + { + throw new PendingException(); + } + + /** + * @Given /^it is the current Player\'s turn$/ + */ + public function itIsTheCurrentPlayerSTurn() + { + throw new PendingException(); + } + + /** + * @When /^the current Player makes a move$/ + */ + public function theCurrentPlayerMakesAMove() + { + throw new PendingException(); + } + + /** + * @Given /^the destination is already taken$/ + */ + public function theDestinationIsAlreadyTaken() + { + throw new PendingException(); + } + + /** + * @Then /^the current Player is told the move is invalid\.$/ + */ + public function theCurrentPlayerIsToldTheMoveIsInvalid() + { + throw new PendingException(); + } + + /** + * @Given /^it is not the current Player\'s turn$/ + */ + public function itIsNotTheCurrentPlayerSTurn() + { + throw new PendingException(); + } + + /** + * @Given /^I am a Player$/ + */ + public function iAmAPlayer() + { + throw new PendingException(); + } + + /** + * @Given /^I Want to make a move$/ + */ + public function iWantToMakeAMove() + { + throw new PendingException(); + } + + /** + * @Given /^the target box on the grid is free$/ + */ + public function theTargetBoxOnTheGridIsFree() + { + throw new PendingException(); + } + + /** + * @Then /^I can make a move$/ + */ + public function iCanMakeAMove() + { + throw new PendingException(); + } + + /** + * @Given /^I want to make a move$/ + */ + public function iWantToMakeAMove2() + { + throw new PendingException(); + } + + /** + * @Given /^the target box on the grid is not free$/ + */ + public function theTargetBoxOnTheGridIsNotFree() + { + throw new PendingException(); + } + + /** + * @Then /^I can\'t make a move$/ + */ + public function iCanTMakeAMove() + { + throw new PendingException(); + } } diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 004ba3a..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - --no-colors - -0.2.4 / 2010-10-19 -================== - - * [Behat] Autoguess of colors support - * [Behat] Formatter setup bugfix (properl casing) - -0.2.3 / 2010-10-19 -================== - - * [Behat] Filters optimisations - * [Behat] Changed Core Loaders with topic-specific (`StepDefinition\Loader\PHPLoader`, - `Features\Loader\GherkinLoader`) - * [Behat] Simplified TestCommand in prepare of Symfony2 BehatBundle - * [Behat] Configuration file/path setting update (you can now create `behat.yml` inside `./config/behat.yml` & Behat - will load it - * [Behat] Updated Redundant & Ambiguous exceptions behavior - -0.2.2 / 2010-10-10 -================== - - * [Behat] Configuration file/path setting update - -0.2.1 / 2010-10-10 -================== - - * [PEAR] Fix path to phpbin on installation - -0.2.0 / 2010-10-08 -================== - - * [Behat] Brand new stateless testers, based on Visitor pattern - * [Behat] Refactored event listeners & event names - * [Behat] Refactored formatters to confirm with new stateless testers (statuses now sent as event parameters) - * [Behat] Refactored ConsoleFormatter (and removed base formatter) - * [Behat] Removed custom I18n classes & refactored Translator routines in flavor of Symfony\Component\Translation - * [Behat] Added missed translation strings into XLIFF files - * [Behat] Optimised multiline arguments (Node instances are sent to definitions instead of their plain representations) - * [Behat] Support for Scenario Outline tokens replace in multiline arguments (tables & pystrings) - * [Behat] Step arguments transformations (including table transformations) - * [Behat] Colorize inline step arguments - * [Behat] Optimized exit statuses of CLI - * [Behat] Added ability to turn-off colors - * [Behat] Added ability to translate formatters output with `--i18n` option - * [Behat] Bunch of new core feature tests - * [Gherkin] Parser now uses Symfony Dependency Injection to - * [Gherkin] Refactored parser to be like AST (Nodes that supports Visitor pattern) - * [Gherkin] Comments support - * [Gherkin] Fixed PHPUnit warnings - * [Behat,Gherkin] PEAR release script to support http://pear.everzet.com release model - * [Behat,Gherkin] DIC naming refactoring - * [Behat,Gherkin] Autoloader refactoring - * [Behat,Gherkin] Removed Zend & Goutte depencies - -0.1.5 / 2010-09-25 -================== - - * Added ability to call other steps inside step definition - * Added profiles - * Refactored container creation routine - * Single quotes support in step definitions - * Added tests for hooks, profiles, inline steps - -0.1.4 / 2010-09-16 -================== - - * Refactored code - * Removed logic from object constructors - * Added Loader & Filter interfaces - -0.1.3 / 2010-09-14 -================== - - * Ability to specify arrays of paths/files for loaders - * Event hooks and support for `support/hooks.php` - * Formatters listens events with smallest priority - * Don't try to load steps if `steps` folder doesn't exists - * Bugfixes/refactoring - -0.1.2 / 2010-09-10 -================== - - * Added ability to read from `behat.yml` and `behat.xml` - * Moved tags filter to separate object - * Refactored injection controller - * Optimized event names in event dispatcher - * Other small fixes/refactorings - -0.1.1 / 2010-09-09 -================== - - * Added `--tags` option - * Changed environment (world) routines - * Added lots of core tests (writed in Behat itself) - -0.1.0 / 2010-09-08 -================== - - * Initial release diff --git a/vendor/behat/behat/LICENSE b/vendor/behat/behat/LICENSE deleted file mode 100644 index 6425f4d..0000000 --- a/vendor/behat/behat/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Konstantin Kudryashov - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/behat/behat/README.md b/vendor/behat/behat/README.md deleted file mode 100644 index e984244..0000000 --- a/vendor/behat/behat/README.md +++ /dev/null @@ -1,57 +0,0 @@ -Behat -===== - -- [master](https://github.com/Behat/Behat) ([![Master Build Status](https://secure.travis-ci.org/Behat/Behat.png?branch=master)](http://travis-ci.org/Behat/Behat)) - staging branch. Last stable version. -- [develop](https://github.com/Behat/Behat/tree/develop) ([![Develop Build Status](https://secure.travis-ci.org/Behat/Behat.png?branch=develop)](http://travis-ci.org/Behat/Behat)) - development branch. Development happens here and you should send your PRs here too. - -Useful Links ------------- - -- The main website with documentation is at [http://behat.org](http://behat.org) -- Official Google Group is at [http://groups.google.com/group/behat](http://groups.google.com/group/behat) - -Note on Patches/Pull Requests ------------------------------ - -- Fork the project `develop` branch (all new development happens here, master for releases & hotfixes only). -- Make your feature addition or bug fix. -- Add features for it (look at test/Behat/features for examples). - This is important so I don't break it in a future version unintentionally. -- Commit, do not mess with `BehatApplication` version, or `CHANGES.md` one. - (if you want to have your own version, that is fine but - bump version in a commit by itself I can ignore when I pull) -- Send me a pull request. - -Installing Dependencies ------------------------ - - wget -nc http://getcomposer.org/composer.phar - php composer.phar update - -Running Tests -------------- - - bin/behat -f progress - -Contributing to Formatter Translations --------------------------------------- - -Almost any output message (except exceptions and custom output) printed by Behat -formatters could be translated into your language with `--lang` option. In order -to fix/add translation, edit the appropriate section of the `i18n.php` file. - -Copyright ---------- - -Copyright (c) 2012 Konstantin Kudryashov (ever.zet). See LICENSE for details. - -Contributors ------------- - -- Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] -- Other [awesome developers](https://github.com/Behat/Behat/graphs/contributors) - -Sponsors --------- - -- knpLabs [knpLabs](http://www.knplabs.com/) [main sponsor] diff --git a/vendor/behat/behat/behat.yml.dist b/vendor/behat/behat/behat.yml.dist deleted file mode 100644 index 7cd9227..0000000 --- a/vendor/behat/behat/behat.yml.dist +++ /dev/null @@ -1,12 +0,0 @@ -default: - paths: - features: features - bootstrap: features/bootstrap - -annotations: - paths: - features: features/annotations - -closures: - paths: - features: features/closures diff --git a/vendor/behat/behat/bin/behat b/vendor/behat/behat/bin/behat deleted file mode 100755 index c2d3d1c..0000000 --- a/vendor/behat/behat/bin/behat +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -define('BEHAT_PHP_BIN_PATH', getenv('PHP_PEAR_PHP_BIN') ?: '/usr/bin/env php'); -define('BEHAT_BIN_PATH', __FILE__); -define('BEHAT_VERSION', 'DEV'); - -if (is_dir($vendor = __DIR__.'/../vendor')) { - require($vendor.'/autoload.php'); -} elseif (is_dir($vendor = __DIR__.'/../../../../vendor')) { - require($vendor.'/autoload.php'); -} else { - die( - 'You must set up the project dependencies, run the following commands:'.PHP_EOL. - 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. - 'php composer.phar install'.PHP_EOL - ); -} - -$app = new Behat\Behat\Console\BehatApplication(BEHAT_VERSION); -$app->run(); diff --git a/vendor/behat/behat/bin/behat.bat b/vendor/behat/behat/bin/behat.bat deleted file mode 100644 index 1034418..0000000 --- a/vendor/behat/behat/bin/behat.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -REM Behat -REM -REM This file is part of the Behat. -REM (c) Konstantin Kudryashov -REM -REM For the full copyright and license information, please view the LICENSE -REM file that was distributed with this source code. -REM - -if "%PHPBIN%" == "" set PHPBIN=@php_bin@ -if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH -GOTO RUN -:USE_PEAR_PATH -set PHPBIN=%PHP_PEAR_PHP_BIN% -:RUN -"%PHPBIN%" "@bin_dir@\behat" %* \ No newline at end of file diff --git a/vendor/behat/behat/bin/release b/vendor/behat/behat/bin/release deleted file mode 100644 index 2aac88a..0000000 --- a/vendor/behat/behat/bin/release +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Release script. - * - * Usage: bin/release 0.2.0 beta - * - * @author Konstantin Kudryashov - */ - -system('rm -rf *.phar *.tgz'); -system('wget -nc http://getcomposer.org/composer.phar'); -system('php composer.phar update'); - -require_once __DIR__ . '/../vendor/autoload.php'; - -use Behat\Behat\Compiler; - -if (!isset($argv[1])) { - throw new RuntimeException('You must provide version.'); -} -$version = $argv[1]; - -if (!isset($argv[2])) { - throw new RuntimeException('You must provide stability status (alpha/beta/stable).'); -} -$stability = $argv[2]; - -$ldr = new Compiler\PearMapFileCompiler($autoloaderFilename = 'autoload.php', $mapFilename = 'autoload_map.php'); -$ldr->compile(); -echo "Autoloader compiled\n"; - -$pear = new Compiler\PearCompiler(); -$pear->compile($version, $stability); -echo "PEAR package compiled: behat-$version.tgz\n"; - -unlink($autoloaderFilename); -unlink($mapFilename); - -$phar = new Compiler\PharCompiler(); -$phar->compile($version); -echo "PHAR package compiled: behat-$version.phar\n"; - -system("cp behat-$version.phar behat.phar"); - -exit(0); diff --git a/vendor/behat/behat/composer.json b/vendor/behat/behat/composer.json deleted file mode 100644 index 26943f4..0000000 --- a/vendor/behat/behat/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "behat/behat", - "description": "Scenario-oriented BDD framework for PHP 5.3", - "keywords": ["BDD", "Behat", "Symfony2"], - "homepage": "http://behat.org/", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - - "require": { - "php": ">=5.3.1", - "behat/gherkin": ">=2.2.4,<2.3.0-dev", - "symfony/console": ">=2.0.0,<2.2.0-dev", - "symfony/config": ">=2.0.0,<2.2.0-dev", - "symfony/dependency-injection": ">=2.0.0,<2.2.0-dev", - "symfony/event-dispatcher": ">=2.0.0,<2.2.0-dev", - "symfony/translation": ">=2.0.0,<2.2.0-dev", - "symfony/yaml": ">=2.0.0,<2.2.0-dev", - "symfony/finder": ">=2.0.0,<2.2.0-dev" - }, - - "suggest": { - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework", - "behat/mink-extension": "for integration with Mink testing framework" - }, - - "autoload": { - "psr-0": { - "Behat\\Behat": "src/" - } - }, - - "bin": ["bin/behat"] -} diff --git a/vendor/behat/behat/features/annotations/append_snippets.feature b/vendor/behat/behat/features/annotations/append_snippets.feature deleted file mode 100644 index 5ac9b1f..0000000 --- a/vendor/behat/behat/features/annotations/append_snippets.feature +++ /dev/null @@ -1,231 +0,0 @@ -Feature: Append snippets option - In order to use definition snippets fully - As a context developer - I need to be able to autoappend snippets to context - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - - private function doSomethingUndefinedWith() {} - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined with $ - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - And do something undefined with \1 - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - ''' - some pystring - ''' - And pystring 5: - ''' - other pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - """ - - Scenario: Run feature with failing scenarios - When I run "behat -f progress --append-snippets" - And "features/bootstrap/FeatureContext.php" file should contain: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - - private function doSomethingUndefinedWith() {} - - /** - * @Given /^do something undefined with \$$/ - */ - public function doSomethingUndefinedWith2() - { - throw new PendingException(); - } - - /** - * @Given /^do something undefined with \\(\d+)$/ - */ - public function doSomethingUndefinedWith3($arg1) - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^pystring (\d+):$/ - */ - public function pystring2($arg1, PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - } - """ diff --git a/vendor/behat/behat/features/annotations/arguments.feature b/vendor/behat/behat/features/annotations/arguments.feature deleted file mode 100644 index c0ef4ac..0000000 --- a/vendor/behat/behat/features/annotations/arguments.feature +++ /dev/null @@ -1,187 +0,0 @@ -Feature: Step Arguments - In order to write extended steps - As a feature writer - I need an ability to specify Table & PyString arguments to steps - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - strings[1] = "hello,\n w\n o\nr\nl\n d"; - $this->tables[1] = array( - array('item1' => 'super', 'item2' => 'mega', 'item3' => 'extra'), - array('item1' => 'hyper', 'item2' => 'mini', 'item3' => 'XXL'), - ); - } - - /** - * @Given /^a pystring:$/ - */ - public function aPystring(PyStringNode $string) { - $this->input = $string; - } - - /** - * @Given /^a table:$/ - */ - public function aTable(TableNode $table) { - $this->input = $table; - } - - /** - * @Then /^it must be equals to string (\d+)$/ - */ - public function itMustBeEqualsToString($number) { - assertEquals($this->strings[intval($number)], (string) $this->input); - } - - /** - * @Then /^it must be equals to table (\d+)$/ - */ - public function itMustBeEqualsToTable($number) { - assertEquals($this->tables[intval($number)], $this->input->getHash()); - } - - /** - * @Given /^I have number2 = (?P\d+) and number1 = (?P\d+)$/ - */ - public function iHaveNumberAndNumber($number1, $number2) { - assertEquals(13, intval($number1)); - assertEquals(243, intval($number2)); - } - } - """ - - Scenario: PyStrings - Given a file named "features/pystring.feature" with: - """ - Feature: PyStrings - Scenario: - Given a pystring: - ''' - hello, - w - o - r - l - d - ''' - Then it must be equals to string 1 - """ - When I run "behat --no-ansi -f progress features/pystring.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: PyString tokens - Given a file named "features/pystring_tokens.feature" with: - """ - Feature: PyStrings - Scenario Outline: - Given a pystring: - ''' - - w - o - r - - d - ''' - Then it must be equals to string 1 - - Examples: - | word1 | word2 | - | hello, | l | - """ - When I run "behat --no-ansi -f progress features/pystring_tokens.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Table tokens - Given a file named "features/table_tokens.feature" with: - """ - Feature: Tables - Scenario Outline: - Given a table: - | item1 | item2 | item3 | - | | | extra | - | hyper | mini | | - Then it must be equals to table 1 - - Examples: - | word1 | word2 | word3 | - | super | XXL | mega | - """ - When I run "behat --no-ansi -f progress features/table_tokens.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Table - Given a file named "features/table.feature" with: - """ - Feature: Tables - Scenario: - Given a table: - | item1 | item2 | item3 | - | super | mega | extra | - | hyper | mini | XXL | - Then it must be equals to table 1 - """ - When I run "behat --no-ansi -f progress features/table.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Named arguments - Given a file named "features/named_args.feature" with: - """ - Feature: Named arguments - In order to maintain i18n for steps - As a step developer - I need to be able to declare regex with named parameters - - Scenario: - Given I have number2 = 243 and number1 = 13 - """ - When I run "behat --no-ansi -f progress features/named_args.feature " - Then it should pass with: - """ - . - - 1 scenario (1 passed) - 1 step (1 passed) - """ diff --git a/vendor/behat/behat/features/annotations/context.feature b/vendor/behat/behat/features/annotations/context.feature deleted file mode 100644 index 7789948..0000000 --- a/vendor/behat/behat/features/annotations/context.feature +++ /dev/null @@ -1,286 +0,0 @@ -Feature: Context consistency - In order to maintain stable behavior tests - As a feature writer - I need a separate context for every scenario/outline - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - } - """ - And a file named "features/bootstrap/CustomContext.php" with: - """ - apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 5 | 8 | - | 2 | 2 | 3 | - """ - When I run "behat --no-ansi -f progress features/apples.feature" - Then it should pass with: - """ - .................. - - 5 scenarios (5 passed) - 18 steps (18 passed) - """ - - Scenario: False "apples story" - Given a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 5 apples - - Scenario: Found more apples - When I found 10 apples - Then I should have 10 apples - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 3 | - | 0 | 5 | 8 | - | 2 | 2 | 4 | - """ - When I run "behat --no-ansi -f progress features/apples.feature" - Then it should fail with: - """ - ..F..F...F.......F - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 5. - In step `Then I should have 5 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 13 matches expected 10. - In step `Then I should have 10 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Found more apples'. # features/apples.feature:13 - Of feature `Apples story'. # features/apples.feature - - 03. Failed asserting that 1 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:17 - Of feature `Apples story'. # features/apples.feature - - 04. Failed asserting that 3 matches expected 4. - In step `Then I should have 4 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:17 - Of feature `Apples story'. # features/apples.feature - - 5 scenarios (1 passed, 4 failed) - 18 steps (14 passed, 4 failed) - """ - - Scenario: Context parameters - Given a file named "behat.yml" with: - """ - default: - context: - parameters: - parameter1: val_one - parameter2: - everzet: behat_admin - avalanche123: behat_admin - """ - And a file named "features/params.feature" with: - """ - Feature: Context parameters - In order to run a browser - As feature runner - I need to be able to configure behat context - - Scenario: I'm little hungry - Then context parameter "parameter1" should be equal to "val_one" - And context parameter "parameter2" should be array with 2 elements - """ - When I run "behat --no-ansi -f progress features/params.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Existing custom context class - Given a file named "behat.yml" with: - """ - default: - context: - class: CustomContext - """ - And a file named "features/params.feature" with: - """ - Feature: Context parameters - In order to run a browser - As feature runner - I need to be able to configure behat context - - Scenario: I'm little hungry - Then context parameter "parameter1" should be equal to "val_one" - And context parameter "parameter2" should be array with 2 elements - """ - When I run "behat --no-ansi -f progress features/params.feature" - Then it should pass with: - """ - UU - - 1 scenario (1 undefined) - 2 steps (2 undefined) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($arg1, $arg2) - { - throw new PendingException(); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($arg1, $arg2) - { - throw new PendingException(); - } - """ - - Scenario: Unexisting custom context class - Given a file named "behat.yml" with: - """ - default: - context: - class: UnexistentContext - """ - And a file named "features/params.feature" with: - """ - Feature: Context parameters - In order to run a browser - As feature runner - I need to be able to configure behat context - - Scenario: I'm little hungry - Then context parameter "parameter1" should be equal to "val_one" - And context parameter "parameter2" should be array with 2 elements - """ - When I run "behat --no-ansi -f progress features/params.feature" - Then it should fail with: - """ - [RuntimeException] - Context class "UnexistentContext" not found and can not be instantiated. - - - - behat [--init] [-f|--format="..."] [--out="..."] [--lang="..."] [--[no-]ansi] [--[no-]time] [--[no-]paths] [--[no-]snippets] [--[no-]snippets-paths] [--[no-]multiline] [--[no-]expand] [--story-syntax] [-d|--definitions="..."] [--name="..."] [--tags="..."] [--cache="..."] [--strict] [--dry-run] [--rerun="..."] [--append-snippets] [features] - """ diff --git a/vendor/behat/behat/features/annotations/definitions_transformations.feature b/vendor/behat/behat/features/annotations/definitions_transformations.feature deleted file mode 100644 index f5cb63d..0000000 --- a/vendor/behat/behat/features/annotations/definitions_transformations.feature +++ /dev/null @@ -1,137 +0,0 @@ -Feature: Step Arguments Transformations - In order to follow DRY - As a feature writer - I need to be able to move common - arguments transformations - into transformation functions - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - username = $username; - $this->age = $age; - } - public function getUsername() { return $this->username; } - public function getAge() { return $this->age; } - } - """ - And a file named "features/bootstrap/FeatureContext.php" with: - """ - getHash(); - $username = $hash[0]['username']; - $age = $hash[0]['age']; - - return new User($username, $age); - } - - /** @Transform /^(\d+)$/ */ - public function castToNumber($number) { - return intval($number); - } - - /** - * @Given /I am (".*" user)/ - * @Given /I am user:/ - */ - public function iAmUser(User $user) { - $this->user = $user; - } - - /** - * @Then /Username must be "([^"]+)"/ - */ - public function usernameMustBe($username) { - assertEquals($username, $this->user->getUsername()); - } - - /** - * @Then /Age must be (\d+)/ - */ - public function ageMustBe($age) { - assertEquals($age, $this->user->getAge()); - assertInternalType('int', $age); - } - } - """ - - Scenario: Simple Arguments Transformations - Given a file named "features/step_arguments.feature" with: - """ - Feature: Step Arguments - Scenario: - Given I am "everzet" user - Then Username must be "everzet" - And Age must be 20 - - Scenario: - Given I am "antono - 29" user - Then Username must be "antono" - And Age must be 29 - """ - When I run "behat -f progress --no-ansi" - Then it should pass with: - """ - ...... - - 2 scenarios (2 passed) - 6 steps (6 passed) - """ - - Scenario: Table Arguments Transformations - Given a file named "features/table_arguments.feature" with: - """ - Feature: Step Arguments - Scenario: - Given I am user: - | username | age | - | ever.zet | 22 | - Then Username must be "ever.zet" - And Age must be 22 - - Scenario: - Given I am user: - | username | age | - | vasiljev | 30 | - Then Username must be "vasiljev" - And Age must be 30 - """ - When I run "behat -f progress --no-ansi" - Then it should pass with: - """ - ...... - - 2 scenarios (2 passed) - 6 steps (6 passed) - """ - diff --git a/vendor/behat/behat/features/annotations/definitions_translations.feature b/vendor/behat/behat/features/annotations/definitions_translations.feature deleted file mode 100644 index 8c365e4..0000000 --- a/vendor/behat/behat/features/annotations/definitions_translations.feature +++ /dev/null @@ -1,286 +0,0 @@ -Feature: Definitions translations - In order to be able to use predefined steps in native language - As a step definitions developer - I need to be able to write definition translations - - Scenario: In place XLIFF translations - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функция: Базовая калькуляция - - Сценарий: - Допустим Я набрал число 10 на калькуляторе - И Я набрал число 4 на калькуляторе - И Я нажал "+" - То Я должен увидеть на экране 14 - И пользователь "everzet" должен иметь имя "everzet" - """ - And a file named "features/bootstrap/FeatureContext.php" with: - """ - numbers[] = intval($number); - } - - /** - * @Given /^I have clicked "+"$/ - */ - public function iHaveClickedPlus() { - $this->result = array_sum($this->numbers); - } - - /** - * @Then /^I should see (\d+) on the screen$/ - */ - public function iShouldSeeOnTheScreen($result) { - assertEquals(intval($result), $this->result); - } - - /** @Transform /"([^"]+)" user/ */ - public static function createUserFromUsername($username) { - return (Object) array('name' => $username); - } - - /** - * @Then /^the ("[^"]+" user) name should be "([^"]*)"$/ - */ - public function theUserUsername($user, $username) { - assertEquals($username, $user->name); - } - - public function getTranslationResources() { - return array(__DIR__ . DIRECTORY_SEPARATOR . 'i18n' . DIRECTORY_SEPARATOR . 'ru.xliff'); - } - } - """ - And a file named "features/bootstrap/i18n/ru.xliff" with: - """ - - -
- - - /^I have entered (\d+) into calculator$/ - /^Я набрал число (\d+) на калькуляторе$/ - - - /^I have clicked "+"$/ - /^Я нажал "([^"]*)"$/ - - - /^I should see (\d+) on the screen$/ - /^Я должен увидеть на экране (\d+)$/ - - - /"([^"]+)" user/ - /пользователь "([^"]+)"/ - - - /^the ("[^"]+" user) name should be "([^"]*)"$/ - /^(пользователь "[^"]+") должен иметь имя "([^"]*)"$/ - - - - - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should pass with: - """ - ..... - - 1 scenario (1 passed) - 5 steps (5 passed) - """ - - Scenario: In place YAML translations - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функция: Базовая калькуляция - - Сценарий: - Допустим Я набрал число 10 на калькуляторе - И Я набрал число 4 на калькуляторе - И Я нажал "+" - То Я должен увидеть на экране 14 - И пользователь "everzet" должен иметь имя "everzet" - """ - And a file named "features/bootstrap/FeatureContext.php" with: - """ - numbers[] = intval($number); - } - - /** - * @Given /^I have clicked "+"$/ - */ - public function iHaveClickedPlus() { - $this->result = array_sum($this->numbers); - } - - /** - * @Then /^I should see (\d+) on the screen$/ - */ - public function iShouldSeeOnTheScreen($result) { - assertEquals(intval($result), $this->result); - } - - /** @Transform /"([^"]+)" user/ */ - public static function createUserFromUsername($username) { - return (Object) array('name' => $username); - } - - /** - * @Then /^the ("[^"]+" user) name should be "([^"]*)"$/ - */ - public function theUserUsername($user, $username) { - assertEquals($username, $user->name); - } - - public function getTranslationResources() { - return array(__DIR__ . DIRECTORY_SEPARATOR . 'i18n' . DIRECTORY_SEPARATOR . 'ru.yml'); - } - } - """ - And a file named "features/bootstrap/i18n/ru.yml" with: - """ - '/^I have entered (\d+) into calculator$/': '/^Я набрал число (\d+) на калькуляторе$/' - '/^I have clicked "+"$/': '/^Я нажал "([^"]*)"$/' - '/^I should see (\d+) on the screen$/': '/^Я должен увидеть на экране (\d+)$/' - '/"([^"]+)" user/': '/пользователь "([^"]+)"/' - '/^the ("[^"]+" user) name should be "([^"]*)"$/': '/^(пользователь "[^"]+") должен иметь имя "([^"]*)"$/' - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should pass with: - """ - ..... - - 1 scenario (1 passed) - 5 steps (5 passed) - """ - - Scenario: In place PHP translations - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функция: Базовая калькуляция - - Сценарий: - Допустим Я набрал число 10 на калькуляторе - И Я набрал число 4 на калькуляторе - И Я нажал "+" - То Я должен увидеть на экране 14 - И пользователь "everzet" должен иметь имя "everzet" - """ - And a file named "features/bootstrap/FeatureContext.php" with: - """ - numbers[] = intval($number); - } - - /** - * @Given /^I have clicked "+"$/ - */ - public function iHaveClickedPlus() { - $this->result = array_sum($this->numbers); - } - - /** - * @Then /^I should see (\d+) on the screen$/ - */ - public function iShouldSeeOnTheScreen($result) { - assertEquals(intval($result), $this->result); - } - - /** @Transform /"([^"]+)" user/ */ - public static function createUserFromUsername($username) { - return (Object) array('name' => $username); - } - - /** - * @Then /^the ("[^"]+" user) name should be "([^"]*)"$/ - */ - public function theUserUsername($user, $username) { - assertEquals($username, $user->name); - } - - public function getTranslationResources() { - return array(__DIR__ . DIRECTORY_SEPARATOR . 'i18n' . DIRECTORY_SEPARATOR . 'ru.php'); - } - } - """ - And a file named "features/bootstrap/i18n/ru.php" with: - """ - '/^Я набрал число (\d+) на калькуляторе$/', - '/^I have clicked "+"$/' => '/^Я нажал "([^"]*)"$/', - '/^I should see (\d+) on the screen$/' => '/^Я должен увидеть на экране (\d+)$/', - '/"([^"]+)" user/' => '/пользователь "([^"]+)"/', - '/^the ("[^"]+" user) name should be "([^"]*)"$/' => '/^(пользователь "[^"]+") должен иметь имя "([^"]*)"$/', - ); - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should pass with: - """ - ..... - - 1 scenario (1 passed) - 5 steps (5 passed) - """ diff --git a/vendor/behat/behat/features/annotations/dry_run.feature b/vendor/behat/behat/features/annotations/dry_run.feature deleted file mode 100644 index 276a270..0000000 --- a/vendor/behat/behat/features/annotations/dry_run.feature +++ /dev/null @@ -1,174 +0,0 @@ -Feature: Dry run - In order to print formatters output without executing steps - As a feature developer - I need to have a --dry-run option - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - """ - - Scenario: Just run feature - When I run "behat --no-ansi --no-paths features/apples.feature" - Then it should pass with: - """ - HOOK: before suiteFeature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - HOOK: before scenario Background: - STEP: I have 3 apples Given I have 3 apples - - Scenario: I'm little hungry - STEP: I ate 1 apples When I ate 1 apple - STEP: I should have 3 apples Then I should have 3 apples - - HOOK: before scenario Scenario: Found more apples - STEP: I have 3 applesSTEP: I found 5 apples When I found 5 apples - STEP: I should have 8 apples Then I should have 8 apples - - HOOK: before scenario Scenario: Found more apples - STEP: I have 3 applesSTEP: I found 2 apples When I found 2 apples - STEP: I should have 5 apples Then I should have 5 apples - - Scenario Outline: Other situations - HOOK: before scenarioSTEP: I have 3 applesSTEP: I ate 3 applesSTEP: I found 1 applesSTEP: I should have 1 apples When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - HOOK: before scenarioSTEP: I have 3 applesSTEP: I ate 0 applesSTEP: I found 4 applesSTEP: I should have 8 apples | 0 | 4 | 8 | - HOOK: before scenarioSTEP: I have 3 applesSTEP: I ate 2 applesSTEP: I found 2 applesSTEP: I should have 3 apples | 2 | 2 | 3 | - - 6 scenarios (6 passed) - 21 steps (21 passed) - """ - - Scenario: Run feature with --dry-run - When I run "behat --no-ansi --dry-run features/apples.feature" - Then it should pass with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - - Scenario Outline: Other situations # features/apples.feature:21 - When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - - 6 scenarios (6 skipped) - 21 steps (21 skipped) - """ diff --git a/vendor/behat/behat/features/annotations/error_reporting.feature b/vendor/behat/behat/features/annotations/error_reporting.feature deleted file mode 100644 index 08528ff..0000000 --- a/vendor/behat/behat/features/annotations/error_reporting.feature +++ /dev/null @@ -1,114 +0,0 @@ -Feature: Error Reporting - In order to ignore E_NOTICE warnings of code I depend uppon - As a feature developer - I need to have an ability to set a custom error level for steps to be executed in - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - array = array(); - } - - /** - * @When /^I access array index (\d+)$/ - */ - public function iAccessArrayIndex($arg1) - { - $index = intval($arg1); - $this->result = $this->array[$index]; - } - - /** - * @Then /^I should get NULL$/ - */ - public function iShouldGetNull() - { - assertNull($this->result); - } - - /** - * @When /^I push "([^"]*)" to that array$/ - */ - public function iPushToThatArray($arg1) - { - array_push($this->array, $arg1); - } - - /** - * @Then /^I should get "([^"]*)"$/ - */ - public function iShouldGet($arg1) - { - assertEquals($arg1, $this->result); - } - - } - """ - And a file named "features/e_notice_in_scenario.feature" with: - """ - Feature: E_NOTICE in scenario - In order to test the BEHAT_ERROR_REPORTING constant - As a contributor of behat - I need to have a FeatureContext that throws E_NOTICE on __construct and within steps. - - Background: - Given I have an empty array - - Scenario: Access undefined index - When I access array index 0 - Then I should get NULL - - Scenario: Access defined index - When I push "foo" to that array - And I access array index 0 - Then I should get "foo" - - """ - - Scenario: Without BEHAT_ERROR_REPORTING - When I run "behat -f progress --no-ansi" - Then it should fail - And the output should contain: - """ - (::) failed steps (::) - - 01. Notice: Undefined offset: 0 in features/bootstrap/FeatureContext.php line 33 - In step `When I access array index 0'. # FeatureContext::iAccessArrayIndex() - From scenario `Access undefined index'. # features/e_notice_in_scenario.feature:9 - Of feature `E_NOTICE in scenario'. # features/e_notice_in_scenario.feature - - 2 scenarios (1 passed, 1 failed) - 7 steps (5 passed, 1 skipped, 1 failed) - """ - - Scenario: With BEHAT_ERROR_REPORTING ignoring E_NOTICE - Given a file named "features/bootstrap/set_error_reporting.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - """ - - Scenario: Run feature with failing scenarios - When I run "behat --no-ansi -f failed" - Then it should fail with: - """ - %PATH%/features/apples.feature:9 - %PATH%/features/apples.feature:30 - """ diff --git a/vendor/behat/behat/features/annotations/format_options.feature b/vendor/behat/behat/features/annotations/format_options.feature deleted file mode 100644 index d740174..0000000 --- a/vendor/behat/behat/features/annotations/format_options.feature +++ /dev/null @@ -1,637 +0,0 @@ -Feature: Format options - In order to optimize behat output - As a tester - I need to be able to set options on behat runner - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - """ - - Scenario: --ansi option - When I run "behat --ansi" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - And do something undefined - - Scenario Outline: Other situations # features/apples.feature:22 - When I ate  apples # FeatureContext::iAteApples() - And I found  apples # FeatureContext::iFoundApples() - Then I should have  apples # FeatureContext::iShouldHaveApples() - - Examples: -  | ate | found | result | -  | 3 | 1 | 1 | -  | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. -  | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - Given pystring: -  ''' - some pystring - ''' - And table: -  | col1 | col2 | - | val1 | val2 | - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - -  /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - -  /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - -  /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: --no-ansi option - When I run "behat --no-ansi" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - And do something undefined - - Scenario Outline: Other situations # features/apples.feature:22 - When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: --no-paths option - When I run "behat --no-ansi --no-paths" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: --no-snippets option - When I run "behat --no-ansi --no-snippets" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - And do something undefined - - Scenario Outline: Other situations # features/apples.feature:22 - When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - """ - - Scenario: --snippets-paths option - When I run "behat --no-ansi --snippets-paths" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - And do something undefined - - Scenario Outline: Other situations # features/apples.feature:22 - When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * And do something undefined # features/apples.feature:20 - * - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * Given pystring: # features/apples.feature:34 - * - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * And table: # features/apples.feature:38 - * - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: --expand option - When I run "behat --no-ansi --expand" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - And do something undefined - - Scenario Outline: Other situations # features/apples.feature:22 - When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: | 3 | 1 | 1 | - When I ate 3 apples # FeatureContext::iAteApples() - And I found 1 apples # FeatureContext::iFoundApples() - Then I should have 1 apples # FeatureContext::iShouldHaveApples() - - Examples: | 0 | 4 | 8 | - When I ate 0 apples # FeatureContext::iAteApples() - And I found 4 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 7 matches expected 8. - - Examples: | 2 | 2 | 3 | - When I ate 2 apples # FeatureContext::iAteApples() - And I found 2 apples # FeatureContext::iFoundApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - - Scenario: Multilines # features/apples.feature:33 - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: --no-multiline option - When I run "behat --no-ansi --no-multiline" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples # features/apples.feature:13 - When I found 5 apples # FeatureContext::iFoundApples() - Then I should have 8 apples # FeatureContext::iShouldHaveApples() - - Scenario: Found more apples # features/apples.feature:17 - When I found 2 apples # FeatureContext::iFoundApples() - Then I should have 5 apples # FeatureContext::iShouldHaveApples() - And do something undefined - - Scenario Outline: Other situations # features/apples.feature:22 - When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - Given pystring: - And table: - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ diff --git a/vendor/behat/behat/features/annotations/hooks.feature b/vendor/behat/behat/features/annotations/hooks.feature deleted file mode 100644 index c367e1c..0000000 --- a/vendor/behat/behat/features/annotations/hooks.feature +++ /dev/null @@ -1,268 +0,0 @@ -Feature: hooks - In order to hook into Behat testing process - As a tester - I need to be able to write hooks - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - getContextParameters(); - echo "= do something ".$params['before_suite']."\n"; - } - - /** - * @BeforeFeature - */ - static public function doSomethingBeforeFeature($event) { - $params = $event->getContextParameters(); - echo "= do something ".$params['before_feature']."\n"; - } - - /** - * @AfterFeature - */ - static public function doSomethingAfterFeature($event) { - $params = $event->getContextParameters(); - echo "= do something ".$params['after_feature']."\n"; - } - - /** - * @BeforeFeature @someFeature - */ - static public function doSomethingBeforeSomeFeature($event) { - echo "= do something before SOME feature\n"; - } - - /** - * @AfterFeature @someFeature - */ - static public function doSomethingAfterSomeFeature($event) { - echo "= do something after SOME feature\n"; - } - - /** - * @AfterSuite - */ - static public function doSomethingAfterSuite($event) { - $params = $event->getContextParameters(); - echo "= do something ".$params['after_suite']."\n"; - } - - /** - * @BeforeScenario - */ - public function beforeScenario($event) { - $this->number = 50; - } - - /** - * @BeforeScenario 130 - */ - public function beforeScenario130($event) { - $this->number = 130; - } - - /** - * @BeforeScenario @thirty - */ - public function beforeScenarioThirty($event) { - $this->number = 30; - } - - /** - * @AfterStep @100 - */ - public function afterStep100($event) { - $this->number = 100; - } - - /** - * @Given /^I have entered (\d+)$/ - */ - public function iHaveEntered($number) { - $this->number = intval($number); - } - - /** - * @Then /^I must have (\d+)$/ - */ - public function iMustHave($number) { - assertEquals(intval($number), $this->number); - } - } - """ - - Scenario: - Given a file named "features/test.feature" with: - """ - Feature: - Scenario: - Then I must have 50 - Scenario: - Given I have entered 12 - Then I must have 12 - - @thirty - Scenario: - Given I must have 30 - When I have entered 23 - Then I must have 23 - @100 @thirty - Scenario: - Given I must have 30 - When I have entered 1 - Then I must have 100 - - Scenario: 130 - Given I must have 130 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - = do something BEFORE ANY SUITE - = do something BEFORE EVERY FEATURE - Feature: - - Scenario: # features/test.feature:2 - Then I must have 50 # FeatureContext::iMustHave() - - Scenario: # features/test.feature:4 - Given I have entered 12 # FeatureContext::iHaveEntered() - Then I must have 12 # FeatureContext::iMustHave() - - @thirty - Scenario: # features/test.feature:9 - Given I must have 30 # FeatureContext::iMustHave() - When I have entered 23 # FeatureContext::iHaveEntered() - Then I must have 23 # FeatureContext::iMustHave() - - @100 @thirty - Scenario: # features/test.feature:14 - Given I must have 30 # FeatureContext::iMustHave() - When I have entered 1 # FeatureContext::iHaveEntered() - Then I must have 100 # FeatureContext::iMustHave() - - Scenario: 130 # features/test.feature:19 - Given I must have 130 # FeatureContext::iMustHave() - - = do something AFTER EVERY FEATURE - = do something AFTER ANY SUITE - 5 scenarios (5 passed) - 10 steps (10 passed) - """ - - Scenario: Filter features - Given a file named "features/1-one.feature" with: - """ - Feature: - Scenario: - Then I must have 50 - - Scenario: - Given I have entered 12 - Then I must have 12 - - Scenario: 130 - Given I must have 130 - """ - Given a file named "features/2-two.feature" with: - """ - @someFeature - Feature: - Scenario: 130 - Given I must have 130 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - = do something BEFORE ANY SUITE - = do something BEFORE EVERY FEATURE - Feature: - - Scenario: # features/1-one.feature:2 - Then I must have 50 # FeatureContext::iMustHave() - - Scenario: # features/1-one.feature:5 - Given I have entered 12 # FeatureContext::iHaveEntered() - Then I must have 12 # FeatureContext::iMustHave() - - Scenario: 130 # features/1-one.feature:9 - Given I must have 130 # FeatureContext::iMustHave() - - = do something AFTER EVERY FEATURE - = do something BEFORE EVERY FEATURE - = do something before SOME feature - @someFeature - Feature: - - Scenario: 130 # features/2-two.feature:3 - Given I must have 130 # FeatureContext::iMustHave() - - = do something AFTER EVERY FEATURE - = do something after SOME feature - = do something AFTER ANY SUITE - 4 scenarios (4 passed) - 5 steps (5 passed) - """ - - Scenario: Background step hooks - Given a file named "features/background.feature" with: - """ - Feature: - Background: - Given I must have 50 - - Scenario: - Given I have entered 12 - Then I must have 12 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - = do something BEFORE ANY SUITE - = do something BEFORE EVERY FEATURE - Feature: - - Background: # features/background.feature:2 - Given I must have 50 # FeatureContext::iMustHave() - - Scenario: # features/background.feature:5 - Given I have entered 12 # FeatureContext::iHaveEntered() - Then I must have 12 # FeatureContext::iMustHave() - - = do something AFTER EVERY FEATURE - = do something AFTER ANY SUITE - 1 scenario (1 passed) - 3 steps (3 passed) - """ diff --git a/vendor/behat/behat/features/annotations/html_format.feature b/vendor/behat/behat/features/annotations/html_format.feature deleted file mode 100644 index 110e0b2..0000000 --- a/vendor/behat/behat/features/annotations/html_format.feature +++ /dev/null @@ -1,408 +0,0 @@ -Feature: HTML Formatter - In order to print features - As a feature writer - I need to have an html formatter - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - value = $number; - } - - /** - * @Then /I must have (\d+)/ - */ - public function iMustHave($number) { - assertEquals($number, $this->value); - } - - /** - * @When /I (add|subtract) the value (\d+)/ - */ - public function iAddOrSubstractValue($operation, $number) { - switch ($operation) { - case 'add': - $this->value += $number; - break; - case 'subtract': - $this->value -= $number; - break; - } - } - } - """ - - Scenario: Multiple parameters - Given a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Adding - Then I must have 10 - And I add the value 6 - Then I must have 16 - - Scenario: Subtracting - Then I must have 10 - And I subtract the value 6 - Then I must have 4 - """ - When I run "behat --no-ansi -f html" - Then it should pass - And the output should contain: - """ -
-

- Feature: - World consistency -

-

- In order to maintain stable behaviors
- As a features developer
- I want, that "World" flushes between scenarios
-

- -
-

- Background: - features/World.feature:6 -

-
    -
  1. -
    - Given - I have entered 10 - FeatureContext::iHaveEntered() -
    -
  2. -
-
-
-

- Scenario: - Adding - features/World.feature:9 -

-
    -
  1. -
    - Then - I must have 10 - FeatureContext::iMustHave() -
    -
  2. -
  3. -
    - And - I add the value 6 - FeatureContext::iAddOrSubstractValue() -
    -
  4. -
  5. -
    - Then - I must have 16 - FeatureContext::iMustHave() -
    -
  6. -
-
-
-

- Scenario: - Subtracting - features/World.feature:14 -

-
    -
  1. -
    - Then - I must have 10 - FeatureContext::iMustHave() -
    -
  2. -
  3. -
    - And - I subtract the value 6 - FeatureContext::iAddOrSubstractValue() -
    -
  4. -
  5. -
    - Then - I must have 4 - FeatureContext::iMustHave() -
    -
  6. -
-
-
- """ - - Scenario: Scenario outline examples table - Given a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario Outline: Adding - Then I must have 10 - And I add the value - Then I must have - - Examples: - | n | total | - | 5 | 15 | - | 10 | 21 | - """ - When I run "behat --no-ansi -f html" - Then the output should contain: - """ -
-

- Scenario Outline: - Adding - features/World.feature:9 -

-
    -
  1. -
    - Then - I must have 10 - FeatureContext::iMustHave() -
    -
  2. -
  3. -
    - And - I add the value <n> - FeatureContext::iAddOrSubstractValue() -
    -
  4. -
  5. -
    - Then - I must have <total> - FeatureContext::iMustHave() -
    -
  6. -
-
-

Examples

- - - - - - - - - - - - - - - - - - - - -
ntotal
515
1021
-
Failed asserting that 20 matches expected '21'.
-
-
-
- """ - - Scenario: Scenario outline examples expanded - Given a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario Outline: Adding - Then I must have 10 - And I add the value - Then I must have - - Examples: - | n | total | - | 5 | 15 | - | 10 | 21 | - """ - When I run "behat --no-ansi -f html --expand" - Then the output should contain: - """ -
-

- Scenario Outline: - Adding - features/World.feature:9 -

-
    -
  1. -
    - Then - I must have 10 - FeatureContext::iMustHave() -
    -
  2. -
  3. -
    - And - I add the value <n> - FeatureContext::iAddOrSubstractValue() -
    -
  4. -
  5. -
    - Then - I must have <total> - FeatureContext::iMustHave() -
    -
  6. -
-
-

Examples: 515

-
    -
  1. -
    - Then - I must have 10 - FeatureContext::iMustHave() -
    -
  2. -
-
    -
  1. -
    - And - I add the value 5 - FeatureContext::iAddOrSubstractValue() -
    -
  2. -
-
    -
  1. -
    - Then - I must have 15 - FeatureContext::iMustHave() -
    -
  2. -
-

Examples: 1021

-
    -
  1. -
    - Then - I must have 10 - FeatureContext::iMustHave() -
    -
  2. -
-
    -
  1. -
    - And - I add the value 10 - FeatureContext::iAddOrSubstractValue() -
    -
  2. -
-
    -
  1. -
    - Then - I must have 21 - FeatureContext::iMustHave() -
    -
    Failed asserting that 20 matches expected '21'.
    -
  2. -
-
-
- """ - - Scenario: Links to step definitions relative to a remote base - Given a file named "behat.yml" with: - """ - default: - paths: - features: %behat.paths.base%/features - bootstrap: %behat.paths.base%/features/bootstrap - formatter: - name: 'html' - parameters: - paths_base_url: 'http://localhost/' - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Scenario: Nothing - Given I have entered 10 - """ - When I run "behat --no-ansi -c behat.yml -f html" - Then the output should contain: - """ -
-

- Scenario: - Nothing - features/World.feature:6 -

-
    -
  1. -
    - Given - I have entered 10 - FeatureContext::iHaveEntered() -
    -
  2. -
-
- """ diff --git a/vendor/behat/behat/features/annotations/i18n.feature b/vendor/behat/behat/features/annotations/i18n.feature deleted file mode 100644 index 51cb7de..0000000 --- a/vendor/behat/behat/features/annotations/i18n.feature +++ /dev/null @@ -1,277 +0,0 @@ -Feature: I18n - In order to write i18nal features - As a feature writer - I need to have i18n support - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - value = intval($number); - } - - /** - * @Then /Я должен иметь (\d+)/ - */ - public function iShouldHave($number) { - assertEquals(intval($number), $this->value); - } - - /** - * @When /Я добавлю (\d+)/ - */ - public function iAdd($number) { - $this->value += intval($number); - } - - /** - * @When /^Что-то еще не сделано$/ - */ - public function somethingNotDone() { - throw new PendingException(); - } - } - """ - And a file named "features/World.feature" with: - """ - # language: ru - Функционал: Постоянство мира - Чтобы поддерживать стабильными тесты - Как разработчик функционала - Я хочу чтобы Мир сбрасывался между сценариями - - Предыстория: - Если Я ввел 10 - - Сценарий: Неопределен - То Я должен иметь 10 - И Добавить "нормальное" число - То Я должен иметь 10 - - Сценарий: В ожидании - То Я должен иметь 10 - И Что-то еще не сделано - То Я должен иметь 10 - - Сценарий: Провален - Если Я добавлю 4 - То Я должен иметь 13 - - Структура сценария: Пройдено и Провалено - Допустим Я должен иметь 10 - Если Я добавлю <значение> - То Я должен иметь <результат> - - Примеры: - | значение | результат | - | 5 | 16 | - | 10 | 20 | - | 23 | 32 | - """ - - Scenario: Pretty - When I run "behat --no-ansi -f pretty --lang=ru" - Then it should fail with: - """ - Функционал: Постоянство мира - Чтобы поддерживать стабильными тесты - Как разработчик функционала - Я хочу чтобы Мир сбрасывался между сценариями - - Предыстория: # features/World.feature:7 - Если Я ввел 10 # FeatureContext::iHaveEntered() - - Сценарий: Неопределен # features/World.feature:10 - То Я должен иметь 10 # FeatureContext::iShouldHave() - И Добавить "нормальное" число - То Я должен иметь 10 # FeatureContext::iShouldHave() - - Сценарий: В ожидании # features/World.feature:15 - То Я должен иметь 10 # FeatureContext::iShouldHave() - И Что-то еще не сделано # FeatureContext::somethingNotDone() - TODO: write pending definition - То Я должен иметь 10 # FeatureContext::iShouldHave() - - Сценарий: Провален # features/World.feature:20 - Если Я добавлю 4 # FeatureContext::iAdd() - То Я должен иметь 13 # FeatureContext::iShouldHave() - Failed asserting that 14 matches expected 13. - - Структура сценария: Пройдено и Провалено # features/World.feature:24 - Допустим Я должен иметь 10 # FeatureContext::iShouldHave() - Если Я добавлю <значение> # FeatureContext::iAdd() - То Я должен иметь <результат> # FeatureContext::iShouldHave() - - Примеры: - | значение | результат | - | 5 | 16 | - Failed asserting that 15 matches expected 16. - | 10 | 20 | - | 23 | 32 | - Failed asserting that 33 matches expected 32. - - 6 сценариев (1 пройден, 1 в ожидании, 1 не определен, 3 провалено) - 23 шага (16 пройдено, 2 пропущено, 1 в ожидании, 1 не определен, 3 провалено) - - Вы можете реализовать определения для новых шагов с помощью этих шаблонов: - - /** - * @Given /^Добавить "([^"]*)" число$/ - */ - public function dobavitChislo($arg1) - { - throw new PendingException(); - } - """ - - Scenario: Progress - When I run "behat --no-ansi -f progress --lang=ru" - Then it should fail with: - """ - ..U-..P-..F...F.......F - - (::) проваленные шаги (::) - - 01. Failed asserting that 14 matches expected 13. - In step `То Я должен иметь 13'. # FeatureContext::iShouldHave() - From scenario `Провален'. # features/World.feature:20 - Of feature `Постоянство мира'. # features/World.feature - - 02. Failed asserting that 15 matches expected 16. - In step `То Я должен иметь 16'. # FeatureContext::iShouldHave() - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - 03. Failed asserting that 33 matches expected 32. - In step `То Я должен иметь 32'. # FeatureContext::iShouldHave() - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - (::) шаги в ожидании (::) - - 01. TODO: write pending definition - In step `И Что-то еще не сделано'. # FeatureContext::somethingNotDone() - From scenario `В ожидании'. # features/World.feature:15 - Of feature `Постоянство мира'. # features/World.feature - - 6 сценариев (1 пройден, 1 в ожидании, 1 не определен, 3 провалено) - 23 шага (16 пройдено, 2 пропущено, 1 в ожидании, 1 не определен, 3 провалено) - - Вы можете реализовать определения для новых шагов с помощью этих шаблонов: - - /** - * @Given /^Добавить "([^"]*)" число$/ - */ - public function dobavitChislo($arg1) - { - throw new PendingException(); - } - """ - - Scenario: Progress with unexisting locale - When I run "behat --no-ansi -f progress --lang=xx" - Then it should fail with: - """ - ..U-..P-..F...F.......F - - (::) failed steps (::) - - 01. Failed asserting that 14 matches expected 13. - In step `То Я должен иметь 13'. # FeatureContext::iShouldHave() - From scenario `Провален'. # features/World.feature:20 - Of feature `Постоянство мира'. # features/World.feature - - 02. Failed asserting that 15 matches expected 16. - In step `То Я должен иметь 16'. # FeatureContext::iShouldHave() - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - 03. Failed asserting that 33 matches expected 32. - In step `То Я должен иметь 32'. # FeatureContext::iShouldHave() - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - (::) pending steps (::) - - 01. TODO: write pending definition - In step `И Что-то еще не сделано'. # FeatureContext::somethingNotDone() - From scenario `В ожидании'. # features/World.feature:15 - Of feature `Постоянство мира'. # features/World.feature - - 6 scenarios (1 passed, 1 pending, 1 undefined, 3 failed) - 23 steps (16 passed, 2 skipped, 1 pending, 1 undefined, 3 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^Добавить "([^"]*)" число$/ - */ - public function dobavitChislo($arg1) - { - throw new PendingException(); - } - """ - - Scenario: Progress with unexisting locale - When I run "behat --no-ansi -f progress --lang=xx" - Then it should fail with: - """ - ..U-..P-..F...F.......F - - (::) failed steps (::) - - 01. Failed asserting that 14 matches expected 13. - In step `То Я должен иметь 13'. # FeatureContext::iShouldHave() - From scenario `Провален'. # features/World.feature:20 - Of feature `Постоянство мира'. # features/World.feature - - 02. Failed asserting that 15 matches expected 16. - In step `То Я должен иметь 16'. # FeatureContext::iShouldHave() - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - 03. Failed asserting that 33 matches expected 32. - In step `То Я должен иметь 32'. # FeatureContext::iShouldHave() - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - (::) pending steps (::) - - 01. TODO: write pending definition - In step `И Что-то еще не сделано'. # FeatureContext::somethingNotDone() - From scenario `В ожидании'. # features/World.feature:15 - Of feature `Постоянство мира'. # features/World.feature - - 6 scenarios (1 passed, 1 pending, 1 undefined, 3 failed) - 23 steps (16 passed, 2 skipped, 1 pending, 1 undefined, 3 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^Добавить "([^"]*)" число$/ - */ - public function dobavitChislo($arg1) - { - throw new PendingException(); - } - """ diff --git a/vendor/behat/behat/features/annotations/init.feature b/vendor/behat/behat/features/annotations/init.feature deleted file mode 100644 index 8a2f603..0000000 --- a/vendor/behat/behat/features/annotations/init.feature +++ /dev/null @@ -1,33 +0,0 @@ -Feature: Init - In order to be able to start fast - As a feature developer - I need to be able to init Behat path structure fast - - Scenario: Simple init - Given I am in the "init_test" path - When I run "behat --no-ansi --init" - Then it should pass with: - """ - +d features - place your *.feature files here - +d features/bootstrap - place bootstrap scripts and static files here - +f features/bootstrap/FeatureContext.php - place your feature related code here - """ - And file "features/bootstrap/FeatureContext.php" should exist - - Scenario: Custom paths - Given I am in the "init_test2" path - And a file named "behat.yml" with: - """ - default: - paths: - features: scenarios - bootstrap: supp - """ - When I run "behat --no-ansi --init" - Then it should pass with: - """ - +d scenarios - place your *.feature files here - +d supp - place bootstrap scripts and static files here - +f supp/FeatureContext.php - place your feature related code here - """ - And file "supp/FeatureContext.php" should exist diff --git a/vendor/behat/behat/features/annotations/multiple_formats.feature b/vendor/behat/behat/features/annotations/multiple_formats.feature deleted file mode 100644 index 5e37a71..0000000 --- a/vendor/behat/behat/features/annotations/multiple_formats.feature +++ /dev/null @@ -1,698 +0,0 @@ -Feature: Multiple formats - In order to use multiple formats - As a tester - I need to be able to specify multiple output formats to behat - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - """ - - Scenario: 2 formats, default output - When I run "behat --no-ansi -f pretty,progress --no-multiline" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - . - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - . Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - F - Scenario: Found more apples # features/apples.feature:13 - . When I found 5 apples # FeatureContext::iFoundApples() - . Then I should have 8 apples # FeatureContext::iShouldHaveApples() - . - Scenario: Found more apples # features/apples.feature:17 - . When I found 2 apples # FeatureContext::iFoundApples() - . Then I should have 5 apples # FeatureContext::iShouldHaveApples() - . And do something undefined - U - Scenario Outline: Other situations # features/apples.feature:22 - .... When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - ...F | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - .... | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - . Given pystring: - U And table: - U - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - - - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:22 - Of feature `Apples story'. # features/apples.feature - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: 2 formats, same output - When I run "behat --no-ansi -f pretty,progress --out=, --no-multiline" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: # features/apples.feature:6 - Given I have 3 apples # FeatureContext::iHaveApples() - . - Scenario: I'm little hungry # features/apples.feature:9 - When I ate 1 apple # FeatureContext::iAteApples() - . Then I should have 3 apples # FeatureContext::iShouldHaveApples() - Failed asserting that 2 matches expected 3. - F - Scenario: Found more apples # features/apples.feature:13 - . When I found 5 apples # FeatureContext::iFoundApples() - . Then I should have 8 apples # FeatureContext::iShouldHaveApples() - . - Scenario: Found more apples # features/apples.feature:17 - . When I found 2 apples # FeatureContext::iFoundApples() - . Then I should have 5 apples # FeatureContext::iShouldHaveApples() - . And do something undefined - U - Scenario Outline: Other situations # features/apples.feature:22 - .... When I ate apples # FeatureContext::iAteApples() - And I found apples # FeatureContext::iFoundApples() - Then I should have apples # FeatureContext::iShouldHaveApples() - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - ...F | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - .... | 2 | 2 | 3 | - - Scenario: Multilines # features/apples.feature:33 - . Given pystring: - U And table: - U - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - - - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:22 - Of feature `Apples story'. # features/apples.feature - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: 2 formats, write first to file - When I run "behat --no-ansi -f pretty,progress --out=apples.pretty, --no-multiline --no-paths" - Then it should fail with: - """ - ..F......U.......F.....UU - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:22 - Of feature `Apples story'. # features/apples.feature - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - And "apples.pretty" file should contain: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - And table: - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: 2 formats, write second to file - When I run "behat --no-ansi -f pretty,progress --out=,apples.progress --no-multiline --no-paths" - Then it should fail with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - And table: - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - And "apples.progress" file should contain: - """ - ..F......U.......F.....UU - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:22 - Of feature `Apples story'. # features/apples.feature - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - - Scenario: 2 formats, write both to files - When I run "behat --no-ansi -f pretty,progress --out=app.pretty,app.progress --no-multiline --no-paths" - Then it should fail with: - """ - """ - And "app.pretty" file should contain: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - Failed asserting that 2 matches expected 3. - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - Failed asserting that 7 matches expected 8. - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - And table: - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ - And "app.progress" file should contain: - """ - ..F......U.......F.....UU - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:22 - Of feature `Apples story'. # features/apples.feature - - 7 scenarios (3 passed, 2 undefined, 2 failed) - 25 steps (20 passed, 3 undefined, 2 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - """ diff --git a/vendor/behat/behat/features/annotations/name_filters.feature b/vendor/behat/behat/features/annotations/name_filters.feature deleted file mode 100644 index 6d7c5d7..0000000 --- a/vendor/behat/behat/features/annotations/name_filters.feature +++ /dev/null @@ -1,125 +0,0 @@ -Feature: Name filters - In order to run only needed features - As a Behat user - I need to Behat support features & scenario/outline names filtering - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - result = 0; - $this->numbers = array(); - } - - /** - * @Given /^I have entered (\d+)$/ - */ - public function iHaveEntered($number) { - $this->numbers[] = intval($number); - } - - /** - * @When /^I add$/ - */ - public function iAdd() { - foreach ($this->numbers as $number) { - $this->result += $number; - } - $this->numbers = array(); - } - - /** - * @When /^I sub$/ - */ - public function iSub() { - $this->result = array_shift($this->numbers); - foreach ($this->numbers as $number) { - $this->result -= $number; - } - $this->numbers = array(); - } - - /** - * @When /^I multiply$/ - */ - public function iMultiply() { - $this->result = array_shift($this->numbers); - foreach ($this->numbers as $number) { - $this->result *= $number; - } - $this->numbers = array(); - } - - /** - * @When /^I div$/ - */ - public function iDiv() { - $this->result = array_shift($this->numbers); - foreach ($this->numbers as $number) { - $this->result /= $number; - } - $this->numbers = array(); - } - - /** - * @Then /^The result should be (\d+)$/ - */ - public function theResultShouldBe($result) { - assertEquals(intval($result), $this->result); - } - } - """ - - Scenario: Basic scenario outline - Given a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - """ - When I run "behat --no-ansi -f progress features/math.feature" - Then it should pass with: - """ - ............... - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - Scenario: Multiple scenario outlines - Given a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I multiply - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 120 | - | 5 | 3 | 15 | - - Scenario: - Given I have entered 10 - And I have entered 3 - When I sub - Then The result should be 7 - - Scenario Outline: - Given I have entered - And I have entered - When I div - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 2 | 5 | - | 50 | 5 | 10 | - """ - When I run "behat --no-ansi -f progress features/math.feature" - Then it should pass with: - """ - ......................... - - 5 scenarios (5 passed) - 25 steps (25 passed) - """ - - Scenario: Multiple scenario outlines with failing steps - Given a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I multiply - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 120 | - | 5 | 4 | 15 | - - Scenario: - Given I have entered 10 - And I have entered 4 - When I sub - Then The result should be 7 - - Scenario Outline: - Given I have entered - And I have entered - When I div - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 2 | 5 | - | 50 | 10 | 2 | - | 50 | 10 | 4 | - """ - When I run "behat --no-ansi -f progress features/math.feature" - Then it should fail with: - """ - .........F....F.........F....F - - (::) failed steps (::) - - 01. Failed asserting that 20 matches expected 15. - In step `Then The result should be 15'. # FeatureContext::theResultShouldBe() - From scenario ***. # features/math.feature:5 - Of feature `Math'. # features/math.feature - - 02. Failed asserting that 6 matches expected 7. - In step `Then The result should be 7'. # FeatureContext::theResultShouldBe() - From scenario ***. # features/math.feature:16 - Of feature `Math'. # features/math.feature - - 03. Failed asserting that 5 matches expected 2. - In step `Then The result should be 2'. # FeatureContext::theResultShouldBe() - From scenario ***. # features/math.feature:22 - Of feature `Math'. # features/math.feature - - 04. Failed asserting that 5 matches expected 4. - In step `Then The result should be 4'. # FeatureContext::theResultShouldBe() - From scenario ***. # features/math.feature:22 - Of feature `Math'. # features/math.feature - - 6 scenarios (2 passed, 4 failed) - 30 steps (26 passed, 4 failed) - """ diff --git a/vendor/behat/behat/features/annotations/parameters.feature b/vendor/behat/behat/features/annotations/parameters.feature deleted file mode 100644 index 73a28a1..0000000 --- a/vendor/behat/behat/features/annotations/parameters.feature +++ /dev/null @@ -1,160 +0,0 @@ -Feature: Parameters - In order to support different setups - As a tester - I need to be able to configure Behat through environment variable - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - result = 0; - $this->numbers = array(); - } - - /** - * @Given /I have entered (\d+)/ - */ - public function iHaveEntered($number) { - $this->numbers[] = intval($number); - } - - /** - * @When /I add/ - */ - public function iAdd() { - $this->result = array_sum($this->numbers); - $this->numbers = array(); - } - - /** - * @When /I sub/ - */ - public function iSub() { - $this->result = array_shift($this->numbers); - $this->result -= array_sum($this->numbers); - $this->numbers = array(); - } - - /** - * @Then /The result should be (\d+)/ - */ - public function theResultShouldBe($result) { - assertEquals($result, $this->result); - } - } - """ - And a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - """ - And a file named "behat.yml" with: - """ - default: - formatter: - name: progress - """ - - Scenario: - When I run "behat --no-ansi" - Then it should pass with: - """ - ............... - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - @unix - Scenario: - Given "BEHAT_PARAMS" environment variable is set to: - """ - formatter[name]=pretty&formatter[parameters][paths]=false&formatter[parameters][time]=false - """ - When I run "behat --no-ansi -c unexistent" - Then it should pass with: - """ - Feature: Math - - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - @unix - Scenario: - Given "BEHAT_PARAMS" environment variable is set to: - """ - formatter[name]=pretty&formatter[parameters][time]=false - """ - When I run "behat --no-ansi -c unexistent" - Then it should pass with: - """ - Feature: Math - - Background: # features/math.feature:2 - Given I have basic calculator # FeatureContext::iHaveBasicCalculator() - - Scenario Outline: # features/math.feature:5 - Given I have entered # FeatureContext::iHaveEntered() - And I have entered # FeatureContext::iHaveEntered() - When I add # FeatureContext::iAdd() - Then The result should be # FeatureContext::theResultShouldBe() - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ diff --git a/vendor/behat/behat/features/annotations/pretty_format.feature b/vendor/behat/behat/features/annotations/pretty_format.feature deleted file mode 100644 index 9c69722..0000000 --- a/vendor/behat/behat/features/annotations/pretty_format.feature +++ /dev/null @@ -1,575 +0,0 @@ -Feature: Pretty Formatter - In order to debug features - As a feature writer - I need to have pretty formatter - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - value = $num; - } - - /** - * @Then /I must have (\d+)/ - */ - public function iMustHave($num) { - assertEquals($num, $this->value); - } - - /** - * @When /I add (\d+)/ - */ - public function iAdd($num) { - $this->value += $num; - } - - /** - * @When /^Something not done yet$/ - */ - public function somethingNotDoneYet() { - throw new PendingException(); - } - } - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Undefined - Then I must have 10 - And Something new - Then I must have 10 - - Scenario: Pending - Then I must have 10 - And Something not done yet - Then I must have 10 - - Scenario: Failed - When I add 4 - Then I must have 13 - - Scenario Outline: Passed & Failed - Given I must have 10 - When I add - Then I must have - - Examples: - | value | result | - | 5 | 16 | - | 10 | 20 | - | 23 | 32 | - """ - When I run "behat --no-ansi -f pretty" - Then it should fail with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: # features/World.feature:6 - Given I have entered 10 # FeatureContext::iHaveEntered() - - Scenario: Undefined # features/World.feature:9 - Then I must have 10 # FeatureContext::iMustHave() - And Something new - Then I must have 10 # FeatureContext::iMustHave() - - Scenario: Pending # features/World.feature:14 - Then I must have 10 # FeatureContext::iMustHave() - And Something not done yet # FeatureContext::somethingNotDoneYet() - TODO: write pending definition - Then I must have 10 # FeatureContext::iMustHave() - - Scenario: Failed # features/World.feature:19 - When I add 4 # FeatureContext::iAdd() - Then I must have 13 # FeatureContext::iMustHave() - Failed asserting that 14 matches expected '13'. - - Scenario Outline: Passed & Failed # features/World.feature:23 - Given I must have 10 # FeatureContext::iMustHave() - When I add # FeatureContext::iAdd() - Then I must have # FeatureContext::iMustHave() - - Examples: - | value | result | - | 5 | 16 | - Failed asserting that 15 matches expected '16'. - | 10 | 20 | - | 23 | 32 | - Failed asserting that 33 matches expected '32'. - - 6 scenarios (1 passed, 1 pending, 1 undefined, 3 failed) - 23 steps (16 passed, 2 skipped, 1 pending, 1 undefined, 3 failed) - - You can implement step definitions for undefined steps with these snippets: - - /** - * @Given /^Something new$/ - */ - public function somethingNew() - { - throw new PendingException(); - } - """ - - Scenario: Multiple parameters - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - value = $num; - } - - /** - * @Then /I must have (\d+)/ - */ - public function iMustHave($num) { - assertEquals($num, $this->value); - } - - /** - * @When /I (add|subtract) the value (\d+)/ - */ - public function iAddOrSubstact($op, $num) { - if ($op == 'add') - $this->value += $num; - elseif ($op == 'subtract') - $this->value -= $num; - } - - /** - * @When /^regex (?P\/([^\/]|\\\/)*\/)$/ - */ - public function somethingNotDoneYet($pattern) {} - } - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Adding - Then I must have 10 - And I add the value 6 - Then I must have 16 - And regex /some\/regex_ha/ - - Scenario: Subtracting - Then I must have 10 - And I subtract the value 6 - Then I must have 4 - """ - When I run "behat -f pretty --ansi" - Then it should pass with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: # features/World.feature:6 - Given I have entered 10 # FeatureContext::iHaveEntered() - - Scenario: Adding # features/World.feature:9 - Then I must have 10 # FeatureContext::iMustHave() - And I add the value 6 # FeatureContext::iAddOrSubstact() - Then I must have 16 # FeatureContext::iMustHave() - And regex /some\/regex_ha/ # FeatureContext::somethingNotDoneYet() - - Scenario: Subtracting # features/World.feature:15 - Then I must have 10 # FeatureContext::iMustHave() - And I subtract the value 6 # FeatureContext::iAddOrSubstact() - Then I must have 4 # FeatureContext::iMustHave() - - 2 scenarios (2 passed) - 9 steps (9 passed) - """ - - Scenario: Multiline titles - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - value = $num; - } - - /** - * @Then /I must have (\d+)/ - */ - public function iMustHave($num) { - assertEquals($num, $this->value); - } - - /** - * @When /I (add|subtract) the value (\d+)/ - */ - public function iAddOrSubstact($op, $num) { - if ($op == 'add') - $this->value += $num; - elseif ($op == 'subtract') - $this->value -= $num; - } - } - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Adding some interesting - value - Then I must have 10 - And I add the value 6 - Then I must have 16 - - Scenario: Subtracting - some - value - Then I must have 10 - And I subtract the value 6 - Then I must have 4 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: # features/World.feature:6 - Given I have entered 10 # FeatureContext::iHaveEntered() - - Scenario: Adding some interesting # features/World.feature:9 - value - Then I must have 10 # FeatureContext::iMustHave() - And I add the value 6 # FeatureContext::iAddOrSubstact() - Then I must have 16 # FeatureContext::iMustHave() - - Scenario: Subtracting # features/World.feature:15 - some - value - Then I must have 10 # FeatureContext::iMustHave() - And I subtract the value 6 # FeatureContext::iAddOrSubstact() - Then I must have 4 # FeatureContext::iMustHave() - - 2 scenarios (2 passed) - 8 steps (8 passed) - """ - - Scenario: Outline parameter inside step argument - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - value); - } - - /** - * @When /I add "([^"]+)"/ - */ - public function iAdd($num) { - $this->value += intval(preg_replace('/[^\d]+/', '', $num)); - } - } - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Scenario Outline: Passed & Failed - When I add "amount of something" - Then I must have "amount of something" - - Examples: - | value | result | - | 5 | 15 | - | 10 | 20 | - | 23 | 33 | - """ - When I run "behat -f pretty --ansi" - Then it should pass with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Scenario Outline: Passed & Failed # features/World.feature:6 - When I add "amount of  something" # FeatureContext::iAdd() - Then I must have "amount of  something" # FeatureContext::iMustHave() - - Examples: -  | value | result | -  | 5 | 15 | -  | 10 | 20 | -  | 23 | 33 | - - 3 scenarios (3 passed) - 6 steps (6 passed) - """ - - Scenario: Don't print undefined exceptions in outline - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - value); - } - - /** - * @When /I add "([^"]+)"/ - */ - public function iAdd($num) { - $this->value += intval(preg_replace('/[^\d]+/', '', $num)); - } - } - """ - And a file named "features/ls.feature" with: - """ - Feature: ls - In order to see the directory structure - As a UNIX user - I need to be able to list the current directory's contents - - Background: - Given I have a file named "foo" - - Scenario: List 2 files in a directory - Given I have a file named "bar" - When I run "ls" - Then I should see "bar" in output - And I should see "foo" in output - - Scenario: List 1 file and 1 dir - Given I have a directory named "dir" - When I run "ls" - Then I should see "dir" in output - And I should see "foo" in output - - Scenario Outline: - Given I have a named "" - When I run "ls" - Then I should see "" in output - And I should see "foo" in output - - Examples: - | object | name | - | file | bar | - | directory | dir | - """ - When I run "behat --no-ansi features/ls.feature --no-snippets" - Then it should pass with: - """ - Feature: ls - In order to see the directory structure - As a UNIX user - I need to be able to list the current directory's contents - - Background: # features/ls.feature:6 - Given I have a file named "foo" - - Scenario: List 2 files in a directory # features/ls.feature:9 - Given I have a file named "bar" - When I run "ls" - Then I should see "bar" in output - And I should see "foo" in output - - Scenario: List 1 file and 1 dir # features/ls.feature:15 - Given I have a directory named "dir" - When I run "ls" - Then I should see "dir" in output - And I should see "foo" in output - - Scenario Outline: # features/ls.feature:21 - Given I have a named "" - When I run "ls" - Then I should see "" in output - And I should see "foo" in output - - Examples: - | object | name | - | file | bar | - | directory | dir | - - 4 scenarios (4 undefined) - 20 steps (20 undefined) - """ - - Scenario: Multiline titles - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - - Then I must have - - Examples: - | value | result | - | 5 | 16 | - | 10 | 20 | - | 23 | 32 | - """ - When I run "behat --no-ansi -f pretty --no-snippets" - Then it should pass with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: Some background # features/World.feature:6 - title - with - multiple lines - Given I have entered 10 - - Scenario: Undefined # features/World.feature:13 - scenario or - whatever - Then I must have 10 - And Something new - Then I must have 10 - - Scenario Outline: Passed & Failed # features/World.feature:20 - steps and other interesting stuff - he-he-he - Given I must have 10 - When I add - Then I must have - - Examples: - | value | result | - | 5 | 16 | - | 10 | 20 | - | 23 | 32 | - - 4 scenarios (4 undefined) - 16 steps (16 undefined) - """ diff --git a/vendor/behat/behat/features/annotations/profiles.feature b/vendor/behat/behat/features/annotations/profiles.feature deleted file mode 100644 index 3c8f9ea..0000000 --- a/vendor/behat/behat/features/annotations/profiles.feature +++ /dev/null @@ -1,163 +0,0 @@ -Feature: Profiles - In order to test my features - As a tester - I need to be able to create and run custom profiles - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - result = 0; - $this->numbers = array(); - } - - /** - * @Given /I have entered (\d+)/ - */ - public function iHaveEntered($number) { - $this->numbers[] = intval($number); - } - - /** - * @When /I add/ - */ - public function iAdd() { - $this->result = array_sum($this->numbers); - $this->numbers = array(); - } - - /** - * @When /I sub/ - */ - public function iSub() { - $this->result = array_shift($this->numbers); - $this->result -= array_sum($this->numbers); - $this->numbers = array(); - } - - /** - * @Then /The result should be (\d+)/ - */ - public function theResultShouldBe($result) { - assertEquals($result, $this->result); - } - } - """ - And a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - """ - And a file named "pretty.yml" with: - """ - pretty: - formatter: - name: pretty - """ - And a file named "behat.yml" with: - """ - default: - formatter: - name: progress - pretty_without_paths: - formatter: - name: pretty - parameters: - paths: false - imports: - - pretty.yml - """ - - Scenario: - Given I run "behat --no-ansi features/math.feature" - Then it should pass with: - """ - ............... - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - Scenario: - Given I run "behat --no-ansi --profile pretty_without_paths" - Then it should pass with: - """ - Feature: Math - - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - Scenario: - Given I run "behat --no-ansi --profile pretty" - Then it should pass with: - """ - Feature: Math - - Background: # features/math.feature:2 - Given I have basic calculator # FeatureContext::iHaveBasicCalculator() - - Scenario Outline: # features/math.feature:5 - Given I have entered # FeatureContext::iHaveEntered() - And I have entered # FeatureContext::iHaveEntered() - When I add # FeatureContext::iAdd() - Then The result should be # FeatureContext::theResultShouldBe() - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ diff --git a/vendor/behat/behat/features/annotations/rerun.feature b/vendor/behat/behat/features/annotations/rerun.feature deleted file mode 100644 index c850c98..0000000 --- a/vendor/behat/behat/features/annotations/rerun.feature +++ /dev/null @@ -1,201 +0,0 @@ -Feature: Rerun - In order to test only failed scenarios - As a feature developer - I need to have an ability to rerun failed previously scenarios - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - """ - - Scenario: Run one feature with 2 failed and 3 passing scenarios - When I run "behat --no-ansi -f progress features/apples.feature" - Then it should fail with: - """ - ..F.............F.... - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:21 - Of feature `Apples story'. # features/apples.feature - - 6 scenarios (4 passed, 2 failed) - 21 steps (19 passed, 2 failed) - """ - - Scenario: Rerun only failed scenarios - Given I run "behat --no-ansi -f progress features/apples.feature --rerun re.log" - When I run "behat --no-ansi -f progress features/apples.feature --rerun re.log" - Then it should fail with: - """ - ..F...F - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 7 matches expected 8. - In step `Then I should have 8 apples'. # FeatureContext::iShouldHaveApples() - From scenario `Other situations'. # features/apples.feature:21 - Of feature `Apples story'. # features/apples.feature - - 2 scenarios (2 failed) - 7 steps (5 passed, 2 failed) - """ - - Scenario: Fixing scenario removes it from the rerun log - Given I run "behat --no-ansi -f progress features/apples.feature --rerun re.log" - And there is a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 7 | - | 2 | 2 | 3 | - """ - When I run "behat --no-ansi -f progress features/apples.feature --rerun re.log" - And I run "behat --no-ansi -f progress features/apples.feature --rerun re.log" - Then it should fail with: - """ - ..F - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 3. - In step `Then I should have 3 apples'. # FeatureContext::iShouldHaveApples() - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 1 scenario (1 failed) - 3 steps (2 passed, 1 failed) - """ diff --git a/vendor/behat/behat/features/annotations/result_types.feature b/vendor/behat/behat/features/annotations/result_types.feature deleted file mode 100644 index a80f2e8..0000000 --- a/vendor/behat/behat/features/annotations/result_types.feature +++ /dev/null @@ -1,509 +0,0 @@ -Feature: Different result types - In order to differentiate feature statuses - As a feature writer - I need to be able to see different types of test results - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - money += $money; - } - - /** - * @Then /^I should see (\d+)\$ on the screen$/ - */ - public function iShouldSee($money) { - assertEquals($money, $this->money); - } - } - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should fail with: - """ - .F..F- - - (::) failed steps (::) - - 01. Failed asserting that 10 matches expected '12'. - In step `Then I should see 12$ on the screen'. # FeatureContext::iShouldSee() - From scenario `Check throwed amount'. # features/coffee.feature:9 - Of feature `Failed coffee machine actions'. # features/coffee.feature - - 02. Failed asserting that 30 matches expected '31'. - In step `Then I should see 31$ on the screen'. # FeatureContext::iShouldSee() - From scenario `Additional throws'. # features/coffee.feature:12 - Of feature `Failed coffee machine actions'. # features/coffee.feature - - 2 scenarios (2 failed) - 6 steps (3 passed, 1 skipped, 2 failed) - """ - - Scenario: Skipped steps - Given a file named "features/coffee.feature" with: - """ - Feature: Skipped coffee machine actions - In order to tell clients about failures faster - As a coffee machine - I need to be able to skip unneeded steps - - Background: - Given human bought coffee - - Scenario: I have no water - Given I have no water - And I have electricity - When I boil water - Then the coffee should be almost done - - Scenario: I have no electricity - Given I have water - And I have no electricity - When I boil water - Then the coffee should be almost done - """ - And a file named "features/bootstrap/FeatureContext.php" with: - """ - money); - } - } - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should fail with: - """ - .F---..F-- - - (::) failed steps (::) - - 01. NO water in coffee machine!!! - In step `Given I have no water'. # FeatureContext::noWater() - From scenario `I have no water'. # features/coffee.feature:9 - Of feature `Skipped coffee machine actions'. # features/coffee.feature - - 02. NO electricity in coffee machine!!! - In step `And I have no electricity'. # FeatureContext::haveNoElectricity() - From scenario `I have no electricity'. # features/coffee.feature:15 - Of feature `Skipped coffee machine actions'. # features/coffee.feature - - 2 scenarios (2 failed) - 10 steps (3 passed, 5 skipped, 2 failed) - """ - - Scenario: Ambigious steps - Given a file named "features/coffee.feature" with: - """ - Feature: Ambigious orders in coffee menu - In order to be able to chose concrete coffee type - As a coffee buyer - I need to be able to know about ambigious decisions - - Scenario: Ambigious coffee type - Given human have chosen "Latte" - Then I should make him "Latte" - """ - And a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - /** - * @Given /^I have (\d+) apples?$/ - */ - public function iHaveApples($count) { - $this->apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - - /** - * @Then /^context parameter "([^"]*)" should be equal to "([^"]*)"$/ - */ - public function contextParameterShouldBeEqualTo($key, $val) { - assertEquals($val, $this->parameters[$key]); - } - - /** - * @Given /^context parameter "([^"]*)" should be array with (\d+) elements$/ - */ - public function contextParameterShouldBeArrayWithElements($key, $count) { - assertInternalType('array', $this->parameters[$key]); - assertEquals(2, count($this->parameters[$key])); - } - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 3 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - And do something undefined - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 8 | - | 2 | 2 | 3 | - - Scenario: Multilines - Given pystring: - ''' - some pystring - ''' - And table: - | col1 | col2 | - | val1 | val2 | - - Scenario: Worded quote - When que j'utilise behat en français' - Then j'utilise un apostrophe et j'obtiens une erreur - And some 'properly escaped' string - And 'another escaped' string - And one 'more string' - And one "more string" - """ - - Scenario: Run feature with failing scenarios - When I run "behat --no-ansi -f snippets" - Then it should fail with: - """ - /** - * @Given /^do something undefined$/ - */ - public function doSomethingUndefined() - { - throw new PendingException(); - } - - /** - * @Given /^pystring:$/ - */ - public function pystring(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Given /^table:$/ - */ - public function table(TableNode $table) - { - throw new PendingException(); - } - - /** - * @When /^que j\'utilise behat en français\'$/ - */ - public function queJUtiliseBehatEnFrancais() - { - throw new PendingException(); - } - - /** - * @Then /^j\'utilise un apostrophe et j\'obtiens une erreur$/ - */ - public function jUtiliseUnApostropheEtJObtiensUneErreur() - { - throw new PendingException(); - } - - /** - * @Given /^some \'([^\']*)\' string$/ - */ - public function someString($arg1) - { - throw new PendingException(); - } - - /** - * @Given /^\'([^\']*)\' string$/ - */ - public function string($arg1) - { - throw new PendingException(); - } - - /** - * @Given /^one \'([^\']*)\'$/ - */ - public function one($arg1) - { - throw new PendingException(); - } - - /** - * @Given /^one "([^"]*)"$/ - */ - public function one2($arg1) - { - throw new PendingException(); - } - """ diff --git a/vendor/behat/behat/features/annotations/steps_chaining.feature b/vendor/behat/behat/features/annotations/steps_chaining.feature deleted file mode 100644 index 59c5db4..0000000 --- a/vendor/behat/behat/features/annotations/steps_chaining.feature +++ /dev/null @@ -1,349 +0,0 @@ -Feature: Call step in other step - In order to mantain fluid step definition - As a features writer - I need to be able to call other steps from step body - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - hash = array('username' => 'everzet', 'password' => 'qwerty'); - } - - /** - * @Given /I have entered "([^"]*)"/ - */ - public function iHaveEnteredEn($number) - { - $this->numbers[] = $number; - } - - /** - * @When /I press +/ - */ - public function iPressPlusEn() - { - $this->result = array_sum($this->numbers); - $this->numbers = array(); - } - - /** - * @Then /I should see "([^"]*)" on the screen/ - */ - public function iShouldSeeEn($result) - { - assertEquals($result, $this->result); - } - - /** - * @Then /Table should be:/ - */ - public function assertTableEn(TableNode $table) - { - assertEquals($this->hash, $table->getRowsHash()); - } - - /** - * @Given /Я ввел "([^"]*)"/ - */ - public function iHaveEnteredRu($number) - { - return new Step\Given("I have entered \"$number\""); - } - - /** - * @When /Я нажму +/ - */ - public function iPressPlusRu() - { - return new Step\When("I press +"); - } - - /** - * @Then /Я должен увидеть на экране "([^"]*)"/ - */ - public function iShouldSeeRu($result) - { - return new Step\Then("I should see \"$result\" on the screen"); - } - - /** - * @Given /I entered "([^"]*)" and expect "([^"]*)"/ - */ - public function complexStep($number, $result) - { - return array( - new Step\Given("I have entered \"$number\""), - new Step\When("I press +"), - new Step\Then("I should see \"$result\" on the screen") - ); - } - - /** - * @Given /I calculate "([^"]*)" and "([^"]*)"/ - */ - public function calcNumbers($number1, $number2) - { - return array( - function() use($number1, $number2) { - return array( - new Step\Given("Ввожу \"$number1\""), - function() use($number2) { return new Step\Given("Ввожу \"$number2\""); } - ); - - }, - new Step\When("Нажимаю плюс"), - ); - } - - /** - * @Then /Я создам себе failing таблицу/ - */ - public function assertFailingTableRu() - { - return new Step\Then('Table should be:', new Behat\Gherkin\Node\TableNode(<< - -
- - - /I calculate "([^"]*)" and "([^"]*)"/ - /Я сложу числа "([^"]*)" и "([^"]*)"/ - - - /I have entered "([^"]*)"/ - /Ввожу "([^"]*)"/ - - - /I press +/ - /Нажимаю плюс/ - - - - - """ - - Scenario: - Given a file named "features/calc_en.feature" with: - """ - Feature: Basic calculator - Scenario: - Given I have entered "12" - And I have entered "27" - And I have entered "5" - When I press + - Then I should see "44" on the screen - - Scenario: - Given I have entered "23" - Then I entered "10" and expect "33" - - Scenario: - Given I have entered "3" - Then I entered "5" and expect "10" - """ - When I run "behat --no-ansi -f progress features/calc_en.feature" - Then it should fail with: - """ - ........F - - (::) failed steps (::) - - 01. Failed asserting that 8 matches expected '10'. - In step `Then I entered "5" and expect "10"'. # FeatureContext::complexStep() - From scenario ***. # features/calc_en.feature:13 - Of feature `Basic calculator'. # features/calc_en.feature - - 3 scenarios (2 passed, 1 failed) - 9 steps (8 passed, 1 failed) - """ - - Scenario: - Given a file named "features/calc_en.feature" with: - """ - Feature: Basic calculator - Scenario: - Given I have entered "7" - When I press + - Then I should see "8" on the screen - """ - When I run "behat --no-ansi -f progress features/calc_en.feature" - Then it should fail with: - """ - ..F - - (::) failed steps (::) - - 01. Failed asserting that 7 matches expected '8'. - In step `Then I should see "8" on the screen'. # FeatureContext::iShouldSeeEn() - From scenario ***. # features/calc_en.feature:2 - Of feature `Basic calculator'. # features/calc_en.feature - - 1 scenario (1 failed) - 3 steps (2 passed, 1 failed) - """ - - Scenario: - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функционал: Стандартный калькулятор - Сценарий: - Допустим Я ввел "12" - И Я ввел "27" - Если Я нажму + - То Я должен увидеть на экране "39" - И Я создам себе passing таблицу - И Вызовем несуществующий шаг - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should fail with: - """ - .....F - - (::) failed steps (::) - - 01. Undefined step "non-existent step" - In step `И Вызовем несуществующий шаг'. # FeatureContext::assertUnexistentStepRu() - From scenario ***. # features/calc_ru.feature:3 - Of feature `Стандартный калькулятор'. # features/calc_ru.feature - - 1 scenario (1 failed) - 6 steps (5 passed, 1 failed) - """ - - Scenario: Substeps i18n - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функционал: Стандартный калькулятор - Сценарий: - Если Я сложу числа "12" и "27" - То Я должен увидеть на экране "39" - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Undefined substep in pretty format - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функционал: Стандартный калькулятор - Сценарий: - Допустим Я ввел "12" - И Я ввел "27" - Если Я нажму + - То Я должен увидеть на экране "39" - И Я создам себе passing таблицу - И Вызовем несуществующий шаг - """ - When I run "behat --no-ansi --no-paths features/calc_ru.feature" - Then it should fail with: - """ - Функционал: Стандартный калькулятор - - Сценарий: - Допустим Я ввел "12" - И Я ввел "27" - Если Я нажму + - То Я должен увидеть на экране "39" - И Я создам себе passing таблицу - И Вызовем несуществующий шаг - Undefined step "non-existent step" - - 1 scenario (1 failed) - 6 steps (5 passed, 1 failed) - """ - - Scenario: - Given a file named "features/calc_ru.feature" with: - """ - # language: ru - Функционал: Стандартный калькулятор - Сценарий: - Допустим Я ввел "7" - Если Я нажму + - То Я должен увидеть на экране "8" - - Сценарий: - Допустим Я создам себе failing таблицу - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should fail with: - """ - ..FF - - (::) failed steps (::) - - 01. Failed asserting that 7 matches expected '8'. - In step `То Я должен увидеть на экране "8"'. # FeatureContext::iShouldSeeRu() - From scenario ***. # features/calc_ru.feature:3 - Of feature `Стандартный калькулятор'. # features/calc_ru.feature - - 02. Failed asserting that two arrays are equal. - In step `Допустим Я создам себе failing таблицу'. # FeatureContext::assertFailingTableRu() - From scenario ***. # features/calc_ru.feature:8 - Of feature `Стандартный калькулятор'. # features/calc_ru.feature - - 2 scenarios (2 failed) - 4 steps (2 passed, 2 failed) - """ diff --git a/vendor/behat/behat/features/annotations/syntax_help.feature b/vendor/behat/behat/features/annotations/syntax_help.feature deleted file mode 100644 index d428646..0000000 --- a/vendor/behat/behat/features/annotations/syntax_help.feature +++ /dev/null @@ -1,420 +0,0 @@ -Feature: Syntax helpers - In order to get syntax help - As a feature writer - I need to be able to print supported definitions and Gherkin keywords - - Scenario: Print story syntax - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - - And there is agent - When I erase agent 's memory - Then there should be agent - But there should not be agent - - [Examples|Scenarios]: - | agent1 | agent2 | - | D | M | - """ - - Scenario: Print story syntax in native language - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - - [И|К тому же|Также] there is agent - [Если|Когда] I erase agent 's memory - [То|Тогда] there should be agent - [Но|А] there should not be agent - - Примеры: - | agent1 | agent2 | - | D | M | - """ - - Scenario: Print available definitions - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - - -
- - - /^I have (\d+) apples?$/ - /^у меня (\d+) яблоко?$/ - - - /^I found (\d+) apples?$/ - /^Я нашел (\d+) яблоко?$/ - - - - - """ - When I run "behat --no-ansi -dl --lang=ru" - Then the output should contain: - """ - Given /^у меня (\d+) яблоко?$/ - When /^I ate (\d+) apples?$/ - When /^Я нашел (\d+) яблоко?$/ - Then /^I should have (\d+) apples$/ - """ - - Scenario: Print extended definitions info - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - - -
- - - /^I have (\d+) apples?$/ - /^у меня (\d+) яблоко?$/ - - - /^I found (\d+) apples?$/ - /^Я нашел (\d+) яблоко?$/ - - - - - """ - When I run "behat --no-ansi --lang=ru -d 'нашел'" - Then the output should contain: - """ - When /^Я нашел (\d+) яблоко?$/ - # FeatureContext::iFoundApples() - """ diff --git a/vendor/behat/behat/features/annotations/tag_filters.feature b/vendor/behat/behat/features/annotations/tag_filters.feature deleted file mode 100644 index b76c57a..0000000 --- a/vendor/behat/behat/features/annotations/tag_filters.feature +++ /dev/null @@ -1,332 +0,0 @@ -Feature: Tags - In order to run only needed features - As a Behat user - I need to Behat support features & scenario/outline tags - - Background: - Given a file named "features/bootstrap/bootstrap.php" with: - """ - - - Examples: - | num | - | 31 | - | 32 | - - @normal - Scenario: - Given Some normal step N38 - - @fast - Scenario Outline: - Given Some fast step N - - Examples: - | num | - | 33 | - | 34 | - - @normal @fast - Scenario Outline: - Given Some normal step N - And Some fast step N37 - - Examples: - | num | - | 35 | - | 36 | - """ - And a file named "features/feature4.feature" with: - """ - Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - - @fast - Scenario: - Given Some slow step N43 - """ - - Scenario: Single tag - When I run "behat --no-ansi -f pretty --tags '@slow' --no-paths" - Then it should pass - And the output should contain: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - Scenario: - Given Some slow step N12 - And Some normal step N13 - - @fast - Scenario: - Given Some fast step N14 - """ - And the output should contain: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - """ - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @slow - Scenario Outline: - Given Some slow step N - - Examples: - | num | - | 31 | - | 32 | - """ - And the output should contain: - """ - 5 scenarios (5 passed) - 12 steps (12 passed) - """ - - Scenario: Or tags - When I run "behat --no-ansi -f pretty --tags '@slow,@normal' --no-paths" - Then it should pass - And the output should contain: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - Scenario: - Given Some slow step N12 - And Some normal step N13 - - @fast - Scenario: - Given Some fast step N14 - """ - And the output should contain: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - """ - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @slow - Scenario Outline: - Given Some slow step N - - Examples: - | num | - | 31 | - | 32 | - - @normal - Scenario: - Given Some normal step N38 - - @normal @fast - Scenario Outline: - Given Some normal step N - And Some fast step N37 - - Examples: - | num | - | 35 | - | 36 | - """ - And the output should contain: - """ - Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - """ - And the output should contain: - """ - 9 scenarios (9 passed) - 22 steps (22 passed) - """ - - Scenario: And tags - When I run "behat --no-ansi -f pretty --tags '@slow,@normal&&@fast' --no-paths" - Then it should pass - And the output should contain: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - @fast - Scenario: - Given Some fast step N14 - """ - And the output should contain: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - """ - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @normal @fast - Scenario Outline: - Given Some normal step N - And Some fast step N37 - - Examples: - | num | - | 35 | - | 36 | - """ - And the output should contain: - """ - 4 scenarios (4 passed) - 11 steps (11 passed) - """ - - Scenario: Not tags - When I run "behat --no-ansi -f pretty --tags '~@slow&&~@fast' --no-paths" - Then it should pass - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @normal - Scenario: - Given Some normal step N38 - """ - And the output should contain: - """ - Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - """ - And the output should contain: - """ - 2 scenarios (2 passed) - 4 steps (4 passed) - """ diff --git a/vendor/behat/behat/features/annotations/traits.feature b/vendor/behat/behat/features/annotations/traits.feature deleted file mode 100644 index 4e0ff65..0000000 --- a/vendor/behat/behat/features/annotations/traits.feature +++ /dev/null @@ -1,112 +0,0 @@ -@php540 -Feature: Support php 5.4 traits - In order to have much cleaner horizontal reusability - As a context developer - I need to be able to use definition traits in my context - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - } - """ - And a file named "features/bootstrap/ApplesDefinitions.php" with: - """ - apples = intval($count); - } - - /** - * @When /^I ate (\d+) apples?$/ - */ - public function iAteApples($count) { - $this->apples -= intval($count); - } - - /** - * @When /^I found (\d+) apples?$/ - */ - public function iFoundApples($count) { - $this->apples += intval($count); - } - - /** - * @Then /^I should have (\d+) apples$/ - */ - public function iShouldHaveApples($count) { - assertEquals(intval($count), $this->apples); - } - } - """ - And a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 2 apples - - Scenario: Found more apples - When I found 5 apples - Then I should have 8 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 4 | 7 | - | 2 | 2 | 3 | - """ - - Scenario: Run feature with failing scenarios - When I run "behat --no-ansi -f progress" - Then it should pass with: - """ - ..................... - - 6 scenarios (6 passed) - 21 steps (21 passed) - """ diff --git a/vendor/behat/behat/features/bootstrap/BaseFeaturesContext.php b/vendor/behat/behat/features/bootstrap/BaseFeaturesContext.php deleted file mode 100644 index efb2034..0000000 --- a/vendor/behat/behat/features/bootstrap/BaseFeaturesContext.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat test suite base context. - * Used to demonstrate inheritance abilities of contexts. - * - * @author Konstantin Kudryashov - */ -class BaseFeaturesContext extends BehatContext -{ - /** - * Creates a file with specified name and context in current workdir. - * - * @Given /^(?:there is )?a file named "([^"]*)" with:$/ - * - * @param string $filename name of the file (relative path) - * @param Behat\Gherkin\Node\PyStringNode $content PyString string instance - */ - public function aFileNamedWith($filename, PyStringNode $content) {} - - /** - * Moves user to the specified path. - * - * @Given /^I am in the "([^"]*)" path$/ - * - * @param string $path - */ - public function iAmInThePath($path) {} -} diff --git a/vendor/behat/behat/features/bootstrap/FeatureContext.php b/vendor/behat/behat/features/bootstrap/FeatureContext.php deleted file mode 100644 index f5c7a00..0000000 --- a/vendor/behat/behat/features/bootstrap/FeatureContext.php +++ /dev/null @@ -1,263 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat test suite context. - * - * @author Konstantin Kudryashov - */ -class FeatureContext extends BaseFeaturesContext -{ - /** - * Environment variable - * - * @var string - */ - private $env; - /** - * Last runned command name. - * - * @var string - */ - private $command; - /** - * Last runned command output. - * - * @var string - */ - private $output; - /** - * Last runned command return code. - * - * @var integer - */ - private $return; - - /** - * Initializes context. - * - * @param array $parameters - */ - public function __construct(array $parameters = array()) - { - $this->useContext('hooks', new Hooks()); - $this->useContext('support', new Support()); - } - - /** - * {@inheritdoc} - */ - public function aFileNamedWith($filename, PyStringNode $content) - { - $content = strtr((string) $content, array("'''" => '"""')); - - // call method of one of subcontexts - $this->getSubcontext('support')->createFile($filename, $content); - } - - /** - * {@inheritdoc} - */ - public function iAmInThePath($path) - { - // call method of one of subcontexts - $this->getSubcontext('support')->moveToNewPath($path); - } - - /** - * Checks whether a file at provided path exists. - * - * @Given /^file "([^"]*)" should exist$/ - * - * @param string $path - */ - public function fileShouldExist($path) - { - assertFileExists(getcwd() . DIRECTORY_SEPARATOR . $path); - } - - /** - * Sets specified ENV variable - * - * @When /^"BEHAT_PARAMS" environment variable is set to:$/ - * - * @param PyStringNode $value - */ - public function iSetEnvironmentVariable(PyStringNode $value) - { - $this->env = (string) $value; - } - - /** - * Runs behat command with provided parameters - * - * @When /^I run "behat(?: ([^"]*))?"$/ - * - * @param string $argumentsString - */ - public function iRunBehat($argumentsString = '') - { - $argumentsString = strtr($argumentsString, array('\'' => '"')); - - if ('/' === DIRECTORY_SEPARATOR) { - $argumentsString .= ' 2>&1'; - } - - if ($this->env) { - exec($command = sprintf('BEHAT_PARAMS="%s" %s %s %s', - $this->env, BEHAT_PHP_BIN_PATH, escapeshellarg(BEHAT_BIN_PATH), $argumentsString - ), $output, $return); - } else { - exec($command = sprintf('%s %s %s --no-time', - BEHAT_PHP_BIN_PATH, escapeshellarg(BEHAT_BIN_PATH), $argumentsString - ), $output, $return); - } - - $this->command = 'behat ' . $argumentsString; - $this->output = trim(implode("\n", $output)); - $this->return = $return; - } - - /** - * @When I escape ansi characters in the output - */ - public function iEscapeAnsiCharactersInTheOutput() - { - $this->output = addcslashes($this->output, "\033"); - } - - /** - * Checks whether previously runned command passes|failes with provided output. - * - * @Then /^it should (fail|pass) with:$/ - * - * @param string $success "fail" or "pass" - * @param Behat\Gherkin\Node\PyStringNode $text PyString text instance - */ - public function itShouldPassWith($success, PyStringNode $text) - { - if ('fail' === $success) { - assertNotEquals(0, $this->return); - } else { - assertEquals(0, $this->return); - } - - $text = strtr($text, array('\'\'\'' => '"""', '%PATH%' => realpath(getcwd()))); - - // windows path fix - if ('/' !== DIRECTORY_SEPARATOR) { - $text = preg_replace_callback('/ features\/[^\n ]+/', function($matches) { - return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); - }, (string) $text); - $text = preg_replace_callback('/\features\/[^\<]+/', function($matches) { - return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); - }, (string) $text); - $text = preg_replace_callback('/\+[fd] [^ ]+/', function($matches) { - return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); - }, (string) $text); - } - - try { - assertEquals((string) $text, $this->output); - } catch (Exception $e) { - $diff = PHPUnit_Framework_TestFailure::exceptionToString($e); - throw new Exception($diff, $e->getCode(), $e); - } - } - - /** - * Checks whether specified file exists and contains specified string. - * - * @Given /^"([^"]*)" file should contain:$/ - * - * @param string $path file path - * @param Behat\Gherkin\Node\PyStringNode $text file content - */ - public function fileShouldContain($path, PyStringNode $text) - { - try { - assertFileExists($path); - assertEquals((string) $text, trim(file_get_contents($path))); - } catch (Exception $e) { - $diff = PHPUnit_Framework_TestFailure::exceptionToString($e); - throw new Exception($diff, $e->getCode(), $e); - } - } - - /** - * Prints last command output string. - * - * @Then display last command output - */ - public function displayLastCommandOutput() - { - $this->printDebug("`" . $this->command . "`:\n" . $this->output); - } - - /** - * Checks whether last command output contains provided string. - * - * @Then the output should contain: - * - * @param Behat\Gherkin\Node\PyStringNode $text PyString text instance - */ - public function theOutputShouldContain(PyStringNode $text) - { - $text = strtr($text, array('\'\'\'' => '"""', '%PATH%' => realpath(getcwd()))); - - // windows path fix - if ('/' !== DIRECTORY_SEPARATOR) { - $text = preg_replace_callback('/ features\/[^\n ]+/', function($matches) { - return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); - }, (string) $text); - $text = preg_replace_callback('/\features\/[^\<]+/', function($matches) { - return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); - }, (string) $text); - $text = preg_replace_callback('/\+[fd] [^ ]+/', function($matches) { - return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); - }, (string) $text); - } - - try { - assertContains((string) $text, $this->output); - } catch (Exception $e) { - $diff = PHPUnit_Framework_TestFailure::exceptionToString($e); - throw new Exception($diff, $e->getCode(), $e); - } - } - - /** - * Checks whether previously runned command failed|passed. - * - * @Then /^it should (fail|pass)$/ - * - * @param string $success "fail" or "pass" - */ - public function itShouldFail($success) - { - if ('fail' === $success) { - assertNotEquals(0, $this->return); - } else { - assertEquals(0, $this->return); - } - } -} diff --git a/vendor/behat/behat/features/bootstrap/Hooks.php b/vendor/behat/behat/features/bootstrap/Hooks.php deleted file mode 100644 index 33943bb..0000000 --- a/vendor/behat/behat/features/bootstrap/Hooks.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat test suite hooks. - * - * @author Konstantin Kudryashov - */ -class Hooks extends BehatContext -{ - /** - * @BeforeScenario - * - * Checks that we have access to main context (FeatureContext). - */ - public function checkThatWeHaveMainContext() - { - assertInstanceOf('FeatureContext', $this->getMainContext()); - assertEquals('Hello, zet', $this->getMainContext()->getSubcontext('support')->hello('zet')); - } - - /** - * @BeforeSuite - * - * Cleans test folders in the temporary directory. - */ - public static function cleanTestFolders() - { - if (is_dir($dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'behat')) { - self::rmdirRecursive($dir); - } - } - - /** - * @BeforeScenario - * - * Prepares test folders in the temporary directory. - */ - public function prepareTestFolders($event) - { - $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'behat' . DIRECTORY_SEPARATOR . - md5(microtime() * rand(0, 10000)); - - mkdir($dir, 0777, true); - chdir($dir); - - mkdir('features'); - mkdir('features' . DIRECTORY_SEPARATOR . 'bootstrap'); - mkdir('features' . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR . 'i18n'); - - mkdir('features' . DIRECTORY_SEPARATOR . 'support'); - mkdir('features' . DIRECTORY_SEPARATOR . 'steps'); - mkdir('features' . DIRECTORY_SEPARATOR . 'steps' . DIRECTORY_SEPARATOR . 'i18n'); - } - - /** - * Removes files and folders recursively at provided path. - * - * @param string $path - */ - private static function rmdirRecursive($path) { - $files = scandir($path); - array_shift($files); - array_shift($files); - - foreach ($files as $file) { - $file = $path . DIRECTORY_SEPARATOR . $file; - if (is_dir($file)) { - self::rmdirRecursive($file); - } else { - unlink($file); - } - } - - rmdir($path); - } -} diff --git a/vendor/behat/behat/features/bootstrap/Support.php b/vendor/behat/behat/features/bootstrap/Support.php deleted file mode 100644 index 67219c3..0000000 --- a/vendor/behat/behat/features/bootstrap/Support.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat test suite support. - * - * @author Konstantin Kudryashov - */ -class Support extends BehatContext -{ - public function createFile($filename, $content) - { - file_put_contents($filename, $content); - } - - public function moveToNewPath($path) - { - if (!file_exists($path)) { - mkdir($path, 0777, true); - } - - chdir($path); - } - - public function hello($name) - { - return "Hello, $name"; - } -} diff --git a/vendor/behat/behat/features/closures/arguments.feature b/vendor/behat/behat/features/closures/arguments.feature deleted file mode 100644 index 30f71fe..0000000 --- a/vendor/behat/behat/features/closures/arguments.feature +++ /dev/null @@ -1,221 +0,0 @@ -Feature: Step Arguments - In order to write extended steps - As a feature writer - I need ability to specify Table & PyString arguments to steps - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - strings[1] = "hello,\n w\n o\nr\nl\n d"; - $world->tables[1] = array( - array('item1' => 'super', 'item2' => 'mega', 'item3' => 'extra'), - array('item1' => 'hyper', 'item2' => 'mini', 'item3' => 'XXL'), - ); - """ - And a file named "features/steps/arguments.php" with: - """ - Given('/^a pystring:$/', function($world, $string) { - $world->input = $string; - }); - $steps->Given('/^a table:$/', function($world, $table) { - $world->input = $table; - }); - $steps->Then('/^it must be equals to string (\d+)$/', function($world, $arg1) { - assertEquals($world->strings[intval($arg1)], (string) $world->input); - }); - $steps->Then('/^it must be equals to table (\d+)$/', function($world, $arg1) { - assertEquals($world->tables[intval($arg1)], $world->input->getHash()); - }); - """ - - Scenario: PyStrings - Given a file named "features/pystring.feature" with: - """ - Feature: PyStrings - Scenario: - Given a pystring: - ''' - hello, - w - o - r - l - d - ''' - Then it must be equals to string 1 - """ - When I run "behat --no-ansi -f progress features/pystring.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: PyStrings tokens - Given a file named "features/pystring_tokens.feature" with: - """ - Feature: PyStrings - Scenario Outline: - Given a pystring: - ''' - - w - o - r - - d - ''' - Then it must be equals to string 1 - - Examples: - | word1 | word2 | - | hello, | l | - """ - When I run "behat --no-ansi -f progress features/pystring_tokens.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Table tokens - Given a file named "features/table_tokens.feature" with: - """ - Feature: Tables - Scenario Outline: - Given a table: - | item1 | item2 | item3 | - | | | extra | - | hyper | mini | | - Then it must be equals to table 1 - - Examples: - | word1 | word2 | word3 | - | super | XXL | mega | - """ - When I run "behat --no-ansi -f progress features/table_tokens.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Table - Given a file named "features/table.feature" with: - """ - Feature: Tables - Scenario: - Given a table: - | item1 | item2 | item3 | - | super | mega | extra | - | hyper | mini | XXL | - Then it must be equals to table 1 - """ - When I run "behat --no-ansi -f progress features/table.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: Named arguments - Given a file named "features/steps/named_args_steps.php" with: - """ - Given('/^I have number2 = (?P\d+) and number1 = (?P\d+)$/', function($world, $number1, $number2) { - assertEquals(13, $number1); - assertEquals(243, $number2); - }); - """ - And a file named "features/named_args.feature" with: - """ - Feature: Named arguments - In order to maintain i18n for steps - As a step developer - I need to be able to declare regex with named parameters - - Scenario: - Given I have number2 = 243 and number1 = 13 - """ - When I run "behat --no-ansi -f progress features/named_args.feature" - Then it should pass with: - """ - . - - 1 scenario (1 passed) - 1 step (1 passed) - """ diff --git a/vendor/behat/behat/features/closures/definitions_translations.feature b/vendor/behat/behat/features/closures/definitions_translations.feature deleted file mode 100644 index c1e37e5..0000000 --- a/vendor/behat/behat/features/closures/definitions_translations.feature +++ /dev/null @@ -1,135 +0,0 @@ -Feature: Definitions translations - In order to be able to use predefined steps in native language - As a step definitions developer - I need to be able to write definition translations - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function getTranslationResources() { - if (file_exists(__DIR__ . '/../steps/i18n')) { - $finder = new Finder(); - return $finder->files()->name('*.xliff')->in(__DIR__ . '/../steps/i18n'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have entered (\d+) into calculator$/', function($world, $number) { - $world->numbers[] = intval($number); - }); - $steps->Given('/^I have clicked "+"$/', function($world) { - $world->result = array_sum($world->numbers); - }); - $steps->Then('/^I should see (\d+) on the screen$/', function($world, $result) { - assertEquals(intval($result), $world->result); - }); - """ - And a file named "features/steps/i18n/ru.xliff" with: - """ - - -
- - - /^I have entered (\d+) into calculator$/ - /^Я набрал число (\d+) на калькуляторе$/ - - - /^I have clicked "+"$/ - /^Я нажал "([^"]*)"$/ - - - /^I should see (\d+) on the screen$/ - /^Я должен увидеть на экране (\d+)$/ - - - - - """ - When I run "behat --no-ansi -f progress features/calc_ru.feature" - Then it should pass with: - """ - .... - - 1 scenario (1 passed) - 4 steps (4 passed) - """ diff --git a/vendor/behat/behat/features/closures/environment.feature b/vendor/behat/behat/features/closures/environment.feature deleted file mode 100644 index a7b41be..0000000 --- a/vendor/behat/behat/features/closures/environment.feature +++ /dev/null @@ -1,229 +0,0 @@ -Feature: Environment consistency - In order to maintain stable behavior tests - As a feature writer - I need a separate environment for every scenario/outline - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have (\d+) apples?$/', function($world, $apples) { - $world->apples = intval($apples); - }); - $steps->When('/^I ate (\d+) apples?$/', function($world, $apples) { - $world->apples -= intval($apples); - }); - $steps->When('/^I found (\d+) apples?$/', function($world, $apples) { - $world->apples += intval($apples); - }); - $steps->Then('/^I should have (\d+) apples$/', function($world, $apples) { - assertEquals(intval($apples), $world->apples); - }); - """ - - Scenario: True "apples story" - Given a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 2 apples - - Scenario: Found more apples - When I found 2 apples - Then I should have 5 apples - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 1 | - | 0 | 5 | 8 | - | 2 | 2 | 3 | - """ - When I run "behat --no-ansi -f progress features/apples.feature" - Then it should pass with: - """ - .................. - - 5 scenarios (5 passed) - 18 steps (18 passed) - """ - - Scenario: False "apples story" - Given a file named "features/apples.feature" with: - """ - Feature: Apples story - In order to eat apple - As a little kid - I need to have an apple in my pocket - - Background: - Given I have 3 apples - - Scenario: I'm little hungry - When I ate 1 apple - Then I should have 5 apples - - Scenario: Found more apples - When I found 10 apples - Then I should have 10 apples - - Scenario Outline: Other situations - When I ate apples - And I found apples - Then I should have apples - - Examples: - | ate | found | result | - | 3 | 1 | 3 | - | 0 | 5 | 8 | - | 2 | 2 | 4 | - """ - When I run "behat --no-ansi -f progress features/apples.feature" - Then it should fail with: - """ - ..F..F...F.......F - - (::) failed steps (::) - - 01. Failed asserting that 2 matches expected 5. - In step `Then I should have 5 apples'. # features/steps/apple_steps.php:11 - From scenario `I'm little hungry'. # features/apples.feature:9 - Of feature `Apples story'. # features/apples.feature - - 02. Failed asserting that 13 matches expected 10. - In step `Then I should have 10 apples'. # features/steps/apple_steps.php:11 - From scenario `Found more apples'. # features/apples.feature:13 - Of feature `Apples story'. # features/apples.feature - - 03. Failed asserting that 1 matches expected 3. - In step `Then I should have 3 apples'. # features/steps/apple_steps.php:11 - From scenario `Other situations'. # features/apples.feature:17 - Of feature `Apples story'. # features/apples.feature - - 04. Failed asserting that 3 matches expected 4. - In step `Then I should have 4 apples'. # features/steps/apple_steps.php:11 - From scenario `Other situations'. # features/apples.feature:17 - Of feature `Apples story'. # features/apples.feature - - 5 scenarios (1 passed, 4 failed) - 18 steps (14 passed, 4 failed) - """ - - Scenario: Environment parameters - Given a file named "behat.yml" with: - """ - default: - context: - parameters: - parameter1: val_one - parameter2: - everzet: behat_admin - avalanche123: behat_admin - """ - And a file named "features/steps/env_vars_steps.php" with: - """ - Then('/^environment parameter "([^"]*)" should be equal to "([^"]*)"$/', function($world, $key, $val) { - assertEquals($val, $world->parameters[$key]); - }); - - $steps->And('/^environment parameter "([^"]*)" should be array with (\d+) elements$/', function($world, $key, $count) { - assertInternalType('array', $world->parameters[$key]); - assertEquals(2, count($world->parameters[$key])); - }); - """ - And a file named "features/params.feature" with: - """ - Feature: Environment parameters - In order to run a browser - As feature runner - I need to be able to configure behat environment - - Scenario: I'm little hungry - Then environment parameter "parameter1" should be equal to "val_one" - And environment parameter "parameter2" should be array with 2 elements - """ - When I run "behat --no-ansi -f progress features/params.feature" - Then it should pass with: - """ - .. - - 1 scenario (1 passed) - 2 steps (2 passed) - """ diff --git a/vendor/behat/behat/features/closures/hooks.feature b/vendor/behat/behat/features/closures/hooks.feature deleted file mode 100644 index eeadcea..0000000 --- a/vendor/behat/behat/features/closures/hooks.feature +++ /dev/null @@ -1,163 +0,0 @@ -Feature: hooks - In order to hook into Behat testing process - As a tester - I need to be able to write hooks - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have entered (\d+)$/', function($world, $arg1) { - $world->number = $arg1; - }); - $steps->Then('/^I must have (\d+)$/', function($world, $arg1) { - assertEquals($world->number, $arg1); - }); - """ - And a file named "features/support/hooks.php" with: - """ - beforeSuite(function($event) { - echo "= do something before all suite run\n"; - }); - $hooks->afterSuite(function($event) { - echo "= do something after all suite run\n"; - }); - $hooks->beforeScenario('', function($event) { - $env = $event->getContext(); - $env->number = 50; - }); - $hooks->beforeScenario('130', function($event) { - $env = $event->getContext(); - $env->number = 130; - }); - $hooks->beforeScenario('@thirty', function($event) { - $env = $event->getContext(); - $env->number = 30; - }); - $hooks->afterStep('@100', function($event) { - $env = $event->getContext(); - $env->number = 100; - }); - """ - - Scenario: - Given a file named "features/test.feature" with: - """ - Feature: - Scenario: - Then I must have 50 - Scenario: - Given I have entered 12 - Then I must have 12 - - @thirty - Scenario: - Given I must have 30 - When I have entered 23 - Then I must have 23 - @100 @thirty - Scenario: - Given I must have 30 - When I have entered 1 - Then I must have 100 - - Scenario: 130 - Given I must have 130 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - = do something before all suite run - Feature: - - Scenario: # features/test.feature:2 - Then I must have 50 # features/steps/steps.php:5 - - Scenario: # features/test.feature:4 - Given I have entered 12 # features/steps/steps.php:2 - Then I must have 12 # features/steps/steps.php:5 - - @thirty - Scenario: # features/test.feature:9 - Given I must have 30 # features/steps/steps.php:5 - When I have entered 23 # features/steps/steps.php:2 - Then I must have 23 # features/steps/steps.php:5 - - @100 @thirty - Scenario: # features/test.feature:14 - Given I must have 30 # features/steps/steps.php:5 - When I have entered 1 # features/steps/steps.php:2 - Then I must have 100 # features/steps/steps.php:5 - - Scenario: 130 # features/test.feature:19 - Given I must have 130 # features/steps/steps.php:5 - - = do something after all suite run - 5 scenarios (5 passed) - 10 steps (10 passed) - """ diff --git a/vendor/behat/behat/features/closures/hooks_require_once.feature b/vendor/behat/behat/features/closures/hooks_require_once.feature deleted file mode 100644 index 923d7d2..0000000 --- a/vendor/behat/behat/features/closures/hooks_require_once.feature +++ /dev/null @@ -1,171 +0,0 @@ -Feature: hooks - In order to hook into Behat testing process - As a tester - I need to be able to write hooks - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/')) { - $finder = new Finder(); - return $finder->files()->name('hooks*.php')->in(__DIR__ . '/../support'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have entered (\d+)$/', function($world, $arg1) { - $world->number = $arg1; - }); - $steps->Then('/^I must have (\d+)$/', function($world, $arg1) { - assertEquals($world->number, $arg1); - }); - """ - And a file named "features/support/hooks_before.php" with: - """ - beforeSuite(function($event) { - echo "= do something before all suite run\n"; - }); - $hooks->beforeScenario('', function($event) { - $env = $event->getContext(); - $env->number = 50; - }); - $hooks->beforeScenario('130', function($event) { - $env = $event->getContext(); - $env->number = 130; - }); - $hooks->beforeScenario('@thirty', function($event) { - $env = $event->getContext(); - $env->number = 30; - }); - """ - And a file named "features/support/hooks_after.php" with: - """ - afterSuite(function($event) { - echo "= do something after all suite run\n"; - }); - $hooks->afterStep('@100', function($event) { - $env = $event->getContext(); - $env->number = 100; - }); - """ - - - Scenario: - Given a file named "features/test.feature" with: - """ - Feature: - Scenario: - Then I must have 50 - Scenario: - Given I have entered 12 - Then I must have 12 - - @thirty - Scenario: - Given I must have 30 - When I have entered 23 - Then I must have 23 - @100 @thirty - Scenario: - Given I must have 30 - When I have entered 1 - Then I must have 100 - - Scenario: 130 - Given I must have 130 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - = do something before all suite run - Feature: - - Scenario: # features/test.feature:2 - Then I must have 50 # features/steps/steps.php:5 - - Scenario: # features/test.feature:4 - Given I have entered 12 # features/steps/steps.php:2 - Then I must have 12 # features/steps/steps.php:5 - - @thirty - Scenario: # features/test.feature:9 - Given I must have 30 # features/steps/steps.php:5 - When I have entered 23 # features/steps/steps.php:2 - Then I must have 23 # features/steps/steps.php:5 - - @100 @thirty - Scenario: # features/test.feature:14 - Given I must have 30 # features/steps/steps.php:5 - When I have entered 1 # features/steps/steps.php:2 - Then I must have 100 # features/steps/steps.php:5 - - Scenario: 130 # features/test.feature:19 - Given I must have 130 # features/steps/steps.php:5 - - = do something after all suite run - 5 scenarios (5 passed) - 10 steps (10 passed) - """ diff --git a/vendor/behat/behat/features/closures/html.feature b/vendor/behat/behat/features/closures/html.feature deleted file mode 100644 index 38a0014..0000000 --- a/vendor/behat/behat/features/closures/html.feature +++ /dev/null @@ -1,443 +0,0 @@ -Feature: HTML Formatter - In order to print features - As a feature writer - I need to have an html formatter - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/I have entered (\d+)/', function($world, $num) { - assertObjectNotHasAttribute('value', $world); - $world->value = $num; - }); - - $steps->Then('/I must have (\d+)/', function($world, $num) { - assertEquals($num, $world->value); - }); - - $steps->When('/I (add|subtract) the value (\d+)/', function($world, $op, $num) { - if ($op == 'add') - $world->value += $num; - elseif ($op == 'subtract') - $world->value -= $num; - }); - """ - - Scenario: Multiple parameters - Given a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Adding - Then I must have 10 - And I add the value 6 - Then I must have 16 - - Scenario: Subtracting - Then I must have 10 - And I subtract the value 6 - Then I must have 4 - """ - When I run "behat --no-ansi -f html" - Then it should pass - And the output should contain: - """ -
-

- Feature: - World consistency -

-

- In order to maintain stable behaviors
- As a features developer
- I want, that "World" flushes between scenarios
-

- -
-

- Background: - features/World.feature:6 -

-
    -
  1. -
    - Given - I have entered 10 - features/steps/math.php:2 -
    -
  2. -
-
-
-

- Scenario: - Adding - features/World.feature:9 -

-
    -
  1. -
    - Then - I must have 10 - features/steps/math.php:7 -
    -
  2. -
  3. -
    - And - I add the value 6 - features/steps/math.php:11 -
    -
  4. -
  5. -
    - Then - I must have 16 - features/steps/math.php:7 -
    -
  6. -
-
-
-

- Scenario: - Subtracting - features/World.feature:14 -

-
    -
  1. -
    - Then - I must have 10 - features/steps/math.php:7 -
    -
  2. -
  3. -
    - And - I subtract the value 6 - features/steps/math.php:11 -
    -
  4. -
  5. -
    - Then - I must have 4 - features/steps/math.php:7 -
    -
  6. -
-
-
- """ - - Scenario: Scenario outline examples table - Given a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario Outline: Adding - Then I must have 10 - And I add the value - Then I must have - - Examples: - | n | total | - | 5 | 15 | - | 10 | 21 | - """ - When I run "behat --no-ansi -f html" - Then the output should contain: - """ -
-

- Scenario Outline: - Adding - features/World.feature:9 -

-
    -
  1. -
    - Then - I must have 10 - features/steps/math.php:7 -
    -
  2. -
  3. -
    - And - I add the value <n> - features/steps/math.php:11 -
    -
  4. -
  5. -
    - Then - I must have <total> - features/steps/math.php:7 -
    -
  6. -
-
-

Examples

-
- - - - - - - - - - - - - - - - - - - -
ntotal
515
1021
-
Failed asserting that 20 matches expected '21'.
-
- - - """ - - Scenario: Scenario outline examples expanded - Given a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario Outline: Adding - Then I must have 10 - And I add the value - Then I must have - - Examples: - | n | total | - | 5 | 15 | - | 10 | 21 | - """ - When I run "behat --no-ansi -f html --expand" - Then the output should contain: - """ -
-

- Scenario Outline: - Adding - features/World.feature:9 -

-
    -
  1. -
    - Then - I must have 10 - features/steps/math.php:7 -
    -
  2. -
  3. -
    - And - I add the value <n> - features/steps/math.php:11 -
    -
  4. -
  5. -
    - Then - I must have <total> - features/steps/math.php:7 -
    -
  6. -
-
-

Examples: 515

-
    -
  1. -
    - Then - I must have 10 - features/steps/math.php:7 -
    -
  2. -
-
    -
  1. -
    - And - I add the value 5 - features/steps/math.php:11 -
    -
  2. -
-
    -
  1. -
    - Then - I must have 15 - features/steps/math.php:7 -
    -
  2. -
-

Examples: 1021

-
    -
  1. -
    - Then - I must have 10 - features/steps/math.php:7 -
    -
  2. -
-
    -
  1. -
    - And - I add the value 10 - features/steps/math.php:11 -
    -
  2. -
-
    -
  1. -
    - Then - I must have 21 - features/steps/math.php:7 -
    -
    Failed asserting that 20 matches expected '21'.
    -
  2. -
-
-
- """ - - Scenario: Links to step definitions relative to a remote base - Given a file named "behat.yml" with: - """ - default: - paths: - features: %behat.paths.base%/features - bootstrap: %behat.paths.base%/features/bootstrap - formatter: - name: 'html' - parameters: - paths_base_url: 'http://localhost/' - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Scenario: Nothing - Given I have entered 10 - """ - When I run "behat --no-ansi -c behat.yml -f html" - Then the output should contain: - """ -
-

- Scenario: - Nothing - features/World.feature:6 -

-
    -
  1. -
    - Given - I have entered 10 - features/steps/math.php:2 -
    -
  2. -
-
- """ diff --git a/vendor/behat/behat/features/closures/i18n.feature b/vendor/behat/behat/features/closures/i18n.feature deleted file mode 100644 index 8e66722..0000000 --- a/vendor/behat/behat/features/closures/i18n.feature +++ /dev/null @@ -1,217 +0,0 @@ -Feature: I18n - In order to write i18nal features - As a feature writer - I need to have i18n support - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/Я ввел (\d+)/', function($world, $num) { - assertObjectNotHasAttribute('value', $world); - $world->value = $num; - }); - - $steps->Then('/Я должен иметь (\d+)/', function($world, $num) { - assertEquals($num, $world->value); - }); - - $steps->When('/Я добавлю (\d+)/', function($world, $num) { - $world->value += $num; - }); - - $steps->Given('/^Что-то еще не сделано$/', function($world) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - And a file named "features/World.feature" with: - """ - # language: ru - Функционал: Постоянство мира - Чтобы поддерживать стабильными тесты - Как разработчик функционала - Я хочу чтобы Мир сбрасывался между сценариями - - Предыстория: - Если Я ввел 10 - - Сценарий: Неопределен - То Я должен иметь 10 - И Что-то новое - То Я должен иметь 10 - - Сценарий: В ожидании - То Я должен иметь 10 - И Что-то еще не сделано - То Я должен иметь 10 - - Сценарий: Провален - Если Я добавлю 4 - То Я должен иметь 13 - - Структура сценария: Пройдено и Провалено - Допустим Я должен иметь 10 - Если Я добавлю <значение> - То Я должен иметь <результат> - - Примеры: - | значение | результат | - | 5 | 16 | - | 10 | 20 | - | 23 | 32 | - """ - - Scenario: Pretty - When I run "behat --no-ansi -f pretty --lang=ru" - Then it should fail with: - """ - Функционал: Постоянство мира - Чтобы поддерживать стабильными тесты - Как разработчик функционала - Я хочу чтобы Мир сбрасывался между сценариями - - Предыстория: # features/World.feature:7 - Если Я ввел 10 # features/steps/math.php:2 - - Сценарий: Неопределен # features/World.feature:10 - То Я должен иметь 10 # features/steps/math.php:7 - И Что-то новое - То Я должен иметь 10 # features/steps/math.php:7 - - Сценарий: В ожидании # features/World.feature:15 - То Я должен иметь 10 # features/steps/math.php:7 - И Что-то еще не сделано # features/steps/math.php:15 - TODO: write pending definition - То Я должен иметь 10 # features/steps/math.php:7 - - Сценарий: Провален # features/World.feature:20 - Если Я добавлю 4 # features/steps/math.php:11 - То Я должен иметь 13 # features/steps/math.php:7 - Failed asserting that 14 matches expected '13'. - - Структура сценария: Пройдено и Провалено # features/World.feature:24 - Допустим Я должен иметь 10 # features/steps/math.php:7 - Если Я добавлю <значение> # features/steps/math.php:11 - То Я должен иметь <результат> # features/steps/math.php:7 - - Примеры: - | значение | результат | - | 5 | 16 | - Failed asserting that 15 matches expected '16'. - | 10 | 20 | - | 23 | 32 | - Failed asserting that 33 matches expected '32'. - - 6 сценариев (1 пройден, 1 в ожидании, 1 не определен, 3 провалено) - 23 шага (16 пройдено, 2 пропущено, 1 в ожидании, 1 не определен, 3 провалено) - - Вы можете реализовать определения для новых шагов с помощью этих шаблонов: - - $steps->Given('/^Что-то новое$/', function($world) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - - Scenario: Progress - When I run "behat --no-ansi -f progress --lang=ru" - Then it should fail with: - """ - ..U-..P-..F...F.......F - - (::) проваленные шаги (::) - - 01. Failed asserting that 14 matches expected '13'. - In step `То Я должен иметь 13'. # features/steps/math.php:7 - From scenario `Провален'. # features/World.feature:20 - Of feature `Постоянство мира'. # features/World.feature - - 02. Failed asserting that 15 matches expected '16'. - In step `То Я должен иметь 16'. # features/steps/math.php:7 - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - 03. Failed asserting that 33 matches expected '32'. - In step `То Я должен иметь 32'. # features/steps/math.php:7 - From scenario `Пройдено и Провалено'. # features/World.feature:24 - Of feature `Постоянство мира'. # features/World.feature - - (::) шаги в ожидании (::) - - 01. TODO: write pending definition - In step `И Что-то еще не сделано'. # features/steps/math.php:15 - From scenario `В ожидании'. # features/World.feature:15 - Of feature `Постоянство мира'. # features/World.feature - - 6 сценариев (1 пройден, 1 в ожидании, 1 не определен, 3 провалено) - 23 шага (16 пройдено, 2 пропущено, 1 в ожидании, 1 не определен, 3 провалено) - - Вы можете реализовать определения для новых шагов с помощью этих шаблонов: - - $steps->Given('/^Что-то новое$/', function($world) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ diff --git a/vendor/behat/behat/features/closures/instep_call.feature b/vendor/behat/behat/features/closures/instep_call.feature deleted file mode 100644 index 642138d..0000000 --- a/vendor/behat/behat/features/closures/instep_call.feature +++ /dev/null @@ -1,219 +0,0 @@ -Feature: Call step in other step - In order to mantain fluid step definition - As a features writer - I need to be able to call other steps from step body - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - hash = array('username' => 'everzet', 'password' => 'qwerty'); - """ - And a file named "features/steps/calc_steps_en.php" with: - """ - Given('/I have entered "([^"]*)"/', function($world, $number) { - $world->numbers[] = $number; - }); - $steps->When('/I press +/', function($world) { - $world->result = array_sum($world->numbers); - $world->numbers = array(); - }); - $steps->Then('/I should see "([^"]*)" on the screen/', function($world, $result) { - assertEquals($result, $world->result); - }); - $steps->Then('/Table should be:/', function($world, $table) { - assertEquals($world->hash, $table->getRowsHash()); - }); - """ - And a file named "features/steps/calc_steps_ru.php" with: - """ - Допустим('/Я ввел "([^"]*)"/', function($world, $number) use($steps) { - $steps->Given("I have entered \"$number\"", $world); - }); - $steps->Если('/Я нажму +/', function($world) use($steps) { - $steps->When("I press +", $world); - }); - $steps->Тогда('/Я должен увидеть на экране "([^"]*)"/', function($world, $result) use($steps) { - $steps->Then("I should see \"$result\" on the screen", $world); - }); - $steps->Тогда('/Я создам себе failing таблицу/', function($world) use($steps) { - $steps->Then('Table should be:', $world, new Behat\Gherkin\Node\TableNode(<<Тогда('/Я создам себе passing таблицу/', function($world) use($steps) { - $steps->Then('Table should be:', $world, new Behat\Gherkin\Node\TableNode(<<
parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^Some slow step N(\d+)$/', function($world, $num) {}); - $steps->Given('/^Some normal step N(\d+)$/', function($world, $num) {}); - $steps->Given('/^Some fast step N(\d+)$/', function($world, $num) {}); - """ - And a file named "features/feature1.feature" with: - """ - Feature: First Feature - - Background: - Given Some slow step N11 - - Scenario: First Scenario - Given Some slow step N12 - And Some normal step N13 - - Scenario: Second Scenario - Given Some fast step N14 - """ - And a file named "features/feature2.feature" with: - """ - Feature: Second Feature - - Background: - Given Some normal step N21 - - Scenario: First Scenario - Given Some slow step N22 - And Some fast step N23 - """ - - Scenario: First Name - When I run "behat --no-ansi -f pretty --name First" - Then it should pass with: - """ - Feature: First Feature - - Background: # features/feature1.feature:3 - Given Some slow step N11 # features/steps/steps.php:2 - - Scenario: First Scenario # features/feature1.feature:6 - Given Some slow step N12 # features/steps/steps.php:2 - And Some normal step N13 # features/steps/steps.php:3 - - Scenario: Second Scenario # features/feature1.feature:10 - Given Some fast step N14 # features/steps/steps.php:4 - - Feature: Second Feature - - Background: # features/feature2.feature:3 - Given Some normal step N21 # features/steps/steps.php:3 - - Scenario: First Scenario # features/feature2.feature:6 - Given Some slow step N22 # features/steps/steps.php:2 - And Some fast step N23 # features/steps/steps.php:4 - - 3 scenarios (3 passed) - 8 steps (8 passed) - """ - - Scenario: Second Name - When I run "behat --no-ansi -f pretty --name 'Second Scenario'" - Then it should pass with: - """ - Feature: First Feature - - Background: # features/feature1.feature:3 - Given Some slow step N11 # features/steps/steps.php:2 - - Scenario: Second Scenario # features/feature1.feature:10 - Given Some fast step N14 # features/steps/steps.php:4 - - 1 scenario (1 passed) - 2 steps (2 passed) - """ - - Scenario: RegEx - When I run "behat --no-ansi -f pretty --name '/nd Scenario$/'" - Then it should pass with: - """ - Feature: First Feature - - Background: # features/feature1.feature:3 - Given Some slow step N11 # features/steps/steps.php:2 - - Scenario: Second Scenario # features/feature1.feature:10 - Given Some fast step N14 # features/steps/steps.php:4 - - 1 scenario (1 passed) - 2 steps (2 passed) - """ diff --git a/vendor/behat/behat/features/closures/outlines.feature b/vendor/behat/behat/features/closures/outlines.feature deleted file mode 100644 index 8d2c5ac..0000000 --- a/vendor/behat/behat/features/closures/outlines.feature +++ /dev/null @@ -1,244 +0,0 @@ -Feature: Scenario Outlines - In order to write complex features - As a features writer - I want to write scenario outlines - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have basic calculator$/', function($world) { - $world->result = 0; - $world->numbers = array(); - }); - $steps->Given('/^I have entered (\d+)$/', function($world, $number) { - $world->numbers[] = intval($number); - }); - $steps->When('/^I add$/', function($world) { - foreach ($world->numbers as $number) { - $world->result += $number; - } - $world->numbers = array(); - }); - $steps->When('/^I sub$/', function($world) { - $world->result = array_shift($world->numbers); - foreach ($world->numbers as $number) { - $world->result -= $number; - } - $world->numbers = array(); - }); - $steps->When('/^I multiply$/', function($world) { - $world->result = array_shift($world->numbers); - foreach ($world->numbers as $number) { - $world->result *= $number; - } - $world->numbers = array(); - }); - $steps->When('/^I div$/', function($world) { - $world->result = array_shift($world->numbers); - foreach ($world->numbers as $number) { - $world->result /= $number; - } - $world->numbers = array(); - }); - $steps->Then('/^The result should be (\d+)$/', function($world, $result) { - assertEquals($result, $world->result); - }); - """ - - Scenario: Basic scenario outline - Given a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - """ - When I run "behat --no-ansi -f progress features/math.feature" - Then it should pass with: - """ - ............... - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - Scenario: Multiple scenario outlines - Given a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I multiply - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 120 | - | 5 | 3 | 15 | - - Scenario: - Given I have entered 10 - And I have entered 3 - When I sub - Then The result should be 7 - - Scenario Outline: - Given I have entered - And I have entered - When I div - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 2 | 5 | - | 50 | 5 | 10 | - """ - When I run "behat --no-ansi -f progress features/math.feature" - Then it should pass with: - """ - ......................... - - 5 scenarios (5 passed) - 25 steps (25 passed) - """ - - Scenario: Multiple scenario outlines with failing steps - Given a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I multiply - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 120 | - | 5 | 4 | 15 | - - Scenario: - Given I have entered 10 - And I have entered 4 - When I sub - Then The result should be 7 - - Scenario Outline: - Given I have entered - And I have entered - When I div - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 2 | 5 | - | 50 | 10 | 2 | - """ - When I run "behat --no-ansi -f progress features/math.feature" - Then it should fail with: - """ - .........F....F.........F - - (::) failed steps (::) - - 01. Failed asserting that 20 matches expected '15'. - In step `Then The result should be 15'. # features/steps/math.php:36 - From scenario ***. # features/math.feature:5 - Of feature `Math'. # features/math.feature - - 02. Failed asserting that 6 matches expected '7'. - In step `Then The result should be 7'. # features/steps/math.php:36 - From scenario ***. # features/math.feature:16 - Of feature `Math'. # features/math.feature - - 03. Failed asserting that 5 matches expected '2'. - In step `Then The result should be 2'. # features/steps/math.php:36 - From scenario ***. # features/math.feature:22 - Of feature `Math'. # features/math.feature - - 5 scenarios (2 passed, 3 failed) - 25 steps (22 passed, 3 failed) - """ diff --git a/vendor/behat/behat/features/closures/pretty.feature b/vendor/behat/behat/features/closures/pretty.feature deleted file mode 100644 index 558894d..0000000 --- a/vendor/behat/behat/features/closures/pretty.feature +++ /dev/null @@ -1,241 +0,0 @@ -Feature: Pretty Formatter - In order to debug features - As a feature writer - I need to have pretty formatter - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/I have entered (\d+)/', function($world, $num) { - assertObjectNotHasAttribute('value', $world); - $world->value = $num; - }); - - $steps->Then('/I must have (\d+)/', function($world, $num) { - assertEquals($num, $world->value); - }); - - $steps->When('/I add (\d+)/', function($world, $num) { - $world->value += $num; - }); - - $steps->Given('/^Something not done yet$/', function($world) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Undefined - Then I must have 10 - And Something new - Then I must have 10 - - Scenario: Pending - Then I must have 10 - And Something not done yet - Then I must have 10 - - Scenario: Failed - When I add 4 - Then I must have 13 - - Scenario Outline: Passed & Failed - Given I must have 10 - When I add - Then I must have - - Examples: - | value | result | - | 5 | 16 | - | 10 | 20 | - | 23 | 32 | - """ - When I run "behat --no-ansi -f pretty" - Then it should fail with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: # features/World.feature:6 - Given I have entered 10 # features/steps/math.php:2 - - Scenario: Undefined # features/World.feature:9 - Then I must have 10 # features/steps/math.php:7 - And Something new - Then I must have 10 # features/steps/math.php:7 - - Scenario: Pending # features/World.feature:14 - Then I must have 10 # features/steps/math.php:7 - And Something not done yet # features/steps/math.php:15 - TODO: write pending definition - Then I must have 10 # features/steps/math.php:7 - - Scenario: Failed # features/World.feature:19 - When I add 4 # features/steps/math.php:11 - Then I must have 13 # features/steps/math.php:7 - Failed asserting that 14 matches expected '13'. - - Scenario Outline: Passed & Failed # features/World.feature:23 - Given I must have 10 # features/steps/math.php:7 - When I add # features/steps/math.php:11 - Then I must have # features/steps/math.php:7 - - Examples: - | value | result | - | 5 | 16 | - Failed asserting that 15 matches expected '16'. - | 10 | 20 | - | 23 | 32 | - Failed asserting that 33 matches expected '32'. - - 6 scenarios (1 passed, 1 pending, 1 undefined, 3 failed) - 23 steps (16 passed, 2 skipped, 1 pending, 1 undefined, 3 failed) - - You can implement step definitions for undefined steps with these snippets: - - $steps->Given('/^Something new$/', function($world) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - - Scenario: Multiple parameters - Given a file named "features/steps/math.php" with: - """ - Given('/I have entered (\d+)/', function($world, $num) { - assertObjectNotHasAttribute('value', $world); - $world->value = $num; - }); - - $steps->Then('/I must have (\d+)/', function($world, $num) { - assertEquals($num, $world->value); - }); - - $steps->When('/I (add|subtract) the value (\d+)/', function($world, $op, $num) { - if ($op == 'add') - $world->value += $num; - elseif ($op == 'subtract') - $world->value -= $num; - }); - """ - And a file named "features/World.feature" with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: - Given I have entered 10 - - Scenario: Adding - Then I must have 10 - And I add the value 6 - Then I must have 16 - - Scenario: Subtracting - Then I must have 10 - And I subtract the value 6 - Then I must have 4 - """ - When I run "behat --no-ansi -f pretty --ansi" - Then it should pass with: - """ - Feature: World consistency - In order to maintain stable behaviors - As a features developer - I want, that "World" flushes between scenarios - - Background: # features/World.feature:6 - Given I have entered 10 # features/steps/math.php:2 - - Scenario: Adding # features/World.feature:9 - Then I must have 10 # features/steps/math.php:7 - And I add the value 6 # features/steps/math.php:11 - Then I must have 16 # features/steps/math.php:7 - - Scenario: Subtracting # features/World.feature:14 - Then I must have 10 # features/steps/math.php:7 - And I subtract the value 6 # features/steps/math.php:11 - Then I must have 4 # features/steps/math.php:7 - - 2 scenarios (2 passed) - 8 steps (8 passed) - """ diff --git a/vendor/behat/behat/features/closures/profiles.feature b/vendor/behat/behat/features/closures/profiles.feature deleted file mode 100644 index 8f6ee05..0000000 --- a/vendor/behat/behat/features/closures/profiles.feature +++ /dev/null @@ -1,190 +0,0 @@ -Feature: Profiles - In order to test my features - As a tester - I need to be able to create and run custom profiles - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have basic calculator$/', function($world) { - $world->result = 0; - $world->numbers = array(); - }); - $steps->Given('/^I have entered (\d+)$/', function($world, $number) { - $world->numbers[] = intval($number); - }); - $steps->When('/^I add$/', function($world) { - $world->result = array_sum($world->numbers); - $world->numbers = array(); - }); - $steps->When('/^I sub$/', function($world) { - $world->result = array_shift($world->numbers); - $world->result -= array_sum($world->numbers); - $world->numbers = array(); - }); - $steps->Then('/^The result should be (\d+)$/', function($world, $result) { - assertEquals($result, $world->result); - }); - """ - And a file named "features/math.feature" with: - """ - Feature: Math - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - """ - And a file named "pretty.yml" with: - """ - pretty: - formatter: - name: pretty - """ - And a file named "behat.yml" with: - """ - default: - formatter: - name: progress - pretty_without_paths: - formatter: - name: pretty - parameters: - paths: false - imports: - - pretty.yml - """ - - Scenario: - Given I run "behat --no-ansi features/math.feature" - Then it should pass with: - """ - ............... - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - Scenario: - Given I run "behat --no-ansi --profile pretty_without_paths" - Then it should pass with: - """ - Feature: Math - - Background: - Given I have basic calculator - - Scenario Outline: - Given I have entered - And I have entered - When I add - Then The result should be - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ - - Scenario: - Given I run "behat --no-ansi --profile pretty" - Then it should pass with: - """ - Feature: Math - - Background: # features/math.feature:2 - Given I have basic calculator # features/steps/math.php:2 - - Scenario Outline: # features/math.feature:5 - Given I have entered # features/steps/math.php:6 - And I have entered # features/steps/math.php:6 - When I add # features/steps/math.php:9 - Then The result should be # features/steps/math.php:18 - - Examples: - | number1 | number2 | result | - | 10 | 12 | 22 | - | 5 | 3 | 8 | - | 5 | 5 | 10 | - - 3 scenarios (3 passed) - 15 steps (15 passed) - """ diff --git a/vendor/behat/behat/features/closures/result_types.feature b/vendor/behat/behat/features/closures/result_types.feature deleted file mode 100644 index 04d35c0..0000000 --- a/vendor/behat/behat/features/closures/result_types.feature +++ /dev/null @@ -1,384 +0,0 @@ -Feature: Different result types - In order to differentiate feature statuses - As a feature writer - I need to be able to see different types of test results - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have magically created (\d+)\$$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - - $steps->When('/^I have chose "([^"]*)" in coffee machine$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - - $steps->Then('/^I should have "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - When I run "behat --no-ansi --strict -f progress features/coffee.feature" - Then it should fail with: - """ - UUUUUU - - 2 scenarios (2 undefined) - 6 steps (6 undefined) - - You can implement step definitions for undefined steps with these snippets: - - $steps->Given('/^I have magically created (\d+)\$$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - - $steps->When('/^I have chose "([^"]*)" in coffee machine$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - - $steps->Then('/^I should have "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - - Scenario: Pending steps - Given a file named "features/coffee.feature" with: - """ - Feature: Pending coffee machine actions - In order to make some long making drinks - As a coffee machine - I need to be able to make pending actions - - Background: - Given human have ordered very very very hot "coffee" - - Scenario: When the coffee ready - When the coffee will be ready - Then I should say "Take your cup!" - """ - And a file named "features/steps/coffee_steps.php" with: - """ - Given('/^human have ordered very very very hot "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - $steps->When('/^the coffee will be ready$/', function($world) { - throw new \Behat\Behat\Exception\PendingException('Handle "Coffee Ready" action'); - }); - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should pass with: - """ - P-U - - (::) pending steps (::) - - 01. TODO: write pending definition - In step `Given human have ordered very very very hot "coffee"'. # features/steps/coffee_steps.php:2 - From scenario background. # features/coffee.feature:6 - Of feature `Pending coffee machine actions'. # features/coffee.feature - - 1 scenario (1 undefined) - 3 steps (1 skipped, 1 pending, 1 undefined) - - You can implement step definitions for undefined steps with these snippets: - - $steps->Then('/^I should say "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - When I run "behat --no-ansi --strict -f progress features/coffee.feature" - Then it should fail with: - """ - P-U - - (::) pending steps (::) - - 01. TODO: write pending definition - In step `Given human have ordered very very very hot "coffee"'. # features/steps/coffee_steps.php:2 - From scenario background. # features/coffee.feature:6 - Of feature `Pending coffee machine actions'. # features/coffee.feature - - 1 scenario (1 undefined) - 3 steps (1 skipped, 1 pending, 1 undefined) - - You can implement step definitions for undefined steps with these snippets: - - $steps->Then('/^I should say "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - - Scenario: Failed steps - Given a file named "features/coffee.feature" with: - """ - Feature: Failed coffee machine actions - In order to know about coffee machine failures - As a coffee buyer - I need to be able to know about failed actions - - Background: - Given I have throwed 10$ into machine - - Scenario: Check throwed amount - Then I should see 12$ on the screen - - Scenario: Additional throws - Given I have throwed 20$ into machine - Then I should see 31$ on the screen - And I should see 33$ on the screen - """ - And a file named "features/steps/coffee_steps.php" with: - """ - Given('/^I have throwed (\d+)\$ into machine$/', function($world, $money) { - $world->money += $money; - }); - $steps->Then('/^I should see (\d+)\$ on the screen$/', function($world, $money) { - assertEquals($money, $world->money); - }); - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should fail with: - """ - .F..F- - - (::) failed steps (::) - - 01. Failed asserting that 10 matches expected '12'. - In step `Then I should see 12$ on the screen'. # features/steps/coffee_steps.php:5 - From scenario `Check throwed amount'. # features/coffee.feature:9 - Of feature `Failed coffee machine actions'. # features/coffee.feature - - 02. Failed asserting that 30 matches expected '31'. - In step `Then I should see 31$ on the screen'. # features/steps/coffee_steps.php:5 - From scenario `Additional throws'. # features/coffee.feature:12 - Of feature `Failed coffee machine actions'. # features/coffee.feature - - 2 scenarios (2 failed) - 6 steps (3 passed, 1 skipped, 2 failed) - """ - - Scenario: Skipped steps - Given a file named "features/coffee.feature" with: - """ - Feature: Skipped coffee machine actions - In order to tell clients about failures faster - As a coffee machine - I need to be able to skip unneeded steps - - Background: - Given human bought coffee - - Scenario: I have no water - Given I have no water - And I have electricity - When I boil water - Then the coffee should be almost done - - Scenario: I have no electricity - Given I have water - And I have no electricity - When I boil water - Then the coffee should be almost done - """ - And a file named "features/steps/coffee_steps.php" with: - """ - Given('/^human bought coffee$/', function($world) {}); - $steps->Given('/^I have no water$/', function($world) { - throw new Exception('NO water in coffee machine!!!'); - }); - $steps->And('/^I have electricity$/', function($world) {}); - $steps->When('/^I boil water$/', function($world) {}); - $steps->Then('/^the coffee should be almost done$/', function($world) {}); - $steps->Given('/^I have water$/', function($world) {}); - $steps->And('/^I have no electricity$/', function($world) { - throw new Exception('NO electricity in coffee machine!!!'); - }); - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should fail with: - """ - .F---..F-- - - (::) failed steps (::) - - 01. NO water in coffee machine!!! - In step `Given I have no water'. # features/steps/coffee_steps.php:3 - From scenario `I have no water'. # features/coffee.feature:9 - Of feature `Skipped coffee machine actions'. # features/coffee.feature - - 02. NO electricity in coffee machine!!! - In step `And I have no electricity'. # features/steps/coffee_steps.php:10 - From scenario `I have no electricity'. # features/coffee.feature:15 - Of feature `Skipped coffee machine actions'. # features/coffee.feature - - 2 scenarios (2 failed) - 10 steps (3 passed, 5 skipped, 2 failed) - """ - - Scenario: Ambigious steps - Given a file named "features/coffee.feature" with: - """ - Feature: Ambigious orders in coffee menu - In order to be able to chose concrete coffee type - As a coffee buyer - I need to be able to know about ambigious decisions - - Scenario: Ambigious coffee type - Given human have chosen "Latte" - Then I should make him "Latte" - """ - And a file named "features/steps/coffee_steps.php" with: - """ - Given('/^human have chosen "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - $steps->Given('/^human have chosen "Latte"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - $steps->Then('/^I should make him "([^"]*)"$/', function($world, $arg1) { - throw new \Behat\Behat\Exception\PendingException(); - }); - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should fail with: - """ - F- - - (::) failed steps (::) - - 01. Ambiguous match of "human have chosen "Latte"": - to `/^human have chosen "([^"]*)"$/` from features/steps/coffee_steps.php:2 - to `/^human have chosen "Latte"$/` from features/steps/coffee_steps.php:5 - In step `Given human have chosen "Latte"'. - From scenario `Ambigious coffee type'. # features/coffee.feature:6 - Of feature `Ambigious orders in coffee menu'. # features/coffee.feature - - 1 scenario (1 failed) - 2 steps (1 skipped, 1 failed) - """ - - Scenario: Redundant steps - Given a file named "features/coffee.feature" with: - """ - Feature: Redundant actions - In order to be able to know about errors in definitions as soon as possible - As a coffee machine mechanic - I need to be able to know about redundant menu definitions - - Scenario: Redundant menu - Given customer bought coffee - And customer bought another one coffee - """ - And a file named "features/steps/coffee_steps.php" with: - """ - Given('/^customer bought coffee$/', function($world) { - // do something - }); - $steps->Given('/^customer bought coffee$/', function($world) { - // do something else - }); - """ - When I run "behat --no-ansi -f progress features/coffee.feature" - Then it should fail - And the output should contain: - """ - Step "/^customer bought coffee$/" is already defined in - """ diff --git a/vendor/behat/behat/features/closures/steps_require_once.feature b/vendor/behat/behat/features/closures/steps_require_once.feature deleted file mode 100644 index 6d88479..0000000 --- a/vendor/behat/behat/features/closures/steps_require_once.feature +++ /dev/null @@ -1,116 +0,0 @@ -Feature: hooks - In order to migrate Behat testing process - As a tester - I need to be able to write hooks - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^I have entered (\d+)$/', function($world, $arg1) { - $world->number = $arg1; - }); - """ - And a file named "features/steps/step2.php" with: - """ - Then('/^I must have (\d+)$/', function($world, $arg1) { - assertEquals($world->number, $arg1); - }); - """ - - Scenario: - Given a file named "features/test.feature" with: - """ - Feature: - Scenario: - Then I must have 50 - - Scenario: - Given I have entered 12 - Then I must have 12 - - Scenario: - Given I have entered 1 - Then I must have 1 - """ - When I run "behat --no-ansi -f pretty" - Then it should pass with: - """ - Feature: - - Scenario: # features/test.feature:2 - Then I must have 50 # features/steps/step2.php:4 - - Scenario: # features/test.feature:5 - Given I have entered 12 # features/steps/step1.php:3 - Then I must have 12 # features/steps/step2.php:4 - - Scenario: # features/test.feature:9 - Given I have entered 1 # features/steps/step1.php:3 - Then I must have 1 # features/steps/step2.php:4 - - 3 scenarios (3 passed) - 5 steps (5 passed) - """ diff --git a/vendor/behat/behat/features/closures/tags.feature b/vendor/behat/behat/features/closures/tags.feature deleted file mode 100644 index 36304c4..0000000 --- a/vendor/behat/behat/features/closures/tags.feature +++ /dev/null @@ -1,370 +0,0 @@ -Feature: Tags - In order to run only needed features - As a Behat user - I need to Behat support features & scenario/outline tags - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - Given('/^Some slow step N(\d+)$/', function($world, $num) {}); - $steps->Given('/^Some normal step N(\d+)$/', function($world, $num) {}); - $steps->Given('/^Some fast step N(\d+)$/', function($world, $num) {}); - """ - And a file named "features/feature1.feature" with: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - Scenario: - Given Some slow step N12 - And Some normal step N13 - - @fast - Scenario: - Given Some fast step N14 - """ - And a file named "features/feature2.feature" with: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - - @fast - Scenario: - Given Some fast step N24 - And Some fast step N25 - """ - And a file named "features/feature3.feature" with: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @slow - Scenario Outline: - Given Some slow step N - - Examples: - | num | - | 31 | - | 32 | - - @normal - Scenario: - Given Some normal step N38 - - @fast - Scenario Outline: - Given Some fast step N - - Examples: - | num | - | 33 | - | 34 | - - @normal @fast - Scenario Outline: - Given Some normal step N - And Some fast step N37 - - Examples: - | num | - | 35 | - | 36 | - """ - And a file named "features/feature4.feature" with: - """ - Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - - @fast - Scenario: - Given Some slow step N43 - """ - - Scenario: Single tag - When I run "behat --no-ansi -f pretty --tags '@slow' --no-paths" - Then it should pass - And the output should contain: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - Scenario: - Given Some slow step N12 - And Some normal step N13 - - @fast - Scenario: - Given Some fast step N14 - """ - And the output should contain: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - """ - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @slow - Scenario Outline: - Given Some slow step N - - Examples: - | num | - | 31 | - | 32 | - """ - And the output should contain: - """ - 5 scenarios (5 passed) - 12 steps (12 passed) - """ - - Scenario: Or tags - When I run "behat --no-ansi -f pretty --tags '@slow,@normal' --no-paths" - Then it should pass - And the output should contain: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - Scenario: - Given Some slow step N12 - And Some normal step N13 - - @fast - Scenario: - Given Some fast step N14 - """ - And the output should contain: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - """ - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @slow - Scenario Outline: - Given Some slow step N - - Examples: - | num | - | 31 | - | 32 | - - @normal - Scenario: - Given Some normal step N38 - - @normal @fast - Scenario Outline: - Given Some normal step N - And Some fast step N37 - - Examples: - | num | - | 35 | - | 36 | - """ - And the output should contain: - """ - Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - """ - And the output should contain: - """ - 9 scenarios (9 passed) - 22 steps (22 passed) - """ - - Scenario: And tags - When I run "behat --no-ansi -f pretty --tags '@slow,@normal&&@fast' --no-paths" - Then it should pass - And the output should contain: - """ - @slow - Feature: Feature N1 - - Background: - Given Some slow step N11 - - @fast - Scenario: - Given Some fast step N14 - """ - And the output should contain: - """ - Feature: Feature N2 - - Background: - Given Some normal step N21 - - @slow @fast - Scenario: - Given Some slow step N22 - And Some fast step N23 - """ - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @normal @fast - Scenario Outline: - Given Some normal step N - And Some fast step N37 - - Examples: - | num | - | 35 | - | 36 | - """ - And the output should contain: - """ - 4 scenarios (4 passed) - 11 steps (11 passed) - """ - - Scenario: Not tags - When I run "behat --no-ansi -f pretty --tags '~@slow&&~@fast' --no-paths" - Then it should pass - And the output should contain: - """ - Feature: Feature N3 - - Background: - Given Some normal step N21 - - @normal - Scenario: - Given Some normal step N38 - """ - And the output should contain: - """ - Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - """ - And the output should contain: - """ - 2 scenarios (2 passed) - 4 steps (4 passed) - """ diff --git a/vendor/behat/behat/features/closures/transformations.feature b/vendor/behat/behat/features/closures/transformations.feature deleted file mode 100644 index 65f7c90..0000000 --- a/vendor/behat/behat/features/closures/transformations.feature +++ /dev/null @@ -1,165 +0,0 @@ -Feature: Step Arguments Transformations - In order to follow DRY - As a feature writer - I need to be able to move common - arguments transformations - into transformation functions - - Background: - Given a file named "features/bootstrap/FeatureContext.php" with: - """ - parameters = $parameters; - - if (file_exists(__DIR__ . '/../support/env.php')) { - $world = $this; - require(__DIR__ . '/../support/env.php'); - } - } - - public function getStepDefinitionResources() { - if (file_exists(__DIR__ . '/../steps')) { - $finder = new Finder(); - return $finder->files()->name('*.php')->in(__DIR__ . '/../steps'); - } - return array(); - } - - public function getHookDefinitionResources() { - if (file_exists(__DIR__ . '/../support/hooks.php')) { - return array(__DIR__ . '/../support/hooks.php'); - } - return array(); - } - - public function __call($name, array $args) { - if (isset($this->$name) && is_callable($this->$name)) { - return call_user_func_array($this->$name, $args); - } else { - $trace = debug_backtrace(); - trigger_error( - 'Call to undefined method ' . get_class($this) . '::' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_ERROR - ); - } - } - } - """ - And a file named "features/support/bootstrap.php" with: - """ - username = $username; $this->age = $age; } - public function getUsername() { return $this->username; } - public function getAge() { return $this->age; } - } - - $steps->Transform('/"([^"]+)" user/', function($username) { - return new User($username); - }); - - $steps->Transform('/^table:username,age$/', function($table) { - $hash = $table->getHash(); - $username = $hash[0]['username']; - $age = $hash[0]['age']; - - return new User($username, $age); - }); - - $steps->Given('/I am ("\w+" user)/', function($world, $user) { - assertInstanceOf('User', $user); - $world->user = $user; - }); - - $steps->Given('/I am user:/', function($world, $user) { - $world->user = $user; - }); - - $steps->Then('/Username must be "([^"]+)"/', function($world, $username) { - assertEquals($username, $world->user->getUsername()); - }); - - $steps->Then('/Age must be (\d+)/', function($world, $age) { - assertEquals($age, $world->user->getAge()); - }); - """ - - Scenario: Simple Arguments Transformations - Given a file named "features/step_arguments.feature" with: - """ - Feature: Step Arguments - Scenario: - Given I am "everzet" user - Then Username must be "everzet" - And Age must be 20 - - Scenario: - Given I am "antono" user - Then Username must be "antono" - And Age must be 20 - """ - When I run "behat --no-ansi -f progress" - Then it should pass with: - """ - ...... - - 2 scenarios (2 passed) - 6 steps (6 passed) - """ - - Scenario: Table Arguments Transformations - Given a file named "features/table_arguments.feature" with: - """ - Feature: Step Arguments - Scenario: - Given I am user: - | username | age | - | ever.zet | 22 | - Then Username must be "ever.zet" - And Age must be 22 - - Scenario: - Given I am user: - | username | age | - | vasiljev | 30 | - Then Username must be "vasiljev" - And Age must be 30 - """ - When I run "behat --no-ansi -f progress" - Then it should pass with: - """ - ...... - - 2 scenarios (2 passed) - 6 steps (6 passed) - """ - diff --git a/vendor/behat/behat/i18n.php b/vendor/behat/behat/i18n.php deleted file mode 100644 index 6c2885f..0000000 --- a/vendor/behat/behat/i18n.php +++ /dev/null @@ -1,171 +0,0 @@ - - array ( - 'proposal_title' => 'You can implement step definitions for undefined steps with these snippets:', - 'failed_steps_title' => 'failed steps', - 'pending_steps_title' => 'pending steps', - 'scenarios_count' => '{0} No scenarios|{1} 1 scenario|]1,Inf] %1% scenarios', - 'steps_count' => '{0} No steps|{1} 1 step|]1,Inf] %1% steps', - 'passed_count' => '[1,Inf] %1% passed', - 'failed_count' => '[1,Inf] %1% failed', - 'pending_count' => '[1,Inf] %1% pending', - 'undefined_count' => '[1,Inf] %1% undefined', - 'skipped_count' => '[1,Inf] %1% skipped', - ), - 'cs' => - array ( - 'proposal_title' => 'Můžete implementovat definice kroku pro nedefinované kroky za použití těchto kusů kódu (snippetů):', - 'failed_steps_title' => 'zkažené kroky', - 'pending_steps_title' => 'čekající kroky', - 'scenarios_count' => '{0} Žádný scénář|{1} 1 scénář|{2,3,4} %1% scénáře|]4,Inf] %1% scénářů', - 'steps_count' => '{0} Žádné kroky|{1} 1 krok|{2,3,4} %1% kroky|]4,Inf] %1% kroků', - 'passed_count' => '{1} %1% prošel|{2,3,4} %1% prošly|]4,Inf] %1% prošlo', - 'failed_count' => '{1} %1% selhal|{2,3,4} %1% selhaly|]4,Inf] %1% selhalo', - 'pending_count' => '{1} %1% čeká|{2,3,4} %1% čekají|]4,Inf] %1% čeká', - 'undefined_count' => '{1} %1% nedefinován|{2,3,4} %1% nedefinovány|]4,Inf] %1% nedefinováno', - 'skipped_count' => '{1} %1% přeskočen|{2,3,4} %1% přeskočeny|]4,Inf] %1% přeskočeno', - ), - 'de' => - array ( - 'proposal_title' => 'Neue Anweisungen für undefinierte Schritte können mit diesen Code-Schnipseln angelegt werden:', - 'failed_steps_title' => 'fehlgeschlagene Schritte', - 'pending_steps_title' => 'ausbleibende Schritte', - 'scenarios_count' => '{0} Keine Szenarien|{1} 1 Szenario|]1,Inf] %1% Szenarien', - 'steps_count' => '{0} Keine Schritte|{1} 1 Schritt|]1,Inf] %1% Schritte', - 'passed_count' => '[1,Inf] %1% bestanden', - 'failed_count' => '[1,Inf] %1% fehlgeschlagen', - 'pending_count' => '[1,Inf] %1% ausbleibend', - 'undefined_count' => '[1,Inf] %1% undefiniert', - 'skipped_count' => '[1,Inf] %1% übersprungen', - ), - 'es' => - array ( - 'proposal_title' => 'Puedes implementar la definición de pasos de los pasos sin definir con el siguiente código:', - 'failed_steps_title' => 'Pasos fallidos', - 'pending_steps_title' => 'Pasos pendientes', - 'scenarios_count' => '{0} No hay escenarios|{1} 1 escenario|]1,Inf] %1% escenarios', - 'steps_count' => '{0} No hay pasos|{1} 1 paso|]1,Inf] %1% pasos', - 'passed_count' => '[1,Inf] %1% exitosos', - 'failed_count' => '[1,Inf] %1% fallidos', - 'pending_count' => '[1,Inf] %1% pendientes', - 'undefined_count' => '[1,Inf] %1% sin definir', - 'skipped_count' => '[1,Inf] %1% omitidos', - ), - 'fr' => - array ( - 'proposal_title' => 'Vous pouvez implémenter les définitions d\'étapes pour les étapes non définies avec ces modèles :', - 'failed_steps_title' => 'étapes échouées', - 'pending_steps_title' => 'étapes en attente', - 'scenarios_count' => '{0} Aucun scénario|{1} 1 scénario|]1,Inf] %1% scénarios', - 'steps_count' => '{0} Aucune étape|{1} 1 étape|]1,Inf] %1% étapes', - 'passed_count' => '[1,Inf] %1% succès', - 'failed_count' => '[1,Inf] %1% échecs', - 'pending_count' => '[1,Inf] %1% en attente', - 'undefined_count' => '[1,Inf] %1% non définies', - 'skipped_count' => '[1,Inf] %1% ignorées', - ), - 'id' => - array ( - 'proposal_title' => 'Anda dapat membuat definisi untuk langkah yang tidak terdefinisikan menggunakan potongan kode ini:', - 'failed_steps_title' => 'langkah gagal', - 'pending_steps_title' => 'langkah ditunda', - 'scenarios_count' => '{0} Tidak ada skenario|{1} 1 skenario|]1,Inf] %1% skenario', - 'steps_count' => '{0} Tidak ada langkah|{1} 1 langkah|]1,Inf] %1% langkah', - 'passed_count' => '[1,Inf] %1% sukses', - 'failed_count' => '[1,Inf] %1% gagal', - 'pending_count' => '[1,Inf] %1% ditunda', - 'undefined_count' => '[1,Inf] %1% tidak terdefinisikan', - 'skipped_count' => '[1,Inf] %1% dilewat', - ), - 'it' => - array ( - 'proposal_title' => 'E\' possibile implementare gli step ancora non definiti con queste parti di codice:', - 'failed_steps_title' => 'step falliti', - 'pending_steps_title' => 'step pendenti', - 'scenarios_count' => '{0} Nessuno scenario|{1} 1 scenario|]1,Inf] %1% scenari', - 'steps_count' => '{0} Nessuno step|{1} 1 step|]1,Inf] %1% step', - 'passed_count' => '[1,Inf] %1% passato', - 'failed_count' => '[1,Inf] %1% fallito', - 'pending_count' => '[1,Inf] %1% in attesa', - 'undefined_count' => '[1,Inf] %1% non definito', - 'skipped_count' => '[1,Inf] %1% saltato', - ), - 'ja' => - array ( - 'proposal_title' => '未定義のステップを、次のスニペットで実装できます:', - 'failed_steps_title' => '失敗したステップ', - 'pending_steps_title' => 'ペンディング中のステップ', - 'scenarios_count' => '{0} シナリオがありません|{1} 1 個のシナリオ|]1,Inf] %1% 個のシナリオ', - 'steps_count' => '{0} ステップがありません|{1} 1 個のステップ|]1,Inf] %1% 個のステップ', - 'passed_count' => '[1,Inf] %1% 個成功', - 'failed_count' => '[1,Inf] %1% 個失敗', - 'pending_count' => '[1,Inf] %1% 個ペンディング', - 'undefined_count' => '[1,Inf] %1% 個未定義', - 'skipped_count' => '[1,Inf] %1% 個スキップ', - ), - 'nl' => - array ( - 'proposal_title' => 'U kunt stap definities voor ongedefinieerde stappen implementeren met deze snippets:', - 'failed_steps_title' => 'mislukte stappen', - 'pending_steps_title' => 'wachtende stappen', - 'scenarios_count' => '{0} Geen scenario\'s|{1} 1 scenario|]1,Inf] %1% scenario\'s', - 'steps_count' => '{0} Geen stappen|{1} 1 stap|]1,Inf] %1% stappen', - 'passed_count' => '[1,Inf] %1% gelukt', - 'failed_count' => '[1,Inf] %1% mislukt', - 'pending_count' => '[1,Inf] %1% wachtend', - 'undefined_count' => '[1,Inf] %1% ongedefinieerd', - 'skipped_count' => '[1,Inf] %1% overgeslagen', - ), - 'pl' => - array ( - 'proposal_title' => 'Możesz zaimplementować niezdefiniowane jeszcze kroki, korzystając z tych fragmentów kodu:', - 'failed_steps_title' => 'nieudane kroki', - 'pending_steps_title' => 'oczekujące kroki', - 'scenarios_count' => '{0} Brak scenariuszy|{1} 1 scenariusz|{2,3,4,22,23,24,32,33,34,42,43,44} %1% scenariusze|]4,Inf] %1% scenariuszy', - 'steps_count' => '{0} Brak kroków|{1} 1 krok|{2,3,4,22,23,24,32,33,34,42,43,44} %1% kroki|]4,Inf] %1% kroków', - 'passed_count' => '{1} %1% udany|{2,3,4,22,23,24,32,33,34,42,43,44} %1% udane|]4,Inf] %1% udanych', - 'failed_count' => '{1} %1% nieudany|{2,3,4,22,23,24,32,33,34,42,43,44} %1% nieudane|]4,Inf] %1% nieudanych', - 'pending_count' => '{1} %1% oczekujący|{2,3,4,22,23,24,32,33,34,42,43,44} %1% oczekujące|]4,Inf] %1% oczekujących', - 'undefined_count' => '{1} %1% niezdefiniowany|{2,3,4,22,23,24,32,33,34,42,43,44} %1% niezdefiniowane|]4,Inf] %1% niezdefiniowanych', - 'skipped_count' => '{1} %1% pominięty|{2,3,4,22,23,24,32,33,34,42,43,44} %1% pominięte|]4,Inf] %1% pominiętych', - ), - 'pt' => - array ( - 'proposal_title' => 'Você pode implementar definições de passos para aqueles ainda não definidos utilizando-se destes trechos:', - 'failed_steps_title' => 'passos que falharam', - 'pending_steps_title' => 'passos pendentes', - 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %1% cenários', - 'steps_count' => '{0} Nenhum passo|{1} 1 passo|]1,Inf] %1% passos', - 'passed_count' => '{1} passou|]1,Inf] %1% passaram', - 'failed_count' => '{1} falhou|]1,Inf] %1% falharam ', - 'pending_count' => '{1} pendente|]1,Inf] %1% pendentes', - 'undefined_count' => '{1} indefinido|]1,Inf] %1% indefinidos', - 'skipped_count' => '{1} ignorado|]1,Inf] %1% ignorados', - ), - 'ru' => - array ( - 'proposal_title' => 'Вы можете реализовать определения для новых шагов с помощью этих шаблонов:', - 'failed_steps_title' => 'проваленные шаги', - 'pending_steps_title' => 'шаги в ожидании', - 'scenarios_count' => '{0} Нет сценариев|{1,21,31} %1% сценарий|{2,3,4,22,23,24} %1% сценария|]4,Inf] %1% сценариев', - 'steps_count' => '{0} Нет шагов|{1,21,31} %1% шаг|{2,3,4,22,23,24} %1% шага|]4,Inf] %1% шагов', - 'passed_count' => '{1,21,31} %1% пройден|]1,Inf] %1% пройдено', - 'failed_count' => '{1,21,31} %1% провален|]1,Inf] %1% провалено', - 'pending_count' => '[1,Inf] %1% в ожидании', - 'undefined_count' => '{1,21,31} %1% не определен|]1,Inf] %1% не определено', - 'skipped_count' => '{1,21,31} %1% пропущен|]1,Inf] %1% пропущено', - ), - 'zh-CN' => - array ( - 'proposal_title' => '你可以通过以下代码片段对未定义的步骤实现步骤定义:', - 'failed_steps_title' => '未通过的步骤', - 'pending_steps_title' => '待定的步骤', - 'scenarios_count' => '{0} 没有场景|{1} 1 个场景|]1,Inf] %1% 个场景', - 'steps_count' => '{0} 没有步骤|{1} 1 个步骤|]1,Inf] %1% 个步骤', - 'passed_count' => '[1,Inf] %1% 已通过', - 'failed_count' => '[1,Inf] %1% 未通过', - 'pending_count' => '[1,Inf] %1% 待定的', - 'undefined_count' => '[1,Inf] %1% 未定义', - 'skipped_count' => '[1,Inf] %1% 跳过的', - ), -); diff --git a/vendor/behat/behat/phpdoc.ini.dist b/vendor/behat/behat/phpdoc.ini.dist deleted file mode 100644 index 63ed791..0000000 --- a/vendor/behat/behat/phpdoc.ini.dist +++ /dev/null @@ -1,125 +0,0 @@ -; Default configuration file for PHPDoctor - -; This config file will cause PHPDoctor to generate API documentation of -; itself. - - -; PHPDoctor settings -; ----------------------------------------------------------------------------- - -; Names of files to parse. This can be a single filename, or a comma separated -; list of filenames. Wildcards are allowed. - -files = "*.php" - -; Names of files or directories to ignore. This can be a single filename, or a -; comma separated list of filenames. Wildcards are NOT allowed. - -ignore = "CVS, .svn, .git, _compiled" - -; The directory to look for files in, if not used the PHPDoctor will look in -; the current directory (the directory it is run from). - -source_path = "./src" - -; If you do not want PHPDoctor to look in each sub directory for files -; uncomment this line. - -;subdirs = off - -; Set how loud PHPDoctor is as it runs. Quiet mode suppresses all output other -; than warnings and errors. Verbose mode outputs additional messages during -; execution. - -;quiet = on -;verbose = on - -; Select the doclet to use for generating output. - -doclet = standard -;doclet = debug - -; The directory to find the doclet in. Doclets are expected to be in a -; directory named after themselves at the location given. - -;doclet_path = ./doclets - -; The directory to find taglets in. Taglets allow you to make PHPDoctor handle -; new tags and to alter the behavour of existing tags and their output. - -;taglet_path = ./taglets - -; If the code you are parsing does not use package tags or not all elements -; have package tags, use this setting to place unbound elements into a -; particular package. - -default_package = "Behat" - -; Specifies the name of a HTML file containing text for the overview -; documentation to be placed on the overview page. The path is relative to -; "source_path" unless an absolute path is given. - -overview = readme.html - -; Package comments will be looked for in a file named package.html in the same -; directory as the first source file parsed in that package or in the directory -; given below. If package comments are placed in the directory given below then -; they should be named ".html". - -package_comment_dir = ./ - -; Parse out global variables and/or global constants? - -;globals = off -;constants = off - -; Generate documentation for all class members - -;private = on - -; Generate documentation for public and protected class members - -;protected = on - -; Generate documentation for only public class members - -public = on - -; Use the PEAR compatible handling of the docblock first sentence - -;pear_compat = on - -; Standard doclet settings -; ----------------------------------------------------------------------------- - -; The directory to place generated documentation in. If the given path is -; relative to it will be relative to "source_path". - -d = "api" - -; Specifies the title to be placed in the HTML tag. - -windowtitle = "Behat" - -; Specifies the title to be placed near the top of the overview summary file. - -doctitle = "Behat: The BDD framework for PHP" - -; Specifies the header text to be placed at the top of each output file. The -; header will be placed to the right of the upper navigation bar. - -header = "Behat" - -; Specifies the footer text to be placed at the bottom of each output file. The -; footer will be placed to the right of the lower navigation bar. - -footer = "Behat" - -; Specifies the text to be placed at the bottom of each output file. The text -; will be placed at the bottom of the page, below the lower navigation bar. - -;bottom = "This document was generated by <a href="http://phpdoctor.sourceforge.net/">PHPDoctor: The PHP Documentation Creator</a>" - -; Create a class tree? - -tree = on diff --git a/vendor/behat/behat/src/Behat/Behat/Annotation/Annotation.php b/vendor/behat/behat/src/Behat/Behat/Annotation/Annotation.php deleted file mode 100644 index 9c078f3..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Annotation/Annotation.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -namespace Behat\Behat\Annotation; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Context\SubcontextableContextInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat annotation class. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Annotation implements AnnotationInterface -{ - private $closure; - private $callback; - private $path; - private $description; - - /** - * Constructs annotation. - * - * @param callback $callback - * - * @throws \InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException(sprintf( - 'Annotation callback should be a valid callable, but %s given', - gettype($callback) - )); - } - $this->closure = !is_array($callback); - - if (!$this->isClosure()) { - $this->path = $callback[0] . '::' . $callback[1] . '()'; - } else { - $reflection = new \ReflectionFunction($callback); - $this->path = $reflection->getFileName() . ':' . $reflection->getStartLine(); - } - - $this->callback = $callback; - } - - /** - * Sets annotation description. - * - * @param string $description - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Returns description. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Returns path string for callback. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Checks whether callback is closure. - * - * @return Boolean - */ - public function isClosure() - { - return $this->closure; - } - - /** - * Returns callback. - * - * @return callback - */ - public function getCallback() - { - return $this->callback; - } - - /** - * Returns callback, mapped to specific context (or it's subcontext) instance. - * - * @param ContextInterface $context - * - * @return callback - * - * @throws \RuntimeException - */ - public function getCallbackForContext(ContextInterface $context) - { - $callback = $this->getCallback(); - - if (!$this->isClosure()) { - if ($callback[0] === get_class($context)) { - $callback = array($context, $callback[1]); - } elseif ($context instanceof SubcontextableContextInterface) { - $subcontext = $context->getSubcontextByClassName($callback[0]); - - if (null === $subcontext) { - throw new \RuntimeException(sprintf( - '"%s" subcontext instance not found in context "%s".'."\n". - 'Looks like something is wrong with getSubcontextByClassName() method in one of your contexts', - $callback[0], get_class($context) - )); - } - - $reflection = new \ReflectionClass($subcontext); - if (!$reflection->hasMethod($callback[1])) { - throw new \RuntimeException(sprintf( - 'Subcontext "%s" does not have "%s()" method.'."\n". - 'Looks like something is wrong with getSubcontextByClassName() method in one of your contexts', - get_class($subcontext), $callback[1] - )); - } - - $callback = array($subcontext, $callback[1]); - } - } - - return $callback; - } - - /** - * Returns callback reflection. - * - * @return \ReflectionFunction - */ - public function getCallbackReflection() - { - if (!$this->isClosure()) { - return new \ReflectionMethod($this->callback[0], $this->callback[1]); - } else { - return new \ReflectionFunction($this->callback); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Annotation/AnnotationInterface.php b/vendor/behat/behat/src/Behat/Behat/Annotation/AnnotationInterface.php deleted file mode 100644 index 7f3c315..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Annotation/AnnotationInterface.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Behat\Behat\Annotation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat annotation interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface AnnotationInterface -{ - /** - * Returns path string for callback. - * - * @return string - */ - public function getPath(); - - /** - * Checks whether callback is closure. - * - * @return Boolean - */ - public function isClosure(); - - /** - * Returns callback. - * - * @return callback - */ - public function getCallback(); - - /** - * Returns callback reflection. - * - * @return \ReflectionFunction - */ - public function getCallbackReflection(); -} diff --git a/vendor/behat/behat/src/Behat/Behat/ClassLoader/MapFileClassLoader.php b/vendor/behat/behat/src/Behat/Behat/ClassLoader/MapFileClassLoader.php deleted file mode 100644 index e074a08..0000000 --- a/vendor/behat/behat/src/Behat/Behat/ClassLoader/MapFileClassLoader.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Behat\Behat\ClassLoader; - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A class loader that uses a mapping file to look up paths. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class MapFileClassLoader -{ - private $map = array(); - - /** - * Constructor. - * - * @param string $file Path to class mapping file - */ - public function __construct($file) - { - $this->map = require $file; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - */ - public function loadClass($class) - { - if ('\\' === $class[0]) { - $class = substr($class, 1); - } - - if (isset($this->map[$class])) { - require $this->map[$class]; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if ('\\' === $class[0]) { - $class = substr($class, 1); - } - - if (isset($this->map[$class])) { - return $this->map[$class]; - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Compiler/PearCompiler.php b/vendor/behat/behat/src/Behat/Behat/Compiler/PearCompiler.php deleted file mode 100644 index 8d4c8af..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Compiler/PearCompiler.php +++ /dev/null @@ -1,257 +0,0 @@ -<?php - -namespace Behat\Behat\Compiler; - -use Symfony\Component\Finder\Finder; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pear package compiler. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class PearCompiler -{ - /** - * Behat lib directory. - * - * @var string - */ - private $libPath; - - /** - * Initializes compiler. - */ - public function __construct() - { - $this->libPath = realpath(__DIR__ . '/../../../../'); - } - - /** - * Compiles pear package. - * - * @param string $version - */ - public function compile($version, $stability) - { - if (file_exists('package.xml')) { - unlink('package.xml'); - } - file_put_contents('package.xml', $this->getPackageTemplate()); - - $finder = new Finder(); - $finder->files() - ->ignoreVCS(true) - ->name('*.php') - ->name('*.xsd') - ->name('*.xml') - ->name('LICENSE') - ->notName('PharCompiler.php') - ->notName('PearCompiler.php') - ->in($this->libPath . '/src'); - - $xmlSourceFiles = ''; - foreach ($finder as $file) { - $path = str_replace($this->libPath . '/', '', $file->getRealPath()); - $xmlSourceFiles .= - '<file role="php" baseinstalldir="behat" install-as="'.$path.'" name="'.$path.'" />'."\n"; - } - - $this->replaceTokens('package.xml', '##', '##', array( - 'BEHAT_VERSION' => $version, - 'CURRENT_DATE' => date('Y-m-d'), - 'SOURCE_FILES' => $xmlSourceFiles, - 'STABILITY' => $stability - )); - - system('pear package'); - unlink('package.xml'); - } - - /** - * Replaces tokens in specified path. - * - * @param string|array $files files array or single file - * @param string $tokenStart token start symbol - * @param string $tokenFinish token finish symbol - * @param array $tokens replace tokens array - */ - protected function replaceTokens($files, $tokenStart, $tokenFinish, array $tokens) - { - if (!is_array($files)) { - $files = array($files); - } - - foreach ($files as $file) { - $content = file_get_contents($file); - foreach ($tokens as $key => $value) { - $content = str_replace($tokenStart . $key . $tokenFinish, $value, $content, $count); - } - file_put_contents($file, $content); - } - } - - /** - * Returns pear package template. - * - * @return string - */ - protected function getPackageTemplate() - { - return <<<'EOF' -<?xml version="1.0" encoding="UTF-8"?> -<package packagerversion="1.8.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 - http://pear.php.net/dtd/tasks-1.0.xsd - http://pear.php.net/dtd/package-2.0 - http://pear.php.net/dtd/package-2.0.xsd"> - <name>behat</name> - <channel>pear.behat.org</channel> - <summary>Behat is BDD framework for PHP</summary> - <description> - Behat is an open source behavior driven development framework for php 5.3. - </description> - <lead> - <name>Konstantin Kudryashov</name> - <user>everzet</user> - <email>ever.zet@gmail.com</email> - <active>yes</active> - </lead> - <date>##CURRENT_DATE##</date> - <version> - <release>##BEHAT_VERSION##</release> - <api>2.0.0</api> - </version> - <stability> - <release>##STABILITY##</release> - <api>##STABILITY##</api> - </stability> - <license uri="http://www.opensource.org/licenses/mit-license.php">MIT</license> - <notes>-</notes> - <contents> - <dir name="/"> - ##SOURCE_FILES## - - <file role="script" baseinstalldir="/" name="bin/behat"> - <tasks:replace from="/usr/bin/env php" to="php_bin" type="pear-config" /> - <tasks:replace from="DEV" to="version" type="package-info" /> - </file> - <file role="script" baseinstalldir="/" name="bin/behat.bat"> - <tasks:replace from="@php_bin@" to="php_bin" type="pear-config" /> - <tasks:replace from="@bin_dir@" to="bin_dir" type="pear-config" /> - </file> - - <file role="php" baseinstalldir="behat" name="i18n.php" /> - <file role="php" baseinstalldir="behat" name="autoload.php" /> - <file role="php" baseinstalldir="behat" name="autoload_map.php" /> - <file role="php" baseinstalldir="behat" name="behat.yml" /> - <file role="php" baseinstalldir="behat" name="CHANGES.md" /> - <file role="php" baseinstalldir="behat" name="README.md" /> - <file role="php" baseinstalldir="behat" name="LICENSE" /> - </dir> - </contents> - <dependencies> - <required> - <php> - <min>5.3.1</min> - </php> - <pearinstaller> - <min>1.4.0</min> - </pearinstaller> - <package> - <name>gherkin</name> - <channel>pear.behat.org</channel> - <min>2.2.1</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>Config</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>Console</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>DependencyInjection</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>EventDispatcher</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>Finder</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>Translation</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <package> - <name>Yaml</name> - <channel>pear.symfony.com</channel> - <min>2.0.0</min> - <max>2.3.0</max> - <exclude>2.3.0</exclude> - </package> - <extension> - <name>pcre</name> - </extension> - <extension> - <name>simplexml</name> - </extension> - <extension> - <name>xml</name> - </extension> - <extension> - <name>mbstring</name> - </extension> - </required> - </dependencies> - <phprelease> - <installconditions> - <os> - <name>windows</name> - </os> - </installconditions> - <filelist> - <install as="behat" name="bin/behat" /> - <install as="behat.bat" name="bin/behat.bat" /> - </filelist> - </phprelease> - <phprelease> - <filelist> - <install as="behat" name="bin/behat" /> - <ignore name="bin/behat.bat" /> - </filelist> - </phprelease> -</package> -EOF; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Compiler/PearMapFileCompiler.php b/vendor/behat/behat/src/Behat/Behat/Compiler/PearMapFileCompiler.php deleted file mode 100644 index 2855f6e..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Compiler/PearMapFileCompiler.php +++ /dev/null @@ -1,156 +0,0 @@ -<?php - -namespace Behat\Behat\Compiler; - -use Symfony\Component\Finder\Finder; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Class loader map file compiler. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class PearMapFileCompiler -{ - /** - * Behat lib directory. - * - * @var string - */ - private $libPath; - - /** - * Initializes compiler. - */ - public function __construct() - { - $this->libPath = realpath(__DIR__ . '/../../../../'); - } - - /** - * Compiles map file and autoloader. - * - * @param string $version - */ - public function compile($autoloaderFilename = 'autoload.php', $mapFilename = 'autoload_map.php') - { - if (file_exists($mapFilename)) { - unlink($mapFilename); - } - $mappings = ''; - - $mappings .= $this->generateMappingFor( - $this->libPath.'/src', - "__DIR__ . '/src/'" - ); - $mappings .= $this->generateMappingFor( - $this->libPath.'/vendor/behat/gherkin/src', - "'gherkin/src/'" - ); - - $mappings .= "\nif (!defined('BEHAT_AUTOLOAD_SF2') || true === BEHAT_AUTOLOAD_SF2) {\n"; - $mappings .= $this->generateMappingFor( - array( - $this->libPath.'/vendor/symfony/config', - $this->libPath.'/vendor/symfony/console', - $this->libPath.'/vendor/symfony/dependency-injection', - $this->libPath.'/vendor/symfony/event-dispatcher', - $this->libPath.'/vendor/symfony/finder', - $this->libPath.'/vendor/symfony/translation', - $this->libPath.'/vendor/symfony/yaml', - ) - ); - $mappings .= "}\n"; - - $mapContent = <<<MAP_FILE -<?php -\$mappings = array(); -$mappings -return \$mappings; -MAP_FILE; - - file_put_contents($mapFilename, $mapContent); - file_put_contents($autoloaderFilename, $this->getAutoloadScript($mapFilename)); - } - - /** - * Generates mapping for specific path(s). - * - * @param mixed $paths single path or array of paths - * @param string|null $prefixCode path prefix code - * - * @return strings - */ - protected function generateMappingFor($paths, $prefixCode = null) - { - $mappings = ''; - - foreach ((array) $paths as $path) { - $trim = $path.'/'; - foreach ($this->findPhpFile()->in($path) as $file) { - $path = str_replace($trim, '', $file->getRealPath()); - $class = str_replace(array('/', '.php'), array('\\', ''), $path); - - if (null !== $prefixCode) { - $mappings .= "\$mappings['{$class}'] = {$prefixCode} . '{$path}';\n"; - } else { - $mappings .= "\$mappings['{$class}'] = '{$path}';\n"; - } - } - } - - return $mappings; - } - - /** - * Returns autoload.php content. - * - * @param string $mapFilename - * - * @return string - */ - protected function getAutoloadScript($mapFilename) - { - return sprintf(<<<'EOF' -<?php - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!class_exists('Behat\Behat\ClassLoader\MapFileClassLoader')) { - require_once __DIR__ . '/src/Behat/Behat/ClassLoader/MapFileClassLoader.php'; -} - -use Behat\Behat\ClassLoader\MapFileClassLoader; - -$loader = new MapFileClassLoader(__DIR__ . '/%s'); -$loader->register(); - -EOF - , $mapFilename); - } - - /** - * Creates finder instance to search php files. - * - * @return Symfony\Component\Finder\Finder - */ - private function findPhpFile() - { - $finder = new Finder(); - - return $finder->files()->ignoreVCS(true)->name('*.php'); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Compiler/PharCompiler.php b/vendor/behat/behat/src/Behat/Behat/Compiler/PharCompiler.php deleted file mode 100644 index ead7bd5..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Compiler/PharCompiler.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php - -namespace Behat\Behat\Compiler; - -use Symfony\Component\Finder\Finder; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * behat.phar package compiler. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class PharCompiler -{ - /** - * Behat lib directory. - * - * @var string - */ - private $libPath; - - /** - * Initializes compiler. - */ - public function __construct() - { - $this->libPath = realpath(__DIR__ . '/../../../../'); - } - - /** - * Compiles phar archive. - * - * @param string $version - */ - public function compile($version) - { - if (file_exists($package = "behat-$version.phar")) { - unlink($package); - } - - // create phar - $phar = new \Phar($package, 0, 'behat.phar'); - $phar->setSignatureAlgorithm(\Phar::SHA1); - $phar->startBuffering(); - - $finder = new Finder(); - $finder->files() - ->ignoreVCS(true) - ->name('*.php') - ->name('*.xsd') - ->name('*.xml') - ->name('LICENSE') - ->notName('PharCompiler.php') - ->notName('PearCompiler.php') - ->in($this->libPath . '/src') - ->in($this->libPath . '/vendor'); - - foreach ($finder as $file) { - // don't compile test suites - if (!preg_match('/\/tests\/|\/test\//i', $file->getRealPath())) { - $this->addFileToPhar($file, $phar); - } - } - - // license and autoloading - $this->addFileToPhar(new \SplFileInfo($this->libPath . '/LICENSE'), $phar); - $this->addFileToPhar(new \SplFileInfo($this->libPath . '/i18n.php'), $phar); - - // stub - $phar->setStub($this->getStub($version)); - $phar->stopBuffering(); - - unset($phar); - } - - /** - * Adds a file to phar archive. - * - * @param SplFileInfo $file file info - * @param Phar $phar phar packager - */ - protected function addFileToPhar(\SplFileInfo $file, \Phar $phar) - { - $path = str_replace($this->libPath . '/', '', $file->getRealPath()); - $phar->addFromString($path, file_get_contents($file)); - } - - /** - * Replaces tokens in specified path. - * - * @param string|array $files files array or single file - * @param string $tokenStart token start symbol - * @param string $tokenFinish token finish symbol - * @param array $tokens replace tokens array - */ - protected function replaceTokens($files, $tokenStart, $tokenFinish, array $tokens) - { - if (!is_array($files)) { - $files = array($files); - } - - foreach ($files as $file) { - $content = file_get_contents($file); - foreach ($tokens as $key => $value) { - $content = str_replace($tokenStart . $key . $tokenFinish, $value, $content, $count); - } - file_put_contents($file, $content); - } - } - - /** - * Returns cli stub. - * - * @param string $version - * - * @return string - */ - protected function getStub($version) - { - return sprintf(<<<'EOF' -#!/usr/bin/env php -<?php - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -define('BEHAT_PHP_BIN_PATH', 'php'); -define('BEHAT_BIN_PATH', __FILE__); -define('BEHAT_VERSION', '%s'); - -Phar::mapPhar('behat.phar'); -require_once 'phar://behat.phar/vendor/autoload.php'; - -// internal encoding to utf8 -mb_internal_encoding('utf8'); - -if (!defined('BEHAT_PHAR_CLI') || true === BEHAT_PHAR_CLI) { - // check, that we are in CLI - if ('cli' === php_sapi_name()) { - $app = new Behat\Behat\Console\BehatApplication(BEHAT_VERSION); - $app->run(); - } else { - throw new RuntimeException('Behat can be runned only as CLI utility'); - } - exit(0); -} - -__HALT_COMPILER(); -EOF - , $version); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/BehatApplication.php b/vendor/behat/behat/src/Behat/Behat/Console/BehatApplication.php deleted file mode 100644 index 640f4de..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/BehatApplication.php +++ /dev/null @@ -1,184 +0,0 @@ -<?php - -namespace Behat\Behat\Console; - -use Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Application, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputDefinition, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -use Behat\Behat\DependencyInjection\BehatExtension, - Behat\Behat\DependencyInjection\Configuration\Loader; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat console application. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class BehatApplication extends Application -{ - private $basePath; - - /** - * {@inheritdoc} - */ - public function __construct($version) - { - parent::__construct('Behat', $version); - } - - /** - * {@inheritdoc} - */ - public function getDefinition() - { - return new InputDefinition(array( - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), - new InputOption('--verbose', '-v', InputOption::VALUE_NONE, 'Increase verbosity of exceptions.'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this behat version.'), - new InputOption('--config', '-c', InputOption::VALUE_REQUIRED, 'Specify config file to use.'), - new InputOption('--profile', '-p', InputOption::VALUE_REQUIRED, 'Specify config profile to use.') - )); - } - - /** - * Runs the current application. - * - * @param InputInterface $input - * @param OutputInterface $output - * - * @return integer 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - $this->add($this->createCommand($input)); - - return parent::doRun($input, $output); - } - - /** - * Creates main command for application. - * - * @param InputInterface $input - * - * @return Command - */ - protected function createCommand(InputInterface $input) - { - return $this->createContainer($input)->get('behat.console.command'); - } - - /** - * Creates container instance, loads extensions and freezes it. - * - * @param InputInterface $input - * - * @return ContainerInterface - */ - protected function createContainer(InputInterface $input) - { - $container = new ContainerBuilder(); - $this->loadCoreExtension($container, $this->loadConfiguration($container, $input)); - $container->compile(); - - return $container; - } - - /** - * Configures container based on providen config file and profile. - * - * @param ContainerBuilder $container - * @param InputInterface $input - */ - protected function loadConfiguration(ContainerBuilder $container, InputInterface $input) - { - // locate paths - $this->basePath = getcwd(); - if ($configPath = $this->getConfigurationFilePath($input)) { - $this->basePath = realpath(dirname($configPath)); - } - - // read configuration - $loader = new Loader($configPath); - $profile = $input->getParameterOption(array('--profile', '-p')) ?: 'default'; - - return $loader->loadConfiguration($profile); - } - - /** - * Finds configuration file and returns path to it. - * - * @param InputInterface $input - * - * @return string - */ - protected function getConfigurationFilePath(InputInterface $input) - { - // custom configuration file - if ($file = $input->getParameterOption(array('--config', '-c'))) { - if (is_file($file)) { - return $file; - } - - return; - } - - // predefined config paths - $cwd = rtrim(getcwd(), DIRECTORY_SEPARATOR); - foreach (array_filter(array( - $cwd.DIRECTORY_SEPARATOR.'behat.yml', - $cwd.DIRECTORY_SEPARATOR.'behat.yml.dist', - $cwd.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'behat.yml', - $cwd.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'behat.yml.dist', - ), 'is_file') as $path) { - return $path; - } - } - - /** - * Loads core extension into container. - * - * @param ContainerBuilder $container - * @param $array $configs - */ - protected function loadCoreExtension(ContainerBuilder $container, array $configs) - { - if (null === $this->basePath) { - throw new \RuntimeException( - 'Suite basepath is not set. Seems you have forgot to load configuration first.' - ); - } - - $extension = new BehatExtension($this->basePath); - $extension->load($configs, $container); - $container->addObjectResource($extension); - } - - /** - * {@inheritdoc} - */ - protected function getCommandName(InputInterface $input) - { - return 'behat'; - } - - /** - * {@inheritdoc} - */ - protected function getTerminalWidth() - { - return PHP_INT_MAX; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Command/BaseCommand.php b/vendor/behat/behat/src/Behat/Behat/Console/Command/BaseCommand.php deleted file mode 100644 index 45facf9..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Command/BaseCommand.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Command; - -use Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface; - -use Behat\Behat\Console\Processor\ProcessorInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base behat console command. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class BaseCommand extends Command -{ - private $processor; - - /** - * Returns service container instance. - * - * @return ContainerInterface - */ - abstract protected function getContainer(); - - /** - * Sets command processor. - * - * @param ProcessorInterface $processor - * - * @return Command - */ - protected function setProcessor(ProcessorInterface $processor) - { - $this->processor = $processor; - $this->processor->configure($this); - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - $this->processor->process($input, $output); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php b/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php deleted file mode 100644 index d78891c..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php +++ /dev/null @@ -1,203 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Command; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface; - -use Behat\Gherkin\Gherkin; - -use Behat\Behat\Console\Input\InputDefinition, - Behat\Behat\Console\Processor\ProcessorInterface, - Behat\Behat\Event\SuiteEvent; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat console command. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class BehatCommand extends BaseCommand -{ - private $container; - private $featuresPaths; - private $strict = true; - private $dryRun = false; - - /** - * Initializes command. - * - * @param ContainerInterface $container - * @param ProcessorInterface $processor - */ - public function __construct(ContainerInterface $container, ProcessorInterface $processor) - { - parent::__construct('behat'); - - $this->container = $container; - $this->setDefinition(new InputDefinition); - $this->setProcessor($processor); - } - - /** - * Sets features/scenarios paths to run. - * - * @param array $paths - */ - public function setFeaturesPaths(array $paths) - { - $this->featuresPaths = $paths; - } - - /** - * Returns paths to the features of current suite (basepath). - * - * @return array - */ - public function getFeaturesPaths() - { - return $this->featuresPaths; - } - - /** - * Sets runner to be strict. - * - * @param Boolean $strict - */ - public function setStrict($strict = true) - { - $this->strict = (bool) $strict; - } - - /** - * Checks whether runner is strict. - * - * @return Boolean - */ - public function isStrict() - { - return $this->strict; - } - - /** - * Sets suite to dry-run mode (skip all steps). - * - * @param Boolean $dryRun - */ - public function setDryRun($dryRun = true) - { - $this->dryRun = (bool) $dryRun; - } - - /** - * Checks whether runner is in dry-run mode. - * - * @return Boolean - */ - public function isDryRun() - { - return $this->dryRun; - } - - /** - * Returns container instance. - * - * @return ContainerInterface - */ - protected function getContainer() - { - return $this->container; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $gherkin = $this->getContainer()->get('gherkin'); - - $this->beforeSuite(); - $this->runFeatures($gherkin); - $this->afterSuite(); - - return $this->getCliReturnCode(); - } - - /** - * Parses and runs provided features. - * - * @param Gherkin $gherkin gherkin parser/loader - */ - protected function runFeatures(Gherkin $gherkin) - { - foreach ($this->getFeaturesPaths() as $path) { - // parse every feature with Gherkin - $features = $gherkin->load((string) $path); - - // and run it in FeatureTester - foreach ($features as $feature) { - $tester = $this->getContainer()->get('behat.tester.feature'); - $tester->setDryRun($this->isDryRun()); - - $feature->accept($tester); - } - } - } - - /** - * Returns CLI code for finished suite. - * - * @return integer - */ - protected function getCliReturnCode() - { - $logger = $this->getContainer()->get('behat.logger'); - - if ($this->isStrict()) { - return intval(0 < $logger->getSuiteResult()); - } - - return intval(4 === $logger->getSuiteResult()); - } - - /** - * Fire beforeSuite event. - */ - protected function beforeSuite() - { - $dispatcher = $this->getContainer()->get('behat.event_dispatcher'); - $logger = $this->getContainer()->get('behat.logger'); - $parameters = $this->getContainer()->get('behat.context.dispatcher')->getContextParameters(); - - $dispatcher->dispatch('beforeSuite', new SuiteEvent($logger, $parameters, false)); - - // catch app interruption - if (function_exists('pcntl_signal')) { - declare(ticks = 1); - pcntl_signal(SIGINT, function() use($dispatcher, $parameters, $logger) { - $dispatcher->dispatch('afterSuite', new SuiteEvent($logger, $parameters, false)); - exit(1); - }); - } - } - - /** - * Fire afterSuite event. - */ - protected function afterSuite() - { - $dispatcher = $this->getContainer()->get('behat.event_dispatcher'); - $logger = $this->getContainer()->get('behat.logger'); - $parameters = $this->getContainer()->get('behat.context.dispatcher')->getContextParameters(); - - $dispatcher->dispatch('afterSuite', new SuiteEvent($logger, $parameters, true)); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Formatter/OutputFormatter.php b/vendor/behat/behat/src/Behat/Behat/Console/Formatter/OutputFormatter.php deleted file mode 100644 index df7cb91..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatter as BaseOutputFormatter, - Symfony\Component\Console\Formatter\OutputFormatterStyle; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat console output formatter. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class OutputFormatter extends BaseOutputFormatter -{ - /** - * {@inheritdoc} - */ - public function __construct($decorated = null, array $styles = array()) - { - parent::__construct($decorated, array_merge(array( - 'undefined' => new OutputFormatterStyle('yellow'), - 'pending' => new OutputFormatterStyle('yellow'), - 'pending_param' => new OutputFormatterStyle('yellow', null, array('bold')), - 'failed' => new OutputFormatterStyle('red'), - 'failed_param' => new OutputFormatterStyle('red', null, array('bold')), - 'passed' => new OutputFormatterStyle('green'), - 'passed_param' => new OutputFormatterStyle('green', null, array('bold')), - 'skipped' => new OutputFormatterStyle('cyan'), - 'skipped_param' => new OutputFormatterStyle('cyan', null, array('bold')), - 'comment' => new OutputFormatterStyle('black'), - 'tag' => new OutputFormatterStyle('cyan') - ), $styles)); - } - - /** - * Formats a message according to the given styles. - * - * @param string $message The message to style - * - * @return string The styled message - */ - public function format($message) - { - return preg_replace_callback( - '/{\+([a-z-_]+)}(.*?){\-\\1}/si', array($this, 'replaceStyle'), $message - ); - } - - /** - * Replaces style of the output. - * - * @param array $match - * - * @return string The replaced style - */ - private function replaceStyle($match) - { - if (!$this->isDecorated()) { - return $match[2]; - } - - if ($this->hasStyle($match[1])) { - $style = $this->getStyle($match[1]); - } else { - return $match[0]; - } - - return $style->apply($match[2]); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Input/InputDefinition.php b/vendor/behat/behat/src/Behat/Behat/Console/Input/InputDefinition.php deleted file mode 100644 index 23bb02b..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Input/InputDefinition.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Input; - -use Symfony\Component\Console\Input\InputDefinition as BaseDefinition; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Extended InputDefinition, which supports switchers. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class InputDefinition extends BaseDefinition -{ - /** - * Gets the synopsis. - * - * @return string The synopsis - */ - public function getSynopsis() - { - $elements = array(); - $isSwitch = false; - $options = $this->getOptions(); - - foreach ($options as $option) { - if ($isSwitch) { - $isSwitch = false; - continue; - } - - // if switch - if (array_key_exists('no-'.$option->getName(), $options)) { - $elements[] = sprintf('[--[no-]%s]', $option->getName()); - $isSwitch = true; - } else { - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $elements[] = sprintf('['.($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName()); - } - } - - foreach ($this->getArguments() as $argument) { - $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName().($argument->isArray() ? '1' : '')); - - if ($argument->isArray()) { - $elements[] = sprintf('... [%sN]', $argument->getName()); - } - } - - return implode(' ', $elements); - } - - /** - * Returns a textual representation of the InputDefinition. - * - * @return string A string representing the InputDefinition - */ - public function asText() - { - // find the largest option or argument name - $max = 0; - foreach ($this->getOptions() as $option) { - $nameLength = strlen($option->getName()) + 2; - if ($option->getShortcut()) { - $nameLength += strlen($option->getShortcut()) + 3; - } - if ($this->hasOption('no-'.$option->getName())) { - $nameLength += 5; - } - - $max = max($max, $nameLength); - } - foreach ($this->getArguments() as $argument) { - $max = max($max, strlen($argument->getName())); - } - ++$max; - - $text = array(); - - if ($this->getArguments()) { - $text[] = '<comment>Arguments:</comment>'; - foreach ($this->getArguments() as $argument) { - if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) { - $default = sprintf('<comment> (default: %s)</comment>', $this->subformatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $description = str_replace("\n", "\n".str_pad('', $max + 2, ' '), $argument->getDescription()); - - $text[] = sprintf(" <info>%-${max}s</info> %s%s", $argument->getName(), $description, $default); - } - - $text[] = ''; - } - - if ($this->getOptions()) { - $text[] = '<comment>Options:</comment>'; - - $isSwitch = false; - $options = $this->getOptions(); - foreach ($options as $option) { - if ($isSwitch) { - $isSwitch = false; - continue; - } - - if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) { - $default = sprintf('<comment> (default: %s)</comment>', $this->subformatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - if ($this->hasOption('no-'.$option->getName())) { - $isSwitch = true; - } - - $multiple = $option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''; - $description = str_replace("\n", "\n".str_pad('', $max + 2, ' '), $option->getDescription()); - - $optionMax = $max - strlen($option->getName()) - 2; - - if ($isSwitch) { - $optionMax -= 5; - } - - $text[] = sprintf(" <info>%s</info> %-${optionMax}s%s%s%s", - '--'.( $isSwitch ? '[no-]' : '' ) . $option->getName(), - $option->getShortcut() ? sprintf('(-%s) ', $option->getShortcut()) : '', - $description, - $default, - $multiple - ); - } - - $text[] = ''; - } - - return implode("\n", $text); - } - - private function subformatDefaultValue($default) - { - if (is_array($default) && $default === array_values($default)) { - return sprintf("array('%s')", implode("', '", $default)); - } - - return str_replace("\n", '', var_export($default, true)); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/AggregateProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/AggregateProcessor.php deleted file mode 100644 index 85b25a7..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/AggregateProcessor.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Processors manager. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class AggregateProcessor implements ProcessorInterface -{ - private $processors = array(); - - /** - * Adds processor to the manager. - * - * @param ProcessorInterface $processor Processor instance - */ - public function addProcessor(ProcessorInterface $processor) - { - $this->processors[] = $processor; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - foreach ($this->processors as $processor) { - $processor->configure($command); - } - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output) - { - foreach ($this->processors as $processor) { - $processor->process($input, $output); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/ContextReaderProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/ContextReaderProcessor.php deleted file mode 100644 index 5d1acb9..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/ContextReaderProcessor.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -use Behat\Gherkin\Filter\NameFilter, - Behat\Gherkin\Filter\TagFilter, - Behat\Gherkin\Cache\FileCache; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context reader processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ContextReaderProcessor extends Processor -{ - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output) - { - $this->container->get('behat.context.reader')->read(); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/FormatProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/FormatProcessor.php deleted file mode 100644 index bb73650..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/FormatProcessor.php +++ /dev/null @@ -1,331 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -use Behat\Behat\Formatter\FormatterManager, - Behat\Behat\Formatter\FormatterDispatcher; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Format processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FormatProcessor extends Processor -{ - private $container; - - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - $formatDispatchers = $this->container->get('behat.formatter.manager')->getDispatchers(); - - $command - ->addOption('--format', '-f', InputOption::VALUE_REQUIRED, - "How to format features. <comment>pretty</comment> is default.\n" . - "Default formatters are:\n" . - implode("\n", - array_map(function($dispatcher) { - $comment = '- <comment>'.$dispatcher->getName().'</comment>: '; - - if ($dispatcher->getDescription()) { - $comment .= $dispatcher->getDescription(); - } else { - $comment .= $dispatcher->getClass(); - } - - return $comment; - }, $formatDispatchers) - ) . "\n" . - "Can use multiple formats at once (splitted with \"<comment>,</comment>\")" - ) - ->addOption('--out', null, InputOption::VALUE_REQUIRED, - "Write formatter output to a file/directory\n" . - "instead of STDOUT <comment>(output_path)</comment>." - ) - ->addOption('--lang', null, InputOption::VALUE_REQUIRED, - 'Print formatter output in particular language.' - ) - - // --[no-]ansi - ->addOption('--ansi', null, InputOption::VALUE_NONE, - "Whether or not to use ANSI color in the output.\n". - "Behat decides based on your platform and the output\n". - "destination if not specified." - ) - ->addOption('--no-ansi', null, InputOption::VALUE_NONE) - - // --[no-]time - ->addOption('--time', null, InputOption::VALUE_NONE, - "Whether or not to show timer in output." - ) - ->addOption('--no-time', null, InputOption::VALUE_NONE) - - // --[no-]paths - ->addOption('--paths', null, InputOption::VALUE_NONE, - "Whether or not to print sources paths." - ) - ->addOption('--no-paths', null, InputOption::VALUE_NONE) - - // --[no-]snippets - ->addOption('--snippets', null, InputOption::VALUE_NONE, - "Whether or not to print snippets for undefined steps." - ) - ->addOption('--no-snippets', null, InputOption::VALUE_NONE) - - // --[no-]snippets-paths - ->addOption('--snippets-paths', null, InputOption::VALUE_NONE, - "Whether or not to print details about undefined steps\n". - "in their snippets." - ) - ->addOption('--no-snippets-paths', null, InputOption::VALUE_NONE) - - // --[no-]multiline - ->addOption('--multiline', null, InputOption::VALUE_NONE, - "Whether or not to print multiline arguments for steps." - ) - ->addOption('--no-multiline', null, InputOption::VALUE_NONE) - - // --[no-]expand - ->addOption('--expand', null, InputOption::VALUE_NONE, - "Whether or not to expand scenario outline examples\n". - "tables.\n" - ) - ->addOption('--no-expand', null, InputOption::VALUE_NONE) - ; - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output) - { - $manager = $this->container->get('behat.formatter.manager'); - $formats = array_map('trim', explode(',', - $input->getOption('format') ?: $this->container->getParameter('behat.formatter.name') - )); - - $this->loadFormatterTranslations(); - $this->loadCustomFormatters($manager); - $this->initFormatters($manager, $formats); - $this->configureFormatters($manager, $input, $output); - $this->initMultipleOutputs($manager, $input); - } - - /** - * Loads formatter translations from behat.paths.i18n parameter file. - */ - protected function loadFormatterTranslations() - { - if (!is_file($i18nFile = $this->container->getParameter('behat.paths.i18n'))) { - return; - } - - $translator = $this->container->get('behat.translator'); - foreach (require($i18nFile) as $lang => $messages) { - $translator->addResource('array', $messages, $lang, 'behat'); - } - } - - /** - * Loads custom formatters, defined in behat.yml. - * - * @param FormatterManager $manager - */ - protected function loadCustomFormatters(FormatterManager $manager) - { - foreach ($this->container->getParameter('behat.formatter.classes') as $name => $class) { - $manager->addDispatcher(new FormatterDispatcher($class, $name)); - } - } - - /** - * Inits formatters. - * - * @param FormatterManager $manager - * @param $array $formats - */ - protected function initFormatters(FormatterManager $manager, array $formats) - { - foreach ($formats as $format) { - $manager->initFormatter($format); - } - } - - /** - * Configures formatters based on container, input and output configurations. - * - * @param FormatterManager $manager - * @param InputInterface $input - * @param OutputInterface $output - */ - protected function configureFormatters(FormatterManager $manager, InputInterface $input, - OutputInterface $output) - { - $parameters = $this->container->getParameter('behat.formatter.parameters'); - foreach ($parameters as $name => $value) { - if ('output_path' === $name) { - continue; - } - $manager->setFormattersParameter($name, $value); - } - - $manager->setFormattersParameter('base_path', - $this->container->getParameter('behat.paths.base') - ); - $manager->setFormattersParameter('support_path', - $this->container->getParameter('behat.paths.bootstrap') - ); - $manager->setFormattersParameter('decorated', - $output->isDecorated() - ); - - if ($input->getOption('verbose')) { - $manager->setFormattersParameter('verbose', true); - } - - if ($input->getOption('lang')) { - $manager->setFormattersParameter('language', $input->getOption('lang')); - } - - if (null !== $ansi = $this->getSwitchValue($input, 'ansi')) { - $output->setDecorated($ansi); - $manager->setFormattersParameter('decorated', $ansi); - } - if (null !== $time = $this->getSwitchValue($input, 'time')) { - $manager->setFormattersParameter('time', $time); - } - if (null !== $snippets = $this->getSwitchValue($input, 'snippets')) { - $manager->setFormattersParameter('snippets', $snippets); - } - if (null !== $snippetsPaths = $this->getSwitchValue($input, 'snippets-paths')) { - $manager->setFormattersParameter('snippets_paths', $snippetsPaths); - } - if (null !== $paths = $this->getSwitchValue($input, 'paths')) { - $manager->setFormattersParameter('paths', $paths); - } - if (null !== $expand = $this->getSwitchValue($input, 'expand')) { - $manager->setFormattersParameter('expand', $expand); - } - if (null !== $multiline = $this->getSwitchValue($input, 'multiline')) { - $manager->setFormattersParameter('multiline_arguments', $multiline); - } - } - - /** - * Initializes multiple formatters with different outputs. - * - * @param FormatterManager $manager - * @param InputInterface $input - */ - protected function initMultipleOutputs(FormatterManager $manager, InputInterface $input) - { - $parameters = $this->container->getParameter('behat.formatter.parameters'); - if ($input->getOption('out')) { - $outputs = $input->getOption('out'); - } elseif (isset($parameters['output_path'])) { - $outputs = $parameters['output_path']; - } else { - return; - } - - if (false === strpos($outputs, ',')) { - $outputPath = $this->locateOutputPath($outputs); - $manager->setFormattersParameter('output_path', $outputPath); - $manager->setFormattersParameter('decorated', (bool) $this->getSwitchValue($input, 'ansi')); - - return; - } - - foreach (array_map('trim', explode(',', $outputs)) as $i => $out) { - if (!$out || 'null' === $out || 'false' === $out) { - continue; - } - - $outputPath = $this->locateOutputPath($out); - $formatters = $manager->getFormatters(); - if (isset($formatters[$i])) { - $formatters[$i]->setParameter('output_path', $outputPath); - $formatters[$i]->setParameter('decorated', (bool) $this->getSwitchValue($input, 'ansi')); - } - } - } - - /** - * Locates output path from relative one. - * - * @param string $out - * - * @return string - */ - private function locateOutputPath($out) - { - if ($this->isAbsolutePath($out)) { - return $out; - } - - $out = getcwd().DIRECTORY_SEPARATOR.$out; - - if (!file_exists($out)) { - touch($out); - $out = realpath($out); - unlink($out); - } else { - $out = realpath($out); - } - - return $out; - } - - /** - * Returns whether the file path is an absolute path. - * - * @param string $file A file path - * - * @return Boolean - */ - private function isAbsolutePath($file) - { - if ($file[0] == '/' || $file[0] == '\\' - || (strlen($file) > 3 && ctype_alpha($file[0]) - && $file[1] == ':' - && ($file[2] == '\\' || $file[2] == '/') - ) - || null !== parse_url($file, PHP_URL_SCHEME) - ) { - return true; - } - - return false; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/GherkinProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/GherkinProcessor.php deleted file mode 100644 index 494c6de..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/GherkinProcessor.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -use Behat\Gherkin\Filter\NameFilter, - Behat\Gherkin\Filter\TagFilter, - Behat\Gherkin\Cache\FileCache; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class GherkinProcessor extends Processor -{ - private $container; - - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command - ->addOption('--name', null, InputOption::VALUE_REQUIRED, - "Only execute the feature elements which match\n" . - "part of the given name or regex." - ) - ->addOption('--tags', null, InputOption::VALUE_REQUIRED, - "Only execute the features or scenarios with tags\n" . - "matching tag filter expression.\n" - ) - ->addOption('--cache', null, InputOption::VALUE_REQUIRED, - "Cache parsed features into specified path." - ) - ; - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output) - { - $gherkinParser = $this->container->get('gherkin'); - - $name = $input->getOption('name') - ?: $this->container->getParameter('gherkin.filters.name'); - if ($name) { - $gherkinParser->addFilter(new NameFilter($name)); - } - - $tags = $input->getOption('tags') - ?: $this->container->getParameter('gherkin.filters.tags'); - if ($tags) { - $gherkinParser->addFilter(new TagFilter($tags)); - } - - $path = $input->getOption('cache') - ?: $this->container->getParameter('behat.options.cache'); - if ($path) { - $cache = new FileCache($path); - $this->container->get('gherkin.loader.gherkin_file')->setCache($cache); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/HelpProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/HelpProcessor.php deleted file mode 100644 index eb47ae4..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/HelpProcessor.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Help (story-syntax and definition printers) processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class HelpProcessor extends Processor -{ - private $container; - - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command - ->addOption('--story-syntax', null, InputOption::VALUE_NONE, - "Print <comment>*.feature</comment> example.\n" . - "Use <info>--lang</info> to see specific language." - ) - ->addOption('--definitions', '-d', InputOption::VALUE_REQUIRED, - "Print all available step definitions:\n" . - "- use <info>-dl</info> to just list definition expressions.\n" . - "- use <info>-di</info> to show definitions with extended info.\n" . - "- use <info>-d 'needle'</info> to find specific definitions.\n" . - "Use <info>--lang</info> to see definitions in specific language.\n" - ) - ; - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output) - { - if ($input->getOption('story-syntax')) { - $this->container->get('behat.help_printer.story_syntax')->printSyntax( - $output, $input->getOption('lang') ?: 'en' - ); - - exit(0); - } - - if ($type = $input->getOption('definitions')) { - if ('l' === $type) { - $short = true; - $search = null; - } elseif ('i' === $type) { - $short = false; - $search = null; - } else { - $short = false; - $search = $type; - } - - $this->container->get('behat.help_printer.definitions')->printDefinitions( - $output, $search, $input->getOption('lang') ?: 'en', $short - ); - - exit(0); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/InitProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/InitProcessor.php deleted file mode 100644 index 25d6995..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/InitProcessor.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Init operation processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class InitProcessor extends Processor -{ - private $container; - - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command->addOption('--init', null, InputOption::VALUE_NONE, - "Create <comment>features</comment> directory structure.\n" - ); - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output) - { - if ($input->getOption('init')) { - $this->initFeaturesDirectoryStructure($output); - - exit(0); - } - } - - /** - * Creates features path structure (initializes behat tests structure). - * - * @param OutputInterface $output output console - */ - protected function initFeaturesDirectoryStructure(OutputInterface $output) - { - $basePath = $this->container->getParameter('behat.paths.base').DIRECTORY_SEPARATOR; - $featuresPath = $this->container->getParameter('behat.paths.features'); - $bootstrapPath = $this->container->getParameter('behat.paths.bootstrap'); - - if (!is_dir($featuresPath)) { - mkdir($featuresPath, 0777, true); - $output->writeln( - '<info>+d</info> ' . - str_replace($basePath, '', realpath($featuresPath)) . - ' <comment>- place your *.feature files here</comment>' - ); - } - - if (!is_dir($bootstrapPath)) { - mkdir($bootstrapPath, 0777, true); - $output->writeln( - '<info>+d</info> ' . - str_replace($basePath, '', realpath($bootstrapPath)) . - ' <comment>- place bootstrap scripts and static files here</comment>' - ); - - file_put_contents( - $bootstrapPath.DIRECTORY_SEPARATOR.'FeatureContext.php', - $this->getFeatureContextSkelet() - ); - - $output->writeln( - '<info>+f</info> ' . - str_replace($basePath, '', realpath($bootstrapPath)).DIRECTORY_SEPARATOR. - 'FeatureContext.php <comment>- place your feature related code here</comment>' - ); - } - } - - /** - * Returns feature context skelet. - * - * @return string - */ - protected function getFeatureContextSkelet() - { -return <<<'PHP' -<?php - -use Behat\Behat\Context\ClosuredContextInterface, - Behat\Behat\Context\TranslatedContextInterface, - Behat\Behat\Context\BehatContext, - Behat\Behat\Exception\PendingException; -use Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; - -// -// Require 3rd-party libraries here: -// -// require_once 'PHPUnit/Autoload.php'; -// require_once 'PHPUnit/Framework/Assert/Functions.php'; -// - -/** - * Features context. - */ -class FeatureContext extends BehatContext -{ - /** - * 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) - { - // Initialize your context here - } - -// -// Place your definition and hook methods here: -// -// /** -// * @Given /^I have done something with "([^"]*)"$/ -// */ -// public function iHaveDoneSomethingWith($argument) -// { -// doSomethingWith($argument); -// } -// -} - -PHP; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/LocatorProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/LocatorProcessor.php deleted file mode 100644 index a7cc983..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/LocatorProcessor.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Finder\Finder, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Path locator processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class LocatorProcessor extends Processor -{ - private $container; - - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command->addArgument('features', InputArgument::OPTIONAL, - "Feature(s) to run. Could be:\n" . - "- a dir <comment>(features/)</comment>\n" . - "- a feature <comment>(*.feature)</comment>\n" . - "- a scenario at specific line <comment>(*.feature:10)</comment>.\n" . - "- all scenarios at or after a specific line <comment>(*.feature:10-*)</comment>.\n" . - "- all scenarios at a line within a specific range <comment>(*.feature:10-20)</comment>." - ); - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - * - * @throws \InvalidArgumentException - */ - public function process(InputInterface $input, OutputInterface $output) - { - $this->container->get('behat.console.command')->setFeaturesPaths( - array($input->getArgument('features')) - ); - - if (is_dir($bootstrapPath = $this->container->getParameter('behat.paths.bootstrap'))) { - $this->loadBootstrapScripts($bootstrapPath); - } - } - - /** - * Requires *.php scripts from bootstrap/ folder. - * - * @param string $path - */ - protected function loadBootstrapScripts($path) - { - $iterator = Finder::create() - ->files() - ->name('*.php') - ->sortByName() - ->in($path) - ; - - foreach ($iterator as $file) { - require_once((string) $file); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/Processor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/Processor.php deleted file mode 100644 index cfefd71..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/Processor.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract base processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Processor implements ProcessorInterface -{ - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - } - - /** - * Returns correct value for input switch. - * - * @param InputInterface $input - * @param string $name - * - * @return Boolean|null - */ - protected function getSwitchValue(InputInterface $input, $name) - { - if ($input->getOption($name)) { - return true; - } - if ($input->getOption('no-'.$name)) { - return false; - } - - return null; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/ProcessorInterface.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/ProcessorInterface.php deleted file mode 100644 index 43964ce..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/ProcessorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat console processor interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ProcessorInterface -{ - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command); - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function process(InputInterface $input, OutputInterface $output); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Console/Processor/RunProcessor.php b/vendor/behat/behat/src/Behat/Behat/Console/Processor/RunProcessor.php deleted file mode 100644 index 19f9230..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Console/Processor/RunProcessor.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -namespace Behat\Behat\Console\Processor; - -use Symfony\Component\DependencyInjection\ContainerInterface, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Output\OutputInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * command configuration processor. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class RunProcessor extends Processor -{ - private $container; - - /** - * Constructs processor. - * - * @param ContainerInterface $container Container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Configures command to be able to process it later. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command - ->addOption('--strict', null, InputOption::VALUE_NONE, - 'Fail if there are any undefined or pending steps.' - ) - ->addOption('--dry-run', null, InputOption::VALUE_NONE, - 'Invokes formatters without executing the steps & hooks.' - ) - ->addOption('--rerun', null, InputOption::VALUE_REQUIRED, - "Save list of failed scenarios into new file\n" . - "or use existing file to run only scenarios from it." - ) - ->addOption('--append-snippets', null, InputOption::VALUE_NONE, - "Appends snippets for undefined steps into main context." - ) - ; - } - - /** - * Processes data from container and console input. - * - * @param InputInterface $input - * @param OutputInterface $output - * - * @throws \RuntimeException - */ - public function process(InputInterface $input, OutputInterface $output) - { - $command = $this->container->get('behat.console.command'); - $hookDispatcher = $this->container->get('behat.hook.dispatcher'); - - $command->setStrict( - $input->getOption('strict') || $this->container->getParameter('behat.options.strict') - ); - $command->setDryRun( - $input->getOption('dry-run') || $this->container->getParameter('behat.options.dry_run') - ); - $hookDispatcher->setDryRun( - $input->getOption('dry-run') || $this->container->getParameter('behat.options.dry_run') - ); - - if ($file = $input->getOption('rerun') ?: $this->container->getParameter('behat.options.rerun')) { - if (file_exists($file)) { - $command->setFeaturesPaths(explode("\n", trim(file_get_contents($file)))); - } - - $this->container->get('behat.formatter.manager') - ->initFormatter('failed') - ->setParameter('output_path', $file); - } - - if ($input->getOption('append-snippets') || $this->container->getParameter('behat.options.append_snippets')) { - $this->initializeSnippetsAppender(); - } - } - - /** - * Appends snippets to the main context after suite run. - */ - protected function initializeSnippetsAppender() - { - $contextRefl = new \ReflectionClass( - $this->container->get('behat.context.dispatcher')->getContextClass() - ); - - if ($contextRefl->implementsInterface('Behat\Behat\Context\ClosuredContextInterface')) { - throw new \RuntimeException( - '--append-snippets doesn\'t support closured contexts' - ); - } - - $formatManager = $this->container->get('behat.formatter.manager'); - $formatManager->setFormattersParameter('snippets', false); - - $formatter = $formatManager->initFormatter('snippets'); - $formatter->setParameter('decorated', false); - $formatter->setParameter('output_decorate', false); - $formatter->setParameter('output', $snippets = fopen('php://memory', 'rw')); - - $this->container->get('behat.event_dispatcher') - ->addListener('afterSuite', function() use($contextRefl, $snippets) { - rewind($snippets); - $snippets = stream_get_contents($snippets); - - if (trim($snippets)) { - $snippets = strtr($snippets, array('\\' => '\\\\', '$' => '\\$')); - $context = file_get_contents($contextRefl->getFileName()); - $context = preg_replace('/}[ \n]*$/', rtrim($snippets)."\n}\n", $context); - - file_put_contents($contextRefl->getFileName(), $context); - } - }, -5); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/BehatContext.php b/vendor/behat/behat/src/Behat/Behat/Context/BehatContext.php deleted file mode 100644 index f5425c5..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/BehatContext.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat basic context implementation. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class BehatContext implements ExtendedContextInterface -{ - private $subcontexts = array(); - private $parentContext; - - /** - * Adds subcontext to current context. - * - * @param string $alias - * @param ExtendedContextInterface $context - */ - public function useContext($alias, ExtendedContextInterface $context) - { - $context->setParentContext($this); - $this->subcontexts[$alias] = $context; - } - - /** - * Sets parent context of current context. - * - * @param ExtendedContextInterface $parentContext - */ - public function setParentContext(ExtendedContextInterface $parentContext) - { - $this->parentContext = $parentContext; - } - - /** - * Returns main context. - * - * @return ExtendedContextInterface - */ - public function getMainContext() - { - if (null !== $this->parentContext) { - return $this->parentContext->getMainContext(); - } - - return $this; - } - - /** - * Find current context's subcontext by alias name. - * - * @param string $alias - * - * @return ExtendedContextInterface - */ - public function getSubcontext($alias) - { - // search in current context subcontexts - if (isset($this->subcontexts[$alias])) { - return $this->subcontexts[$alias]; - } - - // search in subcontexts childs contexts - foreach ($this->subcontexts as $subcontext) { - if (null !== $context = $subcontext->getSubcontext($alias)) { - return $context; - } - } - } - - /** - * Returns all added subcontexts. - * - * @return array - */ - public function getSubcontexts() - { - return $this->subcontexts; - } - - /** - * Finds subcontext by it's name. - * - * @param string $className - * - * @return ContextInterface - */ - public function getSubcontextByClassName($className) - { - foreach ($this->getSubcontexts() as $subcontext) { - if (get_class($subcontext) === $className) { - return $subcontext; - } - if ($context = $subcontext->getSubcontextByClassName($className)) { - return $context; - } - } - } - - /** - * Prints beautified debug string. - * - * @param string $string debug string - */ - public function printDebug($string) - { - echo "\n\033[36m| " . strtr($string, array("\n" => "\n| ")) . "\033[0m\n\n"; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ClassGuesser/ClassGuesserInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/ClassGuesser/ClassGuesserInterface.php deleted file mode 100644 index 9f84ebc..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ClassGuesser/ClassGuesserInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Behat\Behat\Context\ClassGuesser; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context class guesser interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ClassGuesserInterface -{ - /** - * Tries to guess context classname. - * - * @return string|null - */ - public function guess(); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ClassGuesser/PredefinedClassGuesser.php b/vendor/behat/behat/src/Behat/Behat/Context/ClassGuesser/PredefinedClassGuesser.php deleted file mode 100644 index 7bfb66b..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ClassGuesser/PredefinedClassGuesser.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Behat\Behat\Context\ClassGuesser; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Predefined context class guesser. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class PredefinedClassGuesser implements ClassGuesserInterface -{ - private $classname; - private $force; - - /** - * Initializes guesser. - * - * @param string $classname - * @param Boolean $force - */ - public function __construct($classname, $force = false) - { - $this->classname = $classname; - $this->force = (bool) $force; - } - - /** - * Tries to guess context classname. - * - * @return string|null - */ - public function guess() - { - return $this->force || class_exists($this->classname) ? $this->classname : null; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ClosuredContextInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/ClosuredContextInterface.php deleted file mode 100644 index fd14f45..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ClosuredContextInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Closured context interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ClosuredContextInterface extends ContextInterface -{ - /** - * Returns array of step definition files (*.php). - * - * @return array - */ - public function getStepDefinitionResources(); - - /** - * Returns array of hook definition files (*.php). - * - * @return array - */ - public function getHookDefinitionResources(); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ContextDispatcher.php b/vendor/behat/behat/src/Behat/Behat/Context/ContextDispatcher.php deleted file mode 100644 index db24e60..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ContextDispatcher.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context dispatcher. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ContextDispatcher -{ - private $classGuessers = array(); - private $initializers = array(); - private $parameters = array(); - - /** - * Initialize dispatcher. - * - * @param array $parameters context parameters - */ - public function __construct(array $parameters = array()) - { - $this->parameters = $parameters; - } - - /** - * Adds context class guesser to the dispatcher. - * - * @param ClassGuesser\ClassGuesserInterface $guesser - */ - public function addClassGuesser(ClassGuesser\ClassGuesserInterface $guesser) - { - $this->classGuessers[] = $guesser; - } - - /** - * Adds context initializer to the dispatcher. - * - * @param Initializer\InitializerInterface $initializer - */ - public function addInitializer(Initializer\InitializerInterface $initializer) - { - $this->initializers[] = $initializer; - } - - /** - * Returns context classname. - * - * @return string - */ - public function getContextClass() - { - $classname = null; - foreach ($this->classGuessers as $guesser) { - if ($classname = $guesser->guess()) { - break; - } - } - - if (null === $classname) { - throw new \RuntimeException( - 'Context class not found.'."\n". - 'Maybe you have provided wrong or no `bootstrap` path in your behat.yml:'."\n". - 'http://docs.behat.org/guides/7.config.html#paths' - ); - } - - if (!class_exists($classname)) { - throw new \RuntimeException(sprintf( - 'Context class "%s" not found and can not be instantiated.', $classname - )); - } - - $contextClassRefl = new \ReflectionClass($classname); - if (!$contextClassRefl->implementsInterface('Behat\Behat\Context\ContextInterface')) { - throw new \RuntimeException(sprintf( - 'Context class "%s" should implement ContextInterface', $classname - )); - } - - return $classname; - } - - /** - * Returns context parameters. - * - * @return array - */ - public function getContextParameters() - { - return $this->parameters; - } - - /** - * Creates new context instance. - * - * @return ContextInterface - * - * @throws \RuntimeException - */ - public function createContext() - { - $classname = $this->getContextClass(); - $parameters = $this->getContextParameters(); - $context = new $classname($parameters); - - $this->initializeContext($context); - - return $context; - } - - /** - * Initializes context with registered initializers. - * - * @param ContextInterface $context - */ - private function initializeContext(ContextInterface $context) - { - foreach ($this->initializers as $initializer) { - if ($initializer->supports($context)) { - $initializer->initialize($context); - } - } - - // if context has subcontexts - initialize them too - if ($context instanceof SubcontextableContextInterface) { - foreach ($context->getSubcontexts() as $subcontext) { - $this->initializeContext($subcontext); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ContextInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/ContextInterface.php deleted file mode 100644 index f9fe030..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ContextInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ContextInterface -{ -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ContextReader.php b/vendor/behat/behat/src/Behat/Behat/Context/ContextReader.php deleted file mode 100644 index 7c38c0c..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ContextReader.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -use Behat\Behat\Definition\DefinitionDispatcher, - Behat\Behat\Hook\HookDispatcher; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context reader. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ContextReader -{ - private $contextDispatcher; - private $loaders = array(); - - /** - * Initializes context reader. - * - * @param ContextDispatcher $contextDispatcher - */ - public function __construct(ContextDispatcher $contextDispatcher) - { - $this->contextDispatcher = $contextDispatcher; - } - - /** - * Adds context loader to the list of available loaders. - * - * @param Loader\LoaderInterface $loader - */ - public function addLoader(Loader\LoaderInterface $loader) - { - $this->loaders[] = $loader; - } - - /** - * Reads all definition data from main context. - */ - public function read() - { - $this->readFromContext($this->contextDispatcher->createContext()); - } - - /** - * Reads definition data from specific context class. - * - * @param ContextInterface $context - */ - private function readFromContext(ContextInterface $context) - { - foreach ($this->loaders as $loader) { - if ($loader->supports($context)) { - $loader->load($context); - } - } - - if ($context instanceof SubcontextableContextInterface) { - foreach ($context->getSubcontexts() as $subcontext) { - $this->readFromContext($subcontext); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/ExtendedContextInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/ExtendedContextInterface.php deleted file mode 100644 index 1be01c7..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/ExtendedContextInterface.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Extended context interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ExtendedContextInterface extends SubcontextableContextInterface -{ - /** - * Sets parent context of current context. - * - * @param ExtendedContextInterface $parentContext - */ - public function setParentContext(ExtendedContextInterface $parentContext); - - /** - * Returns main context. - * - * @return ExtendedContextInterface - */ - public function getMainContext(); - - /** - * Find current context's subcontext by alias name. - * - * @param string $alias - * - * @return ExtendedContextInterface - */ - public function getSubcontext($alias); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Initializer/InitializerInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/Initializer/InitializerInterface.php deleted file mode 100644 index ef107f9..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Initializer/InitializerInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Initializer; - -use Behat\Behat\Context\ContextInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context initializer interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface InitializerInterface -{ - /** - * Checks if initializer supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context); - - /** - * Initializes provided context. - * - * @param ContextInterface $context - */ - public function initialize(ContextInterface $context); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Loader/AnnotatedLoader.php b/vendor/behat/behat/src/Behat/Behat/Context/Loader/AnnotatedLoader.php deleted file mode 100644 index bb8f1b4..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Loader/AnnotatedLoader.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Loader; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Definition\DefinitionDispatcher, - Behat\Behat\Definition\DefinitionInterface, - Behat\Behat\Definition\TransformationInterface, - Behat\Behat\Hook\HookDispatcher, - Behat\Behat\Hook\HookInterface, - Behat\Behat\Annotation\AnnotationInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Annotated contexts reader. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class AnnotatedLoader implements LoaderInterface -{ - private $definitionDispatcher; - private $hookDispatcher; - private $annotationClasses = array( - 'given' => 'Behat\Behat\Definition\Annotation\Given', - 'when' => 'Behat\Behat\Definition\Annotation\When', - 'then' => 'Behat\Behat\Definition\Annotation\Then', - 'transform' => 'Behat\Behat\Definition\Annotation\Transformation', - 'beforesuite' => 'Behat\Behat\Hook\Annotation\BeforeSuite', - 'aftersuite' => 'Behat\Behat\Hook\Annotation\AfterSuite', - 'beforefeature' => 'Behat\Behat\Hook\Annotation\BeforeFeature', - 'afterfeature' => 'Behat\Behat\Hook\Annotation\AfterFeature', - 'beforescenario' => 'Behat\Behat\Hook\Annotation\BeforeScenario', - 'afterscenario' => 'Behat\Behat\Hook\Annotation\AfterScenario', - 'beforestep' => 'Behat\Behat\Hook\Annotation\BeforeStep', - 'afterstep' => 'Behat\Behat\Hook\Annotation\AfterStep' - ); - private $availableAnnotations; - - /** - * Initializes context loader. - * - * @param DefinitionDispatcher $definitionDispatcher - * @param HookDispatcher $hookDispatcher - */ - public function __construct(DefinitionDispatcher $definitionDispatcher, HookDispatcher $hookDispatcher) - { - $this->definitionDispatcher = $definitionDispatcher; - $this->hookDispatcher = $hookDispatcher; - $this->availableAnnotations = implode("|", array_keys($this->annotationClasses)); - } - - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context) - { - return true; - } - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - */ - public function load(ContextInterface $context) - { - $reflection = new \ReflectionObject($context); - - foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $methodRefl) { - foreach ($this->readMethodAnnotations($reflection->getName(), $methodRefl) as $annotation) { - if ($annotation instanceof DefinitionInterface) { - $this->definitionDispatcher->addDefinition($annotation); - } elseif ($annotation instanceof TransformationInterface) { - $this->definitionDispatcher->addTransformation($annotation); - } elseif ($annotation instanceof HookInterface) { - $this->hookDispatcher->addHook($annotation); - } - } - } - } - - /** - * Reads all supported method annotations. - * - * @param stirng $className - * @param \ReflectionMethod $method - * - * @return array - */ - private function readMethodAnnotations($className, \ReflectionMethod $method) - { - $annotations = array(); - - // read parent annotations - try { - $prototype = $method->getPrototype(); - $annotations = array_merge($annotations, $this->readMethodAnnotations($className, $prototype)); - } catch (\ReflectionException $e) {} - - // read method annotations - if ($docBlock = $method->getDocComment()) { - $description = null; - - foreach (explode("\n", $docBlock) as $docLine) { - $docLine = preg_replace('/^\/\*\*\s*|^\s*\*\s*|\s*\*\/$|\s*$/', '', $docLine); - - if (preg_match('/^\@('.$this->availableAnnotations.')\s*(.*)?$/i', $docLine, $matches)) { - $class = $this->annotationClasses[strtolower($matches[1])]; - $callback = array($className, $method->getName()); - - if (isset($matches[2]) && !empty($matches[2])) { - $annotation = new $class($callback, $matches[2]); - } else { - $annotation = new $class($callback); - } - - if (null !== $description) { - $annotation->setDescription($description); - } - - $annotations[] = $annotation; - } elseif (null === $description && '' !== $docLine && false === strpos($docLine, '@')) { - $description = $docLine; - } - } - } - - return $annotations; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Loader/ClosuredLoader.php b/vendor/behat/behat/src/Behat/Behat/Context/Loader/ClosuredLoader.php deleted file mode 100644 index 7111451..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Loader/ClosuredLoader.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Loader; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Context\ClosuredContextInterface, - Behat\Behat\Definition\Loader\ClosuredDefinitionLoader, - Behat\Behat\Hook\Loader\ClosuredHookLoader; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Closured contexts reader. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ClosuredLoader implements LoaderInterface -{ - private $definitionLoader; - private $hookLoader; - - /** - * Initializes context loader. - * - * @param ClosuredDefinitionLoader $definitionLoader - * @param ClosuredHookLoader $hookLoader - */ - public function __construct(ClosuredDefinitionLoader $definitionLoader, ClosuredHookLoader $hookLoader) - { - $this->definitionLoader = $definitionLoader; - $this->hookLoader = $hookLoader; - } - - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context) - { - return $context instanceof ClosuredContextInterface; - } - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - */ - public function load(ContextInterface $context) - { - foreach ($context->getStepDefinitionResources() as $path) { - $this->definitionLoader->load($path); - } - - foreach ($context->getHookDefinitionResources() as $path) { - $this->hookLoader->load($path); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Loader/LoaderInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/Loader/LoaderInterface.php deleted file mode 100644 index fa0bc09..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Loader/LoaderInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Loader; - -use Behat\Behat\Context\ContextInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context loader interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface LoaderInterface -{ - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context); - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - */ - public function load(ContextInterface $context); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Loader/TranslatedLoader.php b/vendor/behat/behat/src/Behat/Behat/Context/Loader/TranslatedLoader.php deleted file mode 100644 index e87dbde..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Loader/TranslatedLoader.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Loader; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Context\TranslatedContextInterface; - -use Symfony\Component\Translation\TranslatorInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Translated contexts reader. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class TranslatedLoader implements LoaderInterface -{ - private $translator; - - /** - * Initializes context loader. - * - * @param TranslatorInterface $translator - */ - public function __construct(TranslatorInterface $translator) - { - $this->translator = $translator; - } - - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context) - { - return $context instanceof TranslatedContextInterface; - } - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - * - * @throws \InvalidArgumentException - */ - public function load(ContextInterface $context) - { - foreach ($context->getTranslationResources() as $path) { - $extension = pathinfo($path, PATHINFO_EXTENSION); - - if ('yml' === $extension) { - $this->translator->addResource( - 'yaml', $path, basename($path, '.yml'), 'behat.definitions' - ); - } elseif ('xliff' === $extension) { - $this->translator->addResource( - 'xliff', $path, basename($path, '.xliff'), 'behat.definitions' - ); - } elseif ('php' === $extension) { - $this->translator->addResource( - 'php', $path, basename($path, '.php'), 'behat.definitions' - ); - } else { - throw new \InvalidArgumentException(sprintf( - 'Can not read definitions translations from file "%s". File is not supported', - $path - )); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Step/Given.php b/vendor/behat/behat/src/Behat/Behat/Context/Step/Given.php deleted file mode 100644 index bee1826..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Step/Given.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Step; - -use Behat\Gherkin\Node\StepNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Given substep. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Given implements SubstepInterface -{ - private $node; - - /** - * Initializes Given substep. - */ - public function __construct() - { - $arguments = func_get_args(); - - $text = array_shift($arguments); - $node = new StepNode('Given', $text); - $node->setArguments($arguments); - - $this->node = $node; - } - - /** - * Returns substep node. - * - * @return StepNode - */ - public function getStepNode() - { - return $this->node; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Step/SubstepInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/Step/SubstepInterface.php deleted file mode 100644 index e3f812b..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Step/SubstepInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Step; - -use Behat\Gherkin\Node\StepNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Substep interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface SubstepInterface -{ - /** - * Returns substep node. - * - * @return StepNode - */ - public function getStepNode(); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Step/Then.php b/vendor/behat/behat/src/Behat/Behat/Context/Step/Then.php deleted file mode 100644 index 990a7a9..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Step/Then.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Step; - -use Behat\Gherkin\Node\StepNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Then substep. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Then implements SubstepInterface -{ - private $node; - - /** - * Initializes Then substep. - */ - public function __construct() - { - $arguments = func_get_args(); - - $text = array_shift($arguments); - $node = new StepNode('Then', $text); - $node->setArguments($arguments); - - $this->node = $node; - } - - /** - * Returns substep node. - * - * @return StepNode - */ - public function getStepNode() - { - return $this->node; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Step/When.php b/vendor/behat/behat/src/Behat/Behat/Context/Step/When.php deleted file mode 100644 index 6cac1da..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Step/When.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Behat\Behat\Context\Step; - -use Behat\Gherkin\Node\StepNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * When substep. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class When implements SubstepInterface -{ - private $node; - - /** - * Initializes When substep. - */ - public function __construct() - { - $arguments = func_get_args(); - - $text = array_shift($arguments); - $node = new StepNode('When', $text); - $node->setArguments($arguments); - - $this->node = $node; - } - - /** - * Returns substep node. - * - * @return StepNode - */ - public function getStepNode() - { - return $this->node; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/SubcontextableContextInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/SubcontextableContextInterface.php deleted file mode 100644 index 5dd1a0d..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/SubcontextableContextInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Context interface with subcontexts support. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface SubcontextableContextInterface extends ContextInterface -{ - /** - * Returns all added subcontexts. - * - * @return array - */ - public function getSubcontexts(); - - /** - * Finds subcontext by it's name. - * - * @param string $className - * - * @return ContextInterface - */ - public function getSubcontextByClassName($className); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Context/TranslatedContextInterface.php b/vendor/behat/behat/src/Behat/Behat/Context/TranslatedContextInterface.php deleted file mode 100644 index 7a2ac84..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/TranslatedContextInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Behat\Behat\Context; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Translated context interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface TranslatedContextInterface extends ContextInterface -{ - /** - * Returns array of i18n XLIFF files paths. - * - * @return array - */ - public function getTranslationResources(); -} diff --git a/vendor/behat/behat/src/Behat/Behat/DataCollector/LoggerDataCollector.php b/vendor/behat/behat/src/Behat/Behat/DataCollector/LoggerDataCollector.php deleted file mode 100644 index 59bbd3f..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DataCollector/LoggerDataCollector.php +++ /dev/null @@ -1,345 +0,0 @@ -<?php - -namespace Behat\Behat\DataCollector; - -use Symfony\Component\EventDispatcher\EventDispatcher, - Symfony\Component\EventDispatcher\EventSubscriberInterface; - -use Behat\Behat\Event\FeatureEvent, - Behat\Behat\Event\SuiteEvent, - Behat\Behat\Event\ScenarioEvent, - Behat\Behat\Event\OutlineExampleEvent, - Behat\Behat\Event\StepEvent; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat run logger. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class LoggerDataCollector implements EventSubscriberInterface -{ - private $startTime; - private $finishTime; - private $statuses = array( - StepEvent::PASSED => 'passed', - StepEvent::SKIPPED => 'skipped', - StepEvent::PENDING => 'pending', - StepEvent::UNDEFINED => 'undefined', - StepEvent::FAILED => 'failed' - ); - private $suiteResult = 0; - private $featuresCount = 0; - private $featuresStatuses = array(); - private $scenariosCount = 0; - private $scenariosStatuses = array(); - private $stepsCount = 0; - private $stepsStatuses = array(); - private $definitionsSnippets = array(); - private $failedStepsEvents = array(); - private $pendingStepsEvents = array(); - - /** - * Initializes logger. - */ - public function __construct() - { - $this->featuresStatuses = array_combine( - array_values($this->statuses), - array_fill(0, count($this->statuses), 0) - ); - $this->scenariosStatuses = array_combine( - array_values($this->statuses), - array_fill(0, count($this->statuses), 0) - ); - $this->stepsStatuses = array_combine( - array_values($this->statuses), - array_fill(0, count($this->statuses), 0) - ); - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - $events = array( - 'beforeSuite', 'afterSuite', 'afterFeature', 'afterScenario', 'afterOutlineExample', - 'afterStep' - ); - - return array_combine($events, $events); - } - - /** - * Listens to "suite.before" event. - * - * @param SuiteEvent $event - * - * @uses startTimer() - */ - public function beforeSuite(SuiteEvent $event) - { - $this->startTimer(); - } - - /** - * Listens to "suite.after" event. - * - * @param SuiteEvent $event - * - * @uses finishTimer() - */ - public function afterSuite(SuiteEvent $event) - { - $this->finishTimer(); - } - - /** - * Listens to "feature.after" event. - * - * @param FeatureEvent $event - * - * @uses collectFeatureResult() - */ - public function afterFeature(FeatureEvent $event) - { - $this->collectFeatureResult($event->getResult()); - } - - /** - * Listens to "scenario.after" event. - * - * @param ScenarioEvent $event - * - * @uses collectScenarioResult() - */ - public function afterScenario(ScenarioEvent $event) - { - $this->collectScenarioResult($event->getResult()); - } - - /** - * Listens to "outline.example.after" event. - * - * @param OutlineExampleEvent $event - * - * @uses collectScenarioResult() - */ - public function afterOutlineExample(OutlineExampleEvent $event) - { - $this->collectScenarioResult($event->getResult()); - } - - /** - * Listens to "step.after" event. - * - * @param StepEvent $event - * - * @uses collectStepStats() - */ - public function afterStep(StepEvent $event) - { - $this->collectStepStats($event); - } - - /** - * Returns suite total execution time. - * - * @return float miliseconds - */ - public function getTotalTime() - { - return $this->finishTime - $this->startTime; - } - - /** - * Returns overall suites result. - * - * @return integer - */ - public function getSuiteResult() - { - return $this->suiteResult; - } - - /** - * Returns overall features count. - * - * @return integer - */ - public function getFeaturesCount() - { - return $this->featuresCount; - } - - /** - * Returns hash of features statuses count. - * - * @return array hash (ex: passed => 10, failed => 2) - */ - public function getFeaturesStatuses() - { - return $this->featuresStatuses; - } - - /** - * Returns overall scenarios count. - * - * @return integer - */ - public function getScenariosCount() - { - return $this->scenariosCount; - } - - /** - * Returns hash of scenarios statuses count. - * - * @return array hash (ex: passed => 10, failed => 2) - */ - public function getScenariosStatuses() - { - return $this->scenariosStatuses; - } - - /** - * Returns overall steps count. - * - * @return integer - */ - public function getStepsCount() - { - return $this->stepsCount; - } - - /** - * Returns hash of steps statuses count. - * - * @return array hash (ex: passed => 10, failed => 2) - */ - public function getStepsStatuses() - { - return $this->stepsStatuses; - } - - /** - * Returns hash of definition snippets for undefined steps. - * - * @return array hash with md5 as key and snippet as value - */ - public function getDefinitionsSnippets() - { - return $this->definitionsSnippets; - } - - /** - * Returns array of failed steps events. - * - * @return array - */ - public function getFailedStepsEvents() - { - return $this->failedStepsEvents; - } - - /** - * Returns array of pending steps events; - * - * @return array - */ - public function getPendingStepsEvents() - { - return $this->pendingStepsEvents; - } - - /** - * Starts suite timer. - */ - private function startTimer() - { - $this->startTime = microtime(true); - } - - /** - * Stops suite timer. - */ - private function finishTimer() - { - $this->finishTime = microtime(true); - } - - /** - * Collects feature result status. - * - * @param integer $result status code - */ - private function collectFeatureResult($result) - { - ++$this->featuresCount; - ++$this->featuresStatuses[$this->statuses[$result]]; - - $this->suiteResult = max($this->suiteResult, $result); - } - - /** - * Collects scenario result status. - * - * @param integer $result status code - */ - private function collectScenarioResult($result) - { - ++$this->scenariosCount; - ++$this->scenariosStatuses[$this->statuses[$result]]; - } - - /** - * Collects step statistics. - * - * @param StepEvent $event - */ - private function collectStepStats(StepEvent $event) - { - ++$this->stepsCount; - ++$this->stepsStatuses[$this->statuses[$event->getResult()]]; - - switch ($event->getResult()) { - case StepEvent::UNDEFINED: - $hash = $event->getSnippet()->getHash(); - if (!isset($this->definitionsSnippets[$hash])) { - $this->definitionsSnippets[$hash] = $event->getSnippet(); - } else { - $this->definitionsSnippets[$hash]->addStep($event->getSnippet()->getLastStep()); - } - break; - case StepEvent::FAILED: - $this->failedStepsEvents[] = $event; - break; - case StepEvent::PENDING: - $this->pendingStepsEvents[] = $event; - break; - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Definition.php b/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Definition.php deleted file mode 100644 index 13e849d..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Definition.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Annotation; - -use Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; - -use Behat\Behat\Definition\DefinitionInterface, - Behat\Behat\Exception\ErrorException, - Behat\Behat\Context\ContextInterface, - Behat\Behat\Annotation\Annotation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step definition. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Definition extends Annotation implements DefinitionInterface -{ - private $regex; - private $matchedText; - private $values = array(); - - /** - * Initializes definition. - * - * @param callback $callback definition callback - * @param string $regex definition regular expression - * - * @throws \InvalidArgumentException - */ - public function __construct($callback, $regex) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException(sprintf( - '"%s" definition callback should be a valid callable, but %s given', - basename(str_replace('\\', '/', get_class($this))), gettype($callback) - )); - } - parent::__construct($callback); - - $this->regex = $regex; - } - - /** - * Returns definition regex to match. - * - * @return string - */ - public function getRegex() - { - return $this->regex; - } - - /** - * Saves matched step text to definition. - * - * @param string $text - */ - public function setMatchedText($text) - { - $this->matchedText = $text; - } - - /** - * Returns matched step text. - * - * @return string - */ - public function getMatchedText() - { - return $this->matchedText; - } - - /** - * Sets step parameters for step run. - * - * @param array $values - */ - public function setValues(array $values) - { - $this->values = $values; - } - - /** - * Returns step parameters for step run. - * - * @return array - */ - public function getValues() - { - return $this->values; - } - - /** - * Custom error handler. - * - * This method used as custom error handler when step is running. - * - * @see set_error_handler() - * - * @param integer $level - * @param string $message - * @param string $file - * @param integer $line - * - * @return Boolean - * - * @throws ErrorException - */ - public function errorHandler($level, $message, $file, $line) - { - if (0 !== error_reporting()) { - throw new ErrorException($level, $message, $file, $line); - } - - // error reporting turned off or more likely suppressed with @ - return false; - } - - /** - * Runs definition callback. - * - * @param ContextInterface $context - * - * @return mixed - * - * @throws BehaviorException - */ - public function run(ContextInterface $context) - { - if (defined('BEHAT_ERROR_REPORTING')) { - $errorLevel = BEHAT_ERROR_REPORTING; - } else { - $errorLevel = E_ALL ^ E_WARNING; - } - - $callback = $this->getCallbackForContext($context); - - $values = $this->getValues(); - if ($this->isClosure()) { - array_unshift($values, $context); - } - - set_error_handler(array($this, 'errorHandler'), $errorLevel); - try { - $return = call_user_func_array($callback, $values); - } catch (\Exception $e) { - restore_error_handler(); - throw $e; - } - restore_error_handler(); - - return $return; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Given.php b/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Given.php deleted file mode 100644 index a9c7e69..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Given.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Annotation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Given type step definition. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Given extends Definition -{ - /** - * Returns definition type (Given|When|Then). - * - * @return string - */ - public function getType() - { - return 'Given'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Then.php b/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Then.php deleted file mode 100644 index f785c3b..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Then.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Annotation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Then type step definition. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Then extends Definition -{ - /** - * Returns definition type (Given|When|Then). - * - * @return string - */ - public function getType() - { - return 'Then'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Transformation.php b/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Transformation.php deleted file mode 100644 index dd481eb..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Transformation.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Annotation; - -use Behat\Gherkin\Node\TableNode; - -use Behat\Behat\Definition\TransformationInterface, - Behat\Behat\Context\ContextInterface, - Behat\Behat\Annotation\Annotation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step arguments transformation. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Transformation extends Annotation implements TransformationInterface -{ - private $regex; - - /** - * Initializes transformation. - * - * @param callback $callback definition callback - * @param string $regex definition regular expression - * - * @throws \InvalidArgumentException - */ - public function __construct($callback, $regex) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException(sprintf( - 'Transformation callback should be a valid callable, but %s given', - gettype($callback) - )); - } - parent::__construct($callback); - - $this->regex = $regex; - } - - /** - * Returns transformation regex. - * - * @return string - */ - public function getRegex() - { - return $this->regex; - } - - /** - * Transforms provided argument. - * - * @param string $translatedRegex - * @param ContextInterface $context - * @param mixed $argument - * - * @return mixed - */ - public function transform($translatedRegex, ContextInterface $context, $argument) - { - $callback = $this->getCallbackForContext($context); - - if ($argument instanceof TableNode) { - $tableMatching = 'table:' . implode(',', $argument->getRow(0)); - - if (preg_match($translatedRegex, $tableMatching) - || preg_match($this->regex, $tableMatching)) { - return call_user_func($callback, $argument); - } - } elseif (is_string($argument) || $argument instanceof PyStringNode) { - if (preg_match($translatedRegex, (string) $argument, $transformArguments) - || preg_match($this->regex, (string) $argument, $transformArguments)) { - array_shift($transformArguments); - - return call_user_func_array($callback, $transformArguments); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/When.php b/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/When.php deleted file mode 100644 index bdea10e..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/When.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Annotation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * When type step definition. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class When extends Definition -{ - /** - * Returns definition type (Given|When|Then). - * - * @return string - */ - public function getType() - { - return 'When'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionDispatcher.php b/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionDispatcher.php deleted file mode 100644 index b2f1321..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionDispatcher.php +++ /dev/null @@ -1,235 +0,0 @@ -<?php - -namespace Behat\Behat\Definition; - -use Symfony\Component\Translation\TranslatorInterface; - -use Behat\Gherkin\Node\StepNode, - Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; - -use Behat\Behat\Definition\Proposal\DefinitionProposalDispatcher, - Behat\Behat\Exception\RedundantException, - Behat\Behat\Exception\AmbiguousException, - Behat\Behat\Exception\UndefinedException, - Behat\Behat\Context\ContextInterface, - Behat\Behat\Definition\DefinitionSnippet; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Definition dispatcher. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class DefinitionDispatcher -{ - private $transformations = array(); - private $definitions = array(); - private $proposalDispatcher; - private $translator; - - /** - * Initializes definition dispatcher. - * - * @param DefinitionProposalDispatcher $proposalDispatcher - * @param TranslatorInterface $translator - */ - public function __construct(DefinitionProposalDispatcher $proposalDispatcher, TranslatorInterface $translator) - { - $this->proposalDispatcher = $proposalDispatcher; - $this->translator = $translator; - } - - /** - * Adds definition to dispatcher. - * - * @param DefinitionInterface $definition - * - * @throws RedundantException - */ - public function addDefinition(DefinitionInterface $definition) - { - $regex = $definition->getRegex(); - - if (isset($this->definitions[$regex])) { - throw new RedundantException($definition, $this->definitions[$regex]); - } - - $this->definitions[$regex] = $definition; - } - - /** - * Returns array of available definitions. - * - * @return array array of hashes => array(regex => definition) - */ - public function getDefinitions() - { - return $this->definitions; - } - - /** - * Adds transformation to dispatcher. - * - * @param TransformationInterface $transformation - */ - public function addTransformation(TransformationInterface $transformation) - { - $this->transformations[] = $transformation; - } - - /** - * Returns array of available transformations. - * - * @return array array of argument transformers - */ - public function getTransformations() - { - return $this->transformations; - } - - /** - * Cleans dispatcher. - */ - public function clean() - { - $this->definitions = array(); - $this->transformations = array(); - } - - /** - * Finds step definition, that match specified step. - * - * @param ContextInterface $context - * @param StepNode $step - * - * @return Definition - * - * @uses loadDefinitions() - * - * @throws AmbiguousException if step description is ambiguous - * @throws UndefinedException if step definition not found - */ - public function findDefinition(ContextInterface $context, StepNode $step) - { - $text = $step->getText(); - $multiline = $step->getArguments(); - $matches = array(); - - // find step to match - foreach ($this->getDefinitions() as $origRegex => $definition) { - $transRegex = $this->translateDefinitionRegex($origRegex, $step->getLanguage()); - - // if not regex really (string) - transform into it - if (0 !== strpos($origRegex, '/')) { - $origRegex = '/^'.preg_quote($origRegex, '/').'$/'; - $transRegex = '/^'.preg_quote($transRegex, '/').'$/'; - } - - if (preg_match($origRegex, $text, $arguments) - || ($origRegex !== $transRegex && preg_match($transRegex, $text, $arguments))) { - // prepare callback arguments - $arguments = $this->prepareCallbackArguments( - $context, $definition->getCallbackReflection(), array_slice($arguments, 1), $multiline - ); - - // transform arguments - foreach ($arguments as $num => $argument) { - foreach ($this->getTransformations() as $trans) { - $transRegex = $this->translateDefinitionRegex( - $trans->getRegex(), $step->getLanguage() - ); - - $newArgument = $trans->transform($transRegex, $context, $argument); - if (null !== $newArgument) { - $arguments[$num] = $newArgument; - } - } - } - - // set matched definition - $definition->setMatchedText($text); - $definition->setValues($arguments); - $matches[] = $definition; - } - } - - if (count($matches) > 1) { - throw new AmbiguousException($text, $matches); - } - - if (0 === count($matches)) { - throw new UndefinedException($text); - } - - return $matches[0]; - } - - /** - * Returns step definition for step node. - * - * @param ContextInterface $context - * @param StepNode $step - * - * @return DefinitionSnippet - */ - public function proposeDefinition(ContextInterface $context, StepNode $step) - { - return $this->proposalDispatcher->propose($context, $step); - } - - /** - * Translates definition regex to provided language (if possible). - * - * @param string $regex regex to translate - * @param string $language language - * - * @return string - */ - public function translateDefinitionRegex($regex, $language) - { - return $this->translator->trans($regex, array(), 'behat.definitions', $language); - } - - /** - * Merges found arguments with multiliners and maps them to the function callback signature. - * - * @param ContextInterface $context context instance - * @param \ReflectionFunctionAbstract $refl callback reflection - * @param array $arguments found arguments - * @param array $multiline multiline arguments of the step - * - * @return array - */ - private function prepareCallbackArguments(ContextInterface $context, \ReflectionFunctionAbstract $refl, - array $arguments, array $multiline) - { - $parametersRefl = $refl->getParameters(); - - if ($refl->isClosure()) { - array_shift($parametersRefl); - } - - $resulting = array(); - foreach ($parametersRefl as $num => $parameterRefl) { - if (isset($arguments[$parameterRefl->getName()])) { - $resulting[] = $arguments[$parameterRefl->getName()]; - } elseif (isset($arguments[$num])) { - $resulting[] = $arguments[$num]; - } - } - - foreach ($multiline as $argument) { - $resulting[] = $argument; - } - - return $resulting; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionInterface.php b/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionInterface.php deleted file mode 100644 index 7d487a3..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionInterface.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Behat\Behat\Definition; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Exception\BehaviorException; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step definition. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface DefinitionInterface -{ - /** - * Returns definition type (Given|When|Then). - * - * @return string - */ - public function getType(); - - /** - * Runs definition callback. - * - * @param ContextInterface $context - * - * @return mixed - * - * @throws BehaviorException - */ - public function run(ContextInterface $context); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionSnippet.php b/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionSnippet.php deleted file mode 100644 index 6fb7e0c..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionSnippet.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Behat\Behat\Definition; - -use Behat\Gherkin\Node\StepNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Definition snippet. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class DefinitionSnippet -{ - private $type; - private $template; - private $steps = array(); - - /** - * Initializes definition snippet. - * - * @param StepNode $step Step interested in snippet - * @param string $template Definition snippet template - */ - public function __construct(StepNode $step, $template) - { - $type = $step->getType(); - $this->type = in_array($type, array('Given', 'When', 'Then')) ? $type : 'Given'; - $this->template = $template; - $this->steps[] = $step; - } - - /** - * Adds step interested in this snippet. - * - * @param StepNode $step Step interested in snippet - */ - public function addStep(StepNode $step) - { - $this->steps[] = $step; - } - - /** - * Returns last step in list of steps. - * - * @return StepNode - */ - public function getLastStep() - { - return end($this->steps); - } - - /** - * Returns list of steps interested in this snippet. - * - * @return array - */ - public function getSteps() - { - return $this->steps; - } - - /** - * Returns snippet unique hash (ignoring step type). - * - * @return string - */ - public function getHash() - { - return md5($this->template); - } - - /** - * Returns definition snippet text. - * - * @return string - */ - public function getSnippet() - { - return sprintf($this->template, $this->type); - } - - /** - * Returns definition snippet text. - * - * @return string - */ - public function __toString() - { - return $this->getSnippet(); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Loader/ClosuredDefinitionLoader.php b/vendor/behat/behat/src/Behat/Behat/Definition/Loader/ClosuredDefinitionLoader.php deleted file mode 100644 index 9751b79..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Loader/ClosuredDefinitionLoader.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Loader; - -use Behat\Gherkin\Node\StepNode; - -use Behat\Behat\Definition\DefinitionDispatcher, - Behat\Behat\Definition\Annotation\Given, - Behat\Behat\Definition\Annotation\When, - Behat\Behat\Definition\Annotation\Then, - Behat\Behat\Definition\Annotation\Transformation; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Closured step definitions loader. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ClosuredDefinitionLoader implements DefinitionLoaderInterface -{ - private $dispatcher; - - /** - * Initializes loader. - * - * @param DefinitionDispatcher $dispatcher - */ - public function __construct(DefinitionDispatcher $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Loads definitions from provided resource. - * - * @param mixed $resource - */ - public function load($resource) - { - $steps = $this; - - require_once($resource); - } - - /** - * Defines argument transformation. - * - * @param string $regex transformation regex (to find specific argument) - * @param callback $callback transformation callback (must return transformed argument) - */ - public function Transform($regex, $callback) - { - $this->dispatcher->addTransformation(new Transformation($callback, $regex)); - } - - /** - * Defines a step with ->Given|When|Then|...('/regex/', callback) or - * call a step with ->Given|When|Then|...('I enter "12" in the field', $world) or - * even with arguments ->Given|When|Then|...('I fill up fields', $world, $table). - * - * @param string $type step type (Given|When|Then|...) - * @param string $arguments step regex & callback - * - * @return ClosuredDefinitionLoader - * - * @throws RedundantException if step definition is already exists - */ - public function __call($type, $arguments) - { - if (2 == count($arguments) && is_callable($arguments[1])) { - switch (strtolower($type)) { - case 'when': - $definition = new When($arguments[1], $arguments[0]); - break; - case 'then': - $definition = new Then($arguments[1], $arguments[0]); - break; - case 'given': - default: - $definition = new Given($arguments[1], $arguments[0]); - break; - } - - $this->dispatcher->addDefinition($definition); - } else { - $text = array_shift($arguments); - $world = array_shift($arguments); - - $step = new StepNode($type, $text); - $step->setArguments($arguments); - - $definition = $this->dispatcher->findDefinition($world, $step); - $definition->run($world); - } - - return $this; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Loader/DefinitionLoaderInterface.php b/vendor/behat/behat/src/Behat/Behat/Definition/Loader/DefinitionLoaderInterface.php deleted file mode 100644 index 0c817d4..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Loader/DefinitionLoaderInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Loader; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Definition loader interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface DefinitionLoaderInterface -{ - /** - * Loads definitions from provided resource. - * - * @param mixed $resource - */ - public function load($resource); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/AnnotatedDefinitionProposal.php b/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/AnnotatedDefinitionProposal.php deleted file mode 100644 index 7d20657..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/AnnotatedDefinitionProposal.php +++ /dev/null @@ -1,143 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Proposal; - -use Behat\Gherkin\Node\StepNode, - Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Definition\DefinitionSnippet, - Behat\Behat\Util\Transliterator; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Annotated definitions proposal. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class AnnotatedDefinitionProposal implements DefinitionProposalInterface -{ - private static $proposedMethods = array(); - - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context) - { - return true; - } - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - * @param StepNode $step - * - * @return DefinitionSnippet - */ - public function propose(ContextInterface $context, StepNode $step) - { - $contextRefl = new \ReflectionObject($context); - $contextClass = $contextRefl->getName(); - $replacePatterns = array( - "/(?<= |^)\\\'(?:((?!\\').)*)\\\'(?= |$)/", // Single quoted strings - '/(?<= |^)\"(?:[^\"]*)\"(?= |$)/', // Double quoted strings - '/(\d+)/', // Numbers - ); - - $text = $step->getText(); - $text = preg_replace('/([\/\[\]\(\)\\\^\$\.\|\?\*\+\'])/', '\\\\$1', $text); - $regex = preg_replace( - $replacePatterns, - array( - "\\'([^\']*)\\'", - "\"([^\"]*)\"", - "(\\d+)", - ), - $text - ); - - preg_match('/' . $regex . '/', $step->getText(), $matches); - $count = count($matches) - 1; - - $methodName = preg_replace($replacePatterns, '', $text); - $methodName = Transliterator::transliterate($methodName, ' '); - $methodName = preg_replace('/[^a-zA-Z\_\ ]/', '', $methodName); - $methodName = str_replace(' ', '', ucwords($methodName)); - - if (0 !== strlen($methodName)) { - $methodName[0] = strtolower($methodName[0]); - } else { - $methodName = 'stepDefinition1'; - } - - // get method number from method name - $methodNumber = 2; - if (preg_match('/(\d+)$/', $methodName, $matches)) { - $methodNumber = intval($matches[1]); - } - - // check that proposed method name isn't arelady defined in context - while ($contextRefl->hasMethod($methodName)) { - $methodName = preg_replace('/\d+$/', '', $methodName); - $methodName .= $methodNumber++; - } - - // check that proposed method name haven't been proposed earlier - if (isset(self::$proposedMethods[$contextClass])) { - foreach (self::$proposedMethods[$contextClass] as $proposedRegex => $proposedMethod) { - if ($proposedRegex !== $regex) { - while ($proposedMethod === $methodName) { - $methodName = preg_replace('/\d+$/', '', $methodName); - $methodName .= $methodNumber++; - } - } - } - } - self::$proposedMethods[$contextClass][$regex] = $methodName; - - $args = array(); - for ($i = 0; $i < $count; $i++) { - $args[] = "\$arg" . ($i + 1); - } - - foreach ($step->getArguments() as $argument) { - if ($argument instanceof PyStringNode) { - $args[] = "PyStringNode \$string"; - } elseif ($argument instanceof TableNode) { - $args[] = "TableNode \$table"; - } - } - - $description = $this->generateSnippet($regex, $methodName, $args); - - return new DefinitionSnippet($step, $description); - } - - protected function generateSnippet($regex, $methodName, array $args) - { - return sprintf(<<<PHP - /** - * @%s /^%s$/ - */ - public function %s(%s) - { - throw new PendingException(); - } -PHP - , '%s', $regex, $methodName, implode(', ', $args) - ); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/ClosuredDefinitionProposal.php b/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/ClosuredDefinitionProposal.php deleted file mode 100644 index c80a56f..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/ClosuredDefinitionProposal.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Proposal; - -use Behat\Gherkin\Node\StepNode, - Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Context\ClosuredContextInterface, - Behat\Behat\Definition\DefinitionSnippet; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Closured definitions proposal. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ClosuredDefinitionProposal implements DefinitionProposalInterface -{ - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context) - { - return $context instanceof ClosuredContextInterface; - } - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - * @param StepNode $step - * - * @return DefinitionSnippet - */ - public function propose(ContextInterface $context, StepNode $step) - { - $text = $step->getText(); - $regex = preg_replace('/([\/\[\]\(\)\\\^\$\.\|\?\*\+\'])/', '\\\\$1', $text); - $regex = preg_replace( - array( - "/(?<= |^)\\\'(?:((?!\\').)*)\\\'(?= |$)/", // Single quoted strings - '/(?<= |^)\"(?:[^\"]*)\"(?= |$)/', // Double quoted strings - '/(\d+)/', // Numbers - ), - array( - "\\'([^\']*)\\'", - "\"([^\"]*)\"", - "(\\d+)", - ), - $regex - ); - - preg_match('/' . $regex . '/', $text, $matches); - $count = count($matches) - 1; - - $args = array("\$world"); - for ($i = 0; $i < $count; $i++) { - $args[] = "\$arg".($i + 1); - } - - foreach ($step->getArguments() as $argument) { - if ($argument instanceof PyStringNode) { - $args[] = "\$string"; - } elseif ($argument instanceof TableNode) { - $args[] = "\$table"; - } - } - - $description = sprintf(<<<PHP -\$steps->%s('/^%s$/', function(%s) { - throw new \Behat\Behat\Exception\PendingException(); -}); -PHP - , '%s', $regex, implode(', ', $args) - ); - - return new DefinitionSnippet($step, $description); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/DefinitionProposalDispatcher.php b/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/DefinitionProposalDispatcher.php deleted file mode 100644 index 3972cb1..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/DefinitionProposalDispatcher.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Proposal; - -use Behat\Gherkin\Node\StepNode; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Definition\DefinitionSnippet; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Definition proposals dispatcher. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class DefinitionProposalDispatcher -{ - private $proposals = array(); - - /** - * Adds proposal object to the dispatcher. - * - * @param DefinitionProposalInterface $proposal - */ - public function addProposal(DefinitionProposalInterface $proposal) - { - $this->proposals[] = $proposal; - } - - /** - * Returns step definition for step node. - * - * @param ContextInterface $context - * @param StepNode $step - * - * @return DefinitionSnippet - */ - public function propose(ContextInterface $context, StepNode $step) - { - foreach ($this->proposals as $proposal) { - if ($proposal->supports($context)) { - return $proposal->propose($context, $step); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/DefinitionProposalInterface.php b/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/DefinitionProposalInterface.php deleted file mode 100644 index bdbcf5d..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Proposal/DefinitionProposalInterface.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Behat\Behat\Definition\Proposal; - -use Behat\Gherkin\Node\StepNode; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Definition\DefinitionSnippet; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Definition proposal interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface DefinitionProposalInterface -{ - /** - * Checks if loader supports provided context. - * - * @param ContextInterface $context - * - * @return Boolean - */ - public function supports(ContextInterface $context); - - /** - * Loads definitions and translations from provided context. - * - * @param ContextInterface $context - * @param StepNode $step - * - * @return DefinitionSnippet - */ - public function propose(ContextInterface $context, StepNode $step); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/TransformationInterface.php b/vendor/behat/behat/src/Behat/Behat/Definition/TransformationInterface.php deleted file mode 100644 index f5a82ce..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/TransformationInterface.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Behat\Behat\Definition; - -use Behat\Behat\Context\ContextInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step transformation. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface TransformationInterface -{ - /** - * Transforms provided argument. - * - * @param string $translatedRegex - * @param ContextInterface $context - * @param mixed $argument - * - * @return mixed - */ - public function transform($translatedRegex, ContextInterface $context, $argument); -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/BehatExtension.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/BehatExtension.php deleted file mode 100644 index 3c619ea..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/BehatExtension.php +++ /dev/null @@ -1,304 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection; - -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface, - Symfony\Component\DependencyInjection\Loader\XmlFileLoader, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\ParameterBag\ParameterBag, - Symfony\Component\Config\Definition\Processor, - Symfony\Component\Config\FileLocator; - -use Behat\Behat\Extension\ExtensionManager; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat service container extension. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class BehatExtension implements ExtensionInterface -{ - protected $basePath; - protected $processor; - protected $configuration; - protected $extensionManager; - - /** - * Initializes configuration. - */ - public function __construct($basePath) - { - $this->basePath = $basePath; - $this->processor = new Processor(); - $this->configuration = new Configuration\Configuration(); - $this->extensionManager = new ExtensionManager($basePath); - } - - /** - * {@inheritdoc} - */ - public function load(array $configs, ContainerBuilder $container) - { - $this->loadDefaults($container); - $container->setParameter('behat.paths.base', $this->basePath); - - // set internal encoding to UTF-8 - if ('UTF-8' !== mb_internal_encoding()) { - mb_internal_encoding('UTF-8'); - } - - // activate and normalize specified by user extensions - foreach ($configs as $i => $config) { - if (isset($config['extensions'])) { - $extensions = array(); - foreach ($config['extensions'] as $id => $extensionConfig) { - $activationId = $this->extensionManager->activateExtension($id); - $extensions[$activationId] = $extensionConfig; - } - $configs[$i]['extensions'] = $extensions; - } - } - - // set list of extensions to container - $container->setParameter('behat.extension.classes', - $this->extensionManager->getExtensionClasses() - ); - - // normalize and merge the actual configuration - $tree = $this->configuration->getConfigTree($this->extensionManager); - $config = $this->processor->process($tree, $configs); - - if (isset($config['paths'])) { - $this->loadPathsConfiguration($config['paths'], $container); - } - if (isset($config['context'])) { - $this->loadContextConfiguration($config['context'], $container); - } - if (isset($config['formatter'])) { - $this->loadFormatterConfiguration($config['formatter'], $container); - } - if (isset($config['options'])) { - $this->loadOptionsConfiguration($config['options'], $container); - } - if (isset($config['filters'])) { - $this->loadFiltersConfiguration($config['filters'], $container); - } - if (isset($config['extensions'])) { - $this->loadExtensionsConfiguration($config['extensions'], $container); - } - - $this->resolveRelativePaths($container); - $this->addCompilerPasses($container); - } - - /** - * Loads paths configuration. - * - * @param array $config - * @param ContainerBuilder $container - */ - protected function loadPathsConfiguration(array $config, ContainerBuilder $container) - { - foreach ($config as $key => $path) { - $container->setParameter('behat.paths.'.$key, $path); - } - } - - /** - * Loads context configuration. - * - * @param array $config - * @param ContainerBuilder $container - */ - protected function loadContextConfiguration(array $config, ContainerBuilder $container) - { - if ('FeatureContext' !== $config['class']) { - $container->setParameter('behat.context.class.force', true); - } - - foreach ($config as $key => $value) { - $container->setParameter('behat.context.'.$key, $value); - } - } - - /** - * Loads formatter(s) configuration. - * - * @param array $config - * @param ContainerBuilder $container - */ - protected function loadFormatterConfiguration(array $config, ContainerBuilder $container) - { - foreach ($config as $key => $value) { - $container->setParameter('behat.formatter.'.$key, $value); - } - } - - /** - * Loads behat options configuration. - * - * @param array $config - * @param ContainerBuilder $container - */ - protected function loadOptionsConfiguration(array $config, ContainerBuilder $container) - { - foreach ($config as $key => $value) { - $container->setParameter('behat.options.'.$key, $value); - } - } - - /** - * Loads gherkin filters configuration. - * - * @param array $config - * @param ContainerBuilder $container - */ - protected function loadFiltersConfiguration(array $config, ContainerBuilder $container) - { - foreach ($config as $key => $filter) { - $container->setParameter('gherkin.filters.'.$key, $filter); - } - } - - /** - * Loads extensions configuration. - * - * @param array $config - * @param ContainerBuilder $container - */ - protected function loadExtensionsConfiguration(array $config, ContainerBuilder $container) - { - foreach ($config as $id => $extensionConfig) { - // load extension from manager - $extension = $this->extensionManager->getExtension($id); - - // create temporary container - $tempContainer = new ContainerBuilder(new ParameterBag(array( - 'behat.paths.base' => $container->getParameter('behat.paths.base'), - 'behat.extension.classes' => $container->getParameter('behat.extension.classes'), - ))); - $tempContainer->addObjectResource($extension); - - // load extension into temporary container - $extension->load($extensionConfig, $tempContainer); - - // merge temporary container into normal one - $container->merge($tempContainer); - - // add extension compiler passes - array_map(array($container, 'addCompilerPass'), $extension->getCompilerPasses()); - } - } - - /** - * Resolves relative behat.paths.* parameters in container. - * - * @param ContainerBuilder $container - */ - protected function resolveRelativePaths(ContainerBuilder $container) - { - $featuresPath = $container->getParameter('behat.paths.features'); - $bootstrapPath = $container->getParameter('behat.paths.bootstrap'); - $parameterBag = $container->getParameterBag(); - $featuresPath = $parameterBag->resolveValue($featuresPath); - $bootstrapPath = $parameterBag->resolveValue($bootstrapPath); - - if (!$this->isAbsolutePath($featuresPath)) { - $featuresPath = $this->basePath.DIRECTORY_SEPARATOR.$featuresPath; - $container->setParameter('behat.paths.features', $featuresPath); - } - if (!$this->isAbsolutePath($bootstrapPath)) { - $bootstrapPath = $this->basePath.DIRECTORY_SEPARATOR.$bootstrapPath; - $container->setParameter('behat.paths.bootstrap', $bootstrapPath); - } - } - - /** - * Adds core compiler passes to container. - * - * @param ContainerBuilder $container - */ - protected function addCompilerPasses(ContainerBuilder $container) - { - $container->addCompilerPass(new Compiler\ConsoleProcessorsPass()); - $container->addCompilerPass(new Compiler\GherkinLoadersPass()); - $container->addCompilerPass(new Compiler\ContextLoadersPass()); - $container->addCompilerPass(new Compiler\ContextClassGuessersPass()); - $container->addCompilerPass(new Compiler\ContextInitializersPass()); - $container->addCompilerPass(new Compiler\DefinitionProposalsPass()); - $container->addCompilerPass(new Compiler\FormattersPass()); - $container->addCompilerPass(new Compiler\EventSubscribersPass()); - } - - /** - * {@inheritdoc} - */ - public function getXsdValidationBasePath() - { - return __DIR__ . '/config/schema'; - } - - /** - * {@inheritdoc} - */ - public function getNamespace() - { - return 'http://behat.com/schema/dic/behat'; - } - - /** - * {@inheritdoc} - */ - public function getAlias() - { - return 'behat'; - } - - /** - * {@inheritdoc} - */ - protected function loadDefaults($container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config')); - $loader->load('behat.xml'); - - $behatClassLoaderReflection = new \ReflectionClass('Behat\Behat\Console\BehatApplication'); - $gherkinParserReflection = new \ReflectionClass('Behat\Gherkin\Parser'); - - $behatLibPath = dirname($behatClassLoaderReflection->getFilename()) . '/../../../../'; - $gherkinLibPath = dirname($gherkinParserReflection->getFilename()) . '/../../../'; - - $container->setParameter('gherkin.paths.lib', $gherkinLibPath); - $container->setParameter('behat.paths.lib', $behatLibPath); - } - - /** - * Returns whether the file path is an absolute path. - * - * @param string $file A file path - * - * @return Boolean - */ - private function isAbsolutePath($file) - { - if ($file[0] == '/' || $file[0] == '\\' - || (strlen($file) > 3 && ctype_alpha($file[0]) - && $file[1] == ':' - && ($file[2] == '\\' || $file[2] == '/') - ) - || null !== parse_url($file, PHP_URL_SCHEME) - ) { - return true; - } - - return false; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ConsoleProcessorsPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ConsoleProcessorsPass.php deleted file mode 100644 index 6040f06..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ConsoleProcessorsPass.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Command pass - registers all available command processors. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ConsoleProcessorsPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.console.processor.aggregate')) { - return; - } - $aggregator = $container->getDefinition('behat.console.processor.aggregate'); - - foreach ($container->findTaggedServiceIds('behat.console.processor') as $id => $attributes) { - $aggregator->addMethodCall('addProcessor', array(new Reference($id))); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextClassGuessersPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextClassGuessersPass.php deleted file mode 100644 index d883b1a..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextClassGuessersPass.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Context class guessers pass - registers all available context class guessers. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ContextClassGuessersPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.context.dispatcher')) { - return; - } - $dispatcher = $container->getDefinition('behat.context.dispatcher'); - - // Sorts guessers by priority (0 by default). - // Guessers with higher priority go first. - // If two guessers has same priority, then the - // lastly added one goes first. Means guessers - // from later extensions have more priority. - $prioritizedGuessers = array(); - foreach ($container->findTaggedServiceIds('behat.context.class_guesser') as $id => $attributes) { - $attributes = isset($attributes[0]) ? $attributes[0] : array(); - $priority = intval(isset($attributes['priority']) ? $attributes['priority'] : 0); - - if (!isset($prioritizedGuessers[$priority])) { - $prioritizedGuessers[$priority] = array(); - } - - array_unshift($prioritizedGuessers[$priority], new Reference($id)); - } - krsort($prioritizedGuessers); - - foreach ($prioritizedGuessers as $guessers) { - foreach ($guessers as $guesser) { - $dispatcher->addMethodCall('addClassGuesser', array($guesser)); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextInitializersPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextInitializersPass.php deleted file mode 100644 index 32467d7..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextInitializersPass.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Context initializers pass - registers all available context initializers. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ContextInitializersPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.context.dispatcher')) { - return; - } - $dispatcher = $container->getDefinition('behat.context.dispatcher'); - - foreach ($container->findTaggedServiceIds('behat.context.initializer') as $id => $attributes) { - $dispatcher->addMethodCall('addInitializer', array(new Reference($id))); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextLoadersPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextLoadersPass.php deleted file mode 100644 index 5cabc7d..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/ContextLoadersPass.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Context loaders pass - registers all available context loaders. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ContextLoadersPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.context.reader')) { - return; - } - $readerDefinition = $container->getDefinition('behat.context.reader'); - - foreach ($container->findTaggedServiceIds('behat.context.loader') as $id => $attributes) { - $readerDefinition->addMethodCall('addLoader', array(new Reference($id))); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/DefinitionProposalsPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/DefinitionProposalsPass.php deleted file mode 100644 index 05b56df..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/DefinitionProposalsPass.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Definition proposals pass - registers all available definition proposals. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class DefinitionProposalsPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.definition.proposal_dispatcher')) { - return; - } - $dispatcher = $container->getDefinition('behat.definition.proposal_dispatcher'); - - foreach ($container->findTaggedServiceIds('behat.definition.proposal') as $id => $attributes) { - $dispatcher->addMethodCall('addProposal', array(new Reference($id))); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/EventSubscribersPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/EventSubscribersPass.php deleted file mode 100644 index 0c1311c..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/EventSubscribersPass.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Event subscribers pass - registers all available event subscribers. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class EventSubscribersPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.event_dispatcher')) { - return; - } - $dispatcherDefinition = $container->getDefinition('behat.event_dispatcher'); - - foreach ($container->findTaggedServiceIds('behat.event_subscriber') as $id => $attributes) { - foreach ($attributes as $attribute) { - $priority = isset($attribute['priority']) ? intval($attribute['priority']) : 0; - $dispatcherDefinition->addMethodCall( - 'addSubscriber', array(new Reference($id), $priority) - ); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/FormattersPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/FormattersPass.php deleted file mode 100644 index f9d6f11..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/FormattersPass.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Formatters pass - registers all available formatters. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FormattersPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('behat.formatter.manager')) { - return; - } - $manager = $container->getDefinition('behat.formatter.manager'); - - foreach ($container->findTaggedServiceIds('behat.formatter.dispatcher') as $id => $attributes) { - $manager->addMethodCall('addDispatcher', array(new Reference($id))); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/GherkinLoadersPass.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/GherkinLoadersPass.php deleted file mode 100644 index 561e86a..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Compiler/GherkinLoadersPass.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference, - Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/* - * This file is part of the Behat. - * - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Gherkin loaders pass - registers all available Gherkin loaders. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class GherkinLoadersPass implements CompilerPassInterface -{ - /** - * Processes container. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('gherkin')) { - return; - } - $gherkinDefinition = $container->getDefinition('gherkin'); - - foreach ($container->findTaggedServiceIds('gherkin.loader') as $id => $attributes) { - $gherkinDefinition->addMethodCall('addLoader', array(new Reference($id))); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Configuration.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Configuration.php deleted file mode 100644 index 23a39eb..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Configuration.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Configuration; - -use Symfony\Component\Config\Definition\Builder\NodeBuilder, - Symfony\Component\Config\Definition\Builder\TreeBuilder, - Symfony\Component\Config\Definition\NodeInterface, - Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; - -use Behat\Behat\Extension\ExtensionManager; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * This class contains the configuration information for the Behat - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Configuration -{ - /** - * Generates the configuration tree. - * - * @param ExtensionManager $extensionManager - * - * @return NodeInterface - */ - public function getConfigTree(ExtensionManager $extensionManager) - { - $tree = new TreeBuilder(); - $root = $this->appendConfigChildrens($tree); - - $extensionsNode = $root->fixXmlConfig('extension')->children()->arrayNode('extensions')->children(); - foreach ($extensionManager->getExtensions() as $id => $extension) { - $extensionNode = $extensionsNode->arrayNode($id); - $extension->getConfig($extensionNode); - } - - return $tree->buildTree(); - } - - /** - * Appends config childrens to configuration tree. - * - * @param TreeBuilder $tree tree builder - * - * @return ArrayNodeDefinition - */ - protected function appendConfigChildrens(TreeBuilder $tree) - { - return $tree->root('behat')-> - children()-> - arrayNode('paths')-> - children()-> - scalarNode('features')-> - defaultValue('%behat.paths.base%/features')-> - end()-> - scalarNode('bootstrap')-> - defaultValue('%behat.paths.features%/bootstrap')-> - end()-> - end()-> - end()-> - end()-> - children()-> - arrayNode('filters')-> - children()-> - scalarNode('name')->defaultNull()->end()-> - scalarNode('tags')->defaultNull()->end()-> - end()-> - end()-> - end()-> - children()-> - arrayNode('formatter')-> - fixXmlConfig('parameter')-> - children()-> - scalarNode('name')-> - defaultValue('pretty')-> - end()-> - arrayNode('classes')-> - useAttributeAsKey('name')-> - prototype('scalar')->end()-> - end()-> - arrayNode('parameters')-> - useAttributeAsKey('name')-> - prototype('variable')->end()-> - end()-> - end()-> - end()-> - end()-> - children()-> - arrayNode('options')-> - fixXmlConfig('option')-> - children()-> - scalarNode('cache')-> - defaultNull()-> - end()-> - booleanNode('strict')-> - defaultNull()-> - end()-> - booleanNode('dry_run')-> - defaultNull()-> - end()-> - scalarNode('rerun')-> - defaultNull()-> - end()-> - scalarNode('append_snippets')-> - defaultNull()-> - end()-> - end()-> - end()-> - end()-> - children()-> - arrayNode('context')-> - fixXmlConfig('parameter')-> - children()-> - scalarNode('class')-> - defaultValue('FeatureContext')-> - end()-> - arrayNode('parameters')-> - useAttributeAsKey('name')-> - prototype('variable')->end()-> - end()-> - end()-> - end()-> - end() - ; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Loader.php b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Loader.php deleted file mode 100644 index fd9b43b..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Loader.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php - -namespace Behat\Behat\DependencyInjection\Configuration; - -use Symfony\Component\Yaml\Yaml; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat configuration reader. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Loader -{ - private $configPath; - private $profileFound; - - /** - * Constructs reader. - * - * @param string $configPath Configuration file path - */ - public function __construct($configPath = null) - { - $this->configPath = $configPath; - } - - /** - * Reads configuration sequense for specific profile. - * - * @param string $profile Profile name - * - * @return array - */ - public function loadConfiguration($profile = 'default') - { - $configs = array(); - $this->profileFound = false; - - // first is ENV config - foreach ($this->loadEnvironmentConfiguration() as $config) { - $configs[] = $config; - } - - // second is file configuration (if there is some) - if ($this->configPath) { - foreach ($this->loadFileConfiguration($this->configPath, $profile) as $config) { - $configs[] = $config; - } - } - - // if specific profile has not been found - if ('default' !== $profile && !$this->profileFound) { - throw new \RuntimeException(sprintf( - 'Configuration for profile "%s" can not be found.', $profile - )); - } - - return $configs; - } - - /** - * Loads information from ENV variable. - * - * @return array - */ - protected function loadEnvironmentConfiguration() - { - $configs = array(); - if ($envConfig = getenv('BEHAT_PARAMS')) { - parse_str($envConfig, $config); - $configs[] = $this->normalizeRawConfiguration($config); - } - - return $configs; - } - - /** - * Loads information from YAML configuration file. - * - * @param string $configPath Config file path - * @param string $profile Profile name - * - * @return array - * - * @throws \RuntimeException - */ - protected function loadFileConfiguration($configPath, $profile) - { - if (!is_file($configPath) || !is_readable($configPath)) { - throw new \RuntimeException("Config file \"$configPath\" not found"); - } - - $basePath = rtrim(dirname($configPath), DIRECTORY_SEPARATOR); - $config = Yaml::parse($configPath); - $configs = array(); - - // first load default profile from current config - if (isset($config['default'])) { - $configs[] = $config['default']; - } - - // then load profiles from import - if (isset($config['imports']) && is_array($config['imports'])) { - foreach ($config['imports'] as $path) { - foreach ($this->parseImport($basePath, $path, $profile) as $importConfig) { - $configs[] = $importConfig; - } - } - } - - // then load specific profile from current config - if ('default' !== $profile && isset($config[$profile])) { - $configs[] = $config[$profile]; - $this->profileFound = true; - } - - return $configs; - } - - private function parseImport($basePath, $path, $profile) - { - if (!file_exists($path) && file_exists($basePath.DIRECTORY_SEPARATOR.$path)) { - $path = $basePath.DIRECTORY_SEPARATOR.$path; - } - - if (!file_exists($path)) { - throw new \RuntimeException(sprintf( - 'Can not import config "%s": file not found.', $path - )); - } - - return $this->loadFileConfiguration($path, $profile); - } - - private function normalizeRawConfiguration(array $config) - { - $normalize = function($value) { - if ('true' === $value || 'false' === $value) { - return 'true' === $value; - } - - if (is_numeric($value)) { - return ctype_digit($value) ? intval($value) : floatval($value); - } - - return $value; - }; - - if (isset($config['formatter']['parameters'])) { - $config['formatter']['parameters'] = array_map( - $normalize, $config['formatter']['parameters'] - ); - } - - if (isset($config['context']['parameters'])) { - $config['context']['parameters'] = array_map( - $normalize, $config['context']['parameters'] - ); - } - - return $config; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/config/behat.xml b/vendor/behat/behat/src/Behat/Behat/DependencyInjection/config/behat.xml deleted file mode 100644 index 4105d86..0000000 --- a/vendor/behat/behat/src/Behat/Behat/DependencyInjection/config/behat.xml +++ /dev/null @@ -1,338 +0,0 @@ -<?xml version="1.0" ?> -<container xmlns="http://symfony.com/schema/dic/services" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - - <parameters> - <!-- Path parameters --> - <parameter key="gherkin.paths.lib">null</parameter> - <parameter key="gherkin.paths.i18n">%gherkin.paths.lib%/i18n.php</parameter> - - <parameter key="behat.paths.lib">null</parameter> - <parameter key="behat.paths.i18n">%behat.paths.lib%/i18n.php</parameter> - - <parameter key="behat.paths.base"></parameter> - <parameter key="behat.paths.features">%behat.paths.base%/features</parameter> - <parameter key="behat.paths.bootstrap">%behat.paths.features%/bootstrap</parameter> - - <!-- Format parameters --> - <parameter key="behat.formatter.name">pretty</parameter> - <parameter key="behat.formatter.parameters" type="collection"></parameter> - <parameter key="behat.formatter.classes" type="collection"></parameter> - <parameter key="behat.formatter.dispatcher.class">Behat\Behat\Formatter\FormatterDispatcher</parameter> - <parameter key="behat.formatter.manager.class">Behat\Behat\Formatter\FormatterManager</parameter> - - <!-- Options --> - <parameter key="behat.options.cache">null</parameter> - <parameter key="behat.options.rerun">null</parameter> - <parameter key="behat.options.strict">null</parameter> - <parameter key="behat.options.dry_run">null</parameter> - <parameter key="behat.options.append_snippets">null</parameter> - - <!-- Gherkin Parser --> - <parameter key="gherkin.class">Behat\Gherkin\Gherkin</parameter> - <parameter key="gherkin.parser.class">Behat\Gherkin\Parser</parameter> - <parameter key="gherkin.lexer.class">Behat\Gherkin\Lexer</parameter> - <parameter key="gherkin.loader.gherkin_file.class">Behat\Gherkin\Loader\GherkinFileLoader</parameter> - <parameter key="gherkin.loader.directory.class">Behat\Gherkin\Loader\DirectoryLoader</parameter> - <parameter key="gherkin.loader.feature_suite.class">Behat\Behat\Gherkin\Loader\FeatureSuiteLoader</parameter> - <parameter key="gherkin.keywords.class">Behat\Gherkin\Keywords\CachedArrayKeywords</parameter> - <parameter key="gherkin.keywords.path">%gherkin.paths.i18n%</parameter> - <parameter key="gherkin.keywords.dumper.class">Behat\Gherkin\Keywords\KeywordsDumper</parameter> - <parameter key="gherkin.filters.name">null</parameter> - <parameter key="gherkin.filters.tags">null</parameter> - - <!-- Core --> - <parameter key="behat.extension.classes" type="collection"></parameter> - <parameter key="behat.console.command.class">Behat\Behat\Console\Command\BehatCommand</parameter> - <parameter key="behat.console.processor.aggregate.class">Behat\Behat\Console\Processor\AggregateProcessor</parameter> - <parameter key="behat.console.processor.locator.class">Behat\Behat\Console\Processor\LocatorProcessor</parameter> - <parameter key="behat.console.processor.context.reader.class">Behat\Behat\Console\Processor\ContextReaderProcessor</parameter> - <parameter key="behat.console.processor.init.class">Behat\Behat\Console\Processor\InitProcessor</parameter> - <parameter key="behat.console.processor.format.class">Behat\Behat\Console\Processor\FormatProcessor</parameter> - <parameter key="behat.console.processor.help.class">Behat\Behat\Console\Processor\HelpProcessor</parameter> - <parameter key="behat.console.processor.gherkin.class">Behat\Behat\Console\Processor\GherkinProcessor</parameter> - <parameter key="behat.console.processor.run.class">Behat\Behat\Console\Processor\RunProcessor</parameter> - - <!-- Context --> - <parameter key="behat.context.class">FeatureContext</parameter> - <parameter key="behat.context.class.force">false</parameter> - <parameter key="behat.context.parameters" type="collection"></parameter> - <parameter key="behat.context.dispatcher.class">Behat\Behat\Context\ContextDispatcher</parameter> - <parameter key="behat.context.reader.class">Behat\Behat\Context\ContextReader</parameter> - <parameter key="behat.context.class_guesser.predefined.class">Behat\Behat\Context\ClassGuesser\PredefinedClassGuesser</parameter> - <parameter key="behat.context.loader.translated.class">Behat\Behat\Context\Loader\TranslatedLoader</parameter> - <parameter key="behat.context.loader.annotated.class">Behat\Behat\Context\Loader\AnnotatedLoader</parameter> - <parameter key="behat.context.loader.closured.class">Behat\Behat\Context\Loader\ClosuredLoader</parameter> - - <!-- Definition Dispathcer --> - <parameter key="behat.definition.dispatcher.class">Behat\Behat\Definition\DefinitionDispatcher</parameter> - <parameter key="behat.definition.loader.closured.class">Behat\Behat\Definition\Loader\ClosuredDefinitionLoader</parameter> - <parameter key="behat.definition.proposal_dispatcher.class">Behat\Behat\Definition\Proposal\DefinitionProposalDispatcher</parameter> - <parameter key="behat.definition.proposal.closured.class">Behat\Behat\Definition\Proposal\ClosuredDefinitionProposal</parameter> - <parameter key="behat.definition.proposal.annotated.class">Behat\Behat\Definition\Proposal\AnnotatedDefinitionProposal</parameter> - - <!-- Hook Dispatcher --> - <parameter key="behat.hook.dispatcher.class">Behat\Behat\Hook\HookDispatcher</parameter> - <parameter key="behat.hook.loader.closured.class">Behat\Behat\Hook\Loader\ClosuredHookLoader</parameter> - - <!-- Tester --> - <parameter key="behat.tester.feature.class">Behat\Behat\Tester\FeatureTester</parameter> - <parameter key="behat.tester.background.class">Behat\Behat\Tester\BackgroundTester</parameter> - <parameter key="behat.tester.scenario.class">Behat\Behat\Tester\ScenarioTester</parameter> - <parameter key="behat.tester.outline.class">Behat\Behat\Tester\OutlineTester</parameter> - <parameter key="behat.tester.step.class">Behat\Behat\Tester\StepTester</parameter> - - <!-- Translator --> - <parameter key="behat.translator.class">Symfony\Component\Translation\Translator</parameter> - <parameter key="behat.translator.message_selector.class">Symfony\Component\Translation\MessageSelector</parameter> - <parameter key="behat.translator.xliff_loader.class">Symfony\Component\Translation\Loader\XliffFileLoader</parameter> - <parameter key="behat.translator.yaml_loader.class">Symfony\Component\Translation\Loader\YamlFileLoader</parameter> - <parameter key="behat.translator.php_loader.class">Symfony\Component\Translation\Loader\PhpFileLoader</parameter> - <parameter key="behat.translator.array_loader.class">Symfony\Component\Translation\Loader\ArrayLoader</parameter> - - <!-- Event Dispatcher --> - <parameter key="behat.event_dispatcher.class">Symfony\Component\EventDispatcher\EventDispatcher</parameter> - - <!-- DataCollector --> - <parameter key="behat.logger.class">Behat\Behat\DataCollector\LoggerDataCollector</parameter> - - <!-- HelpPrinter --> - <parameter key="behat.help_printer.definitions.class">Behat\Behat\HelpPrinter\DefinitionsPrinter</parameter> - <parameter key="behat.help_printer.story_syntax.class">Behat\Behat\HelpPrinter\StorySyntaxPrinter</parameter> - </parameters> - <services> - <!-- Gherkin Parser --> - <service id="gherkin" class="%gherkin.class%" /> - <service id="gherkin.parser" class="%gherkin.parser.class%"> - <argument type="service" id="gherkin.lexer" /> - </service> - <service id="gherkin.lexer" class="%gherkin.lexer.class%"> - <argument type="service" id="gherkin.keywords" /> - </service> - <service id="gherkin.keywords" class="%gherkin.keywords.class%"> - <argument>%gherkin.paths.lib%/i18n.php</argument> - </service> - <service id="gherkin.loader.gherkin_file" class="%gherkin.loader.gherkin_file.class%"> - <argument type="service" id="gherkin.parser" /> - <tag name="gherkin.loader" /> - </service> - <service id="gherkin.loader.feature_suite" class="%gherkin.loader.feature_suite.class%"> - <argument>%behat.paths.features%</argument> - <argument type="service" id="gherkin" /> - <tag name="gherkin.loader" /> - </service> - <service id="gherkin.loader.directory" class="%gherkin.loader.directory.class%"> - <argument type="service" id="gherkin" /> - <tag name="gherkin.loader" /> - </service> - - <!-- Core --> - <service id="behat.console.command" class="%behat.console.command.class%"> - <argument type="service" id="service_container" /> - <argument type="service" id="behat.console.processor.aggregate" /> - </service> - - <!-- Processors --> - <service id="behat.console.processor.aggregate" class="%behat.console.processor.aggregate.class%" /> - <service id="behat.console.processor.locator" class="%behat.console.processor.locator.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - <service id="behat.console.processor.init" class="%behat.console.processor.init.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - <service id="behat.console.processor.format" class="%behat.console.processor.format.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - <service id="behat.console.processor.context.reader" class="%behat.console.processor.context.reader.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - <service id="behat.console.processor.help" class="%behat.console.processor.help.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - <service id="behat.console.processor.gherkin" class="%behat.console.processor.gherkin.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - <service id="behat.console.processor.run" class="%behat.console.processor.run.class%"> - <argument type="service" id="service_container" /> - <tag name="behat.console.processor" /> - </service> - - <!-- Context --> - <service id="behat.context.reader" class="%behat.context.reader.class%"> - <argument type="service" id="behat.context.dispatcher" /> - </service> - <service id="behat.context.dispatcher" class="%behat.context.dispatcher.class%"> - <argument>%behat.context.parameters%</argument> - </service> - <service id="behat.context.class_guesser.predefined" class="%behat.context.class_guesser.predefined.class%"> - <argument>%behat.context.class%</argument> - <argument>%behat.context.class.force%</argument> - <tag name="behat.context.class_guesser" priority="10" /> - </service> - <service id="behat.context.loader.translated" class="%behat.context.loader.translated.class%"> - <argument type="service" id="behat.translator" /> - <tag name="behat.context.loader" /> - </service> - <service id="behat.context.loader.annotated" class="%behat.context.loader.annotated.class%"> - <argument type="service" id="behat.definition.dispatcher" /> - <argument type="service" id="behat.hook.dispatcher" /> - <tag name="behat.context.loader" /> - </service> - <service id="behat.context.loader.closured" class="%behat.context.loader.closured.class%"> - <argument type="service"> - <service class="%behat.definition.loader.closured.class%"> - <argument type="service" id="behat.definition.dispatcher" /> - </service> - </argument> - <argument type="service"> - <service class="%behat.hook.loader.closured.class%"> - <argument type="service" id="behat.hook.dispatcher" /> - </service> - </argument> - <tag name="behat.context.loader" /> - </service> - - <!-- Definition Dispatcher --> - <service id="behat.definition.dispatcher" class="%behat.definition.dispatcher.class%"> - <argument type="service" id="behat.definition.proposal_dispatcher" /> - <argument type="service" id="behat.translator" /> - </service> - <service id="behat.definition.proposal_dispatcher" class="%behat.definition.proposal_dispatcher.class%" /> - <service id="behat.definition.proposal.closured" class="%behat.definition.proposal.closured.class%"> - <tag name="behat.definition.proposal" /> - </service> - <service id="behat.definition.proposal.annotated" class="%behat.definition.proposal.annotated.class%"> - <tag name="behat.definition.proposal" /> - </service> - - <!-- Tester --> - <service id="behat.tester.feature" class="%behat.tester.feature.class%" scope="prototype"> - <argument type="service" id="service_container" /> - </service> - <service id="behat.tester.background" class="%behat.tester.background.class%" scope="prototype"> - <argument type="service" id="service_container" /> - </service> - <service id="behat.tester.scenario" class="%behat.tester.scenario.class%" scope="prototype"> - <argument type="service" id="service_container" /> - </service> - <service id="behat.tester.outline" class="%behat.tester.outline.class%" scope="prototype"> - <argument type="service" id="service_container" /> - </service> - <service id="behat.tester.step" class="%behat.tester.step.class%" scope="prototype"> - <argument type="service" id="service_container" /> - </service> - - <!-- Format --> - <service id="behat.formatter.manager" class="%behat.formatter.manager.class%"> - <argument type="service" id="behat.translator" /> - <argument type="service" id="behat.event_dispatcher" /> - </service> - <service id="behat.formatter.dispatcher.pretty" class="%behat.formatter.dispatcher.class%"> - <argument>Behat\Behat\Formatter\PrettyFormatter</argument> - <argument>pretty</argument> - <argument>Prints the feature as is.</argument> - <tag name="behat.formatter.dispatcher" /> - </service> - <service id="behat.formatter.dispatcher.progress" class="%behat.formatter.dispatcher.class%"> - <argument>Behat\Behat\Formatter\ProgressFormatter</argument> - <argument>progress</argument> - <argument>Prints one character per step.</argument> - <tag name="behat.formatter.dispatcher" /> - </service> - <service id="behat.formatter.dispatcher.html" class="%behat.formatter.dispatcher.class%"> - <argument>Behat\Behat\Formatter\HtmlFormatter</argument> - <argument>html</argument> - <argument>Generates a nice looking HTML report.</argument> - <tag name="behat.formatter.dispatcher" /> - </service> - <service id="behat.formatter.dispatcher.junit" class="%behat.formatter.dispatcher.class%"> - <argument>Behat\Behat\Formatter\JUnitFormatter</argument> - <argument>junit</argument> - <argument>Generates a report similar to Ant+JUnit.</argument> - <tag name="behat.formatter.dispatcher" /> - </service> - <service id="behat.formatter.dispatcher.failed" class="%behat.formatter.dispatcher.class%"> - <argument>Behat\Behat\Formatter\FailedScenariosFormatter</argument> - <argument>failed</argument> - <argument>Prints list of failed scenarios.</argument> - <tag name="behat.formatter.dispatcher" /> - </service> - <service id="behat.formatter.dispatcher.snippets" class="%behat.formatter.dispatcher.class%"> - <argument>Behat\Behat\Formatter\SnippetsFormatter</argument> - <argument>snippets</argument> - <argument>Prints only snippets for undefined steps.</argument> - <tag name="behat.formatter.dispatcher" /> - </service> - - <!-- Event Dispatcher --> - <service id="behat.event_dispatcher" class="%behat.event_dispatcher.class%" /> - - <!-- Hook Dispatcher --> - <service id="behat.hook.dispatcher" class="%behat.hook.dispatcher.class%"> - <tag name="behat.event_subscriber" priority="10" /> - </service> - - <!-- DataCollector --> - <service id="behat.logger" class="%behat.logger.class%"> - <tag name="behat.event_subscriber" priority="0" /> - </service> - - <!-- HelpPrinter --> - <service id="behat.help_printer.definitions" class="%behat.help_printer.definitions.class%"> - <argument type="service" id="behat.definition.dispatcher" /> - <argument type="service" id="behat.translator" /> - </service> - <service id="behat.help_printer.story_syntax" class="%behat.help_printer.story_syntax.class%"> - <argument type="service"> - <service class="%gherkin.keywords.dumper.class%"> - <argument type="service" id="gherkin.keywords" /> - </service> - </argument> - </service> - - <!-- Translator --> - <service id="behat.translator" class="%behat.translator.class%"> - <argument>en</argument> - <argument type="service"> - <service class="%behat.translator.message_selector.class%" /> - </argument> - - <call method="setFallbackLocale"> - <argument>en</argument> - </call> - - <!-- Translation loaders --> - <call method="addLoader"> - <argument>xliff</argument> - <argument type="service"> - <service class="%behat.translator.xliff_loader.class%" /> - </argument> - </call> - <call method="addLoader"> - <argument>yaml</argument> - <argument type="service"> - <service class="%behat.translator.yaml_loader.class%" /> - </argument> - </call> - <call method="addLoader"> - <argument>php</argument> - <argument type="service"> - <service class="%behat.translator.php_loader.class%" /> - </argument> - </call> - <call method="addLoader"> - <argument>array</argument> - <argument type="service"> - <service class="%behat.translator.array_loader.class%" /> - </argument> - </call> - </service> - </services> -</container> diff --git a/vendor/behat/behat/src/Behat/Behat/Event/BackgroundEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/BackgroundEvent.php deleted file mode 100644 index 15ceee8..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/BackgroundEvent.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Gherkin\Node\BackgroundNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Background event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class BackgroundEvent extends Event implements EventInterface -{ - private $background; - private $result; - private $skipped; - - /** - * Initializes background event. - * - * @param BackgroundNode $background - * @param integer $result - * @param Boolean $skipped - */ - public function __construct(BackgroundNode $background, $result = null, $skipped = false) - { - $this->background = $background; - $this->result = $result; - $this->skipped = $skipped; - } - - /** - * Returns background node. - * - * @return BackgroundNode - */ - public function getBackground() - { - return $this->background; - } - - /** - * Return background tester result code. - * - * @return integer - */ - public function getResult() - { - return $this->result; - } - - /** - * Checks whether background were skipped. - * - * @return Boolean - */ - public function isSkipped() - { - return $this->skipped; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/EventInterface.php b/vendor/behat/behat/src/Behat/Behat/Event/EventInterface.php deleted file mode 100644 index 06536db..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/EventInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat event interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface EventInterface -{ -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/FeatureEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/FeatureEvent.php deleted file mode 100644 index 96d167d..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/FeatureEvent.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Gherkin\Node\FeatureNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Feature event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FeatureEvent extends Event implements EventInterface -{ - private $feature; - private $result; - private $parameters; - - /** - * Initializes feature event. - * - * @param FeatureNode $feature - * @param mixed $parameters - * @param integer $result - */ - public function __construct(FeatureNode $feature, $parameters, $result = null) - { - $this->feature = $feature; - $this->parameters = $parameters; - $this->result = $result; - } - - /** - * Returns feature node. - * - * @return FeatureNode - */ - public function getFeature() - { - return $this->feature; - } - - /** - * Returns context parameters. - * - * @return mixed - */ - public function getContextParameters() - { - return $this->parameters; - } - - /** - * Returns feature tester result code. - * - * @return integer - */ - public function getResult() - { - return $this->result; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/OutlineEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/OutlineEvent.php deleted file mode 100644 index 5023e16..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/OutlineEvent.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Gherkin\Node\OutlineNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Outline event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class OutlineEvent extends Event implements EventInterface -{ - private $outline; - private $result; - - /** - * Initializes outline event. - * - * @param OutlineNode $outline - * @param integer $result - */ - public function __construct(OutlineNode $outline, $result = null) - { - $this->outline = $outline; - $this->result = $result; - } - - /** - * Returns outline node. - * - * @return OutlineNode - */ - public function getOutline() - { - return $this->outline; - } - - /** - * Returns outline tester result code. - * - * @return integer - */ - public function getResult() - { - return $this->result; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/OutlineExampleEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/OutlineExampleEvent.php deleted file mode 100644 index 1b1f027..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/OutlineExampleEvent.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Behat\Context\ContextInterface; - -use Behat\Gherkin\Node\OutlineNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Outline example event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class OutlineExampleEvent extends OutlineEvent implements EventInterface -{ - private $iteration; - private $context; - private $skipped; - - /** - * Initializes outline example event. - * - * @param OutlineNode $outline - * @param integer $iteration iteration number - * @param ContextInterface $context - * @param integer $result - * @param Boolean $skipped - */ - public function __construct(OutlineNode $outline, $iteration, ContextInterface $context, - $result = null, $skipped = false) - { - parent::__construct($outline, $result); - - $this->iteration = $iteration; - $this->context = $context; - $this->skipped = $skipped; - } - - /** - * Returns example number on which event occurs. - * - * @return integer - */ - public function getIteration() - { - return $this->iteration; - } - - /** - * Returns context object. - * - * @return ContextInterface - */ - public function getContext() - { - return $this->context; - } - - /** - * Checks whether outline example were skipped. - * - * @return Boolean - */ - public function isSkipped() - { - return $this->skipped; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/ScenarioEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/ScenarioEvent.php deleted file mode 100644 index 5bbc79e..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/ScenarioEvent.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Behat\Context\ContextInterface; - -use Behat\Gherkin\Node\ScenarioNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Scenario event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ScenarioEvent extends Event implements EventInterface -{ - private $scenario; - private $context; - private $result; - private $skipped; - - /** - * Initializes scenario event. - * - * @param ScenarioNode $scenario - * @param ContextInterface $context - * @param integer $result - * @param Boolean $skipped - */ - public function __construct(ScenarioNode $scenario, ContextInterface $context, $result = null, - $skipped = false) - { - $this->scenario = $scenario; - $this->context = $context; - $this->result = $result; - $this->skipped = $skipped; - } - - /** - * Returns scenario node. - * - * @return ScenarioNode - */ - public function getScenario() - { - return $this->scenario; - } - - /** - * Returns context object. - * - * @return ContextInterface - */ - public function getContext() - { - return $this->context; - } - - /** - * Returns scenario tester result code. - * - * @return integer - */ - public function getResult() - { - return $this->result; - } - - /** - * Checks whether scenario were skipped. - * - * @return Boolean - */ - public function isSkipped() - { - return $this->skipped; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/StepEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/StepEvent.php deleted file mode 100644 index 2b77620..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/StepEvent.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Behat\Context\ContextInterface, - Behat\Behat\Definition\DefinitionInterface, - Behat\Behat\Definition\DefinitionSnippet; - -use Behat\Gherkin\Node\StepNode, - Behat\Gherkin\Node\ScenarioNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class StepEvent extends Event implements EventInterface -{ - const PASSED = 0; - const SKIPPED = 1; - const PENDING = 2; - const UNDEFINED = 3; - const FAILED = 4; - - private $step; - private $parent; - private $context; - private $result; - private $definition; - private $exception; - private $snippet; - - /** - * Initializes step event. - * - * @param StepNode $step - * @param ScenarioNode $parent - * @param ContextInterface $context - * @param integer $result - * @param DefinitionInterface $definition - * @param \Exception $exception - * @param DefinitionSnippet $snippet - */ - public function __construct(StepNode $step, ScenarioNode $parent, ContextInterface $context, - $result = null, DefinitionInterface $definition = null, - \Exception $exception = null, DefinitionSnippet $snippet = null) - { - $this->step = $step; - $this->parent = $parent; - $this->context = $context; - $this->result = $result; - $this->definition = $definition; - $this->exception = $exception; - $this->snippet = $snippet; - } - - /** - * Returns step node. - * - * @return StepNode - */ - public function getStep() - { - return $this->step; - } - - /** - * Returns logical parent to the step, which is always a ScenarioNode. - * - * @return ScenarioNode - */ - public function getLogicalParent() - { - return $this->parent; - } - - /** - * Returns context object. - * - * @return ContextInterface - */ - public function getContext() - { - return $this->context; - } - - /** - * Returns step tester result code. - * - * @return integer - */ - public function getResult() - { - return $this->result; - } - - /** - * Returns step definition object. - * - * @return DefinitionInterface - */ - public function getDefinition() - { - return $this->definition; - } - - /** - * Checks whether event contains step definition. - * - * @return Boolean - */ - public function hasDefinition() - { - return null !== $this->getDefinition(); - } - - /** - * Returns step tester exception. - * - * @return \Exception - */ - public function getException() - { - return $this->exception; - } - - /** - * Checks whether event contains exception. - * - * @return Boolean - */ - public function hasException() - { - return null !== $this->getException(); - } - - /** - * Returns step snippet. - * - * @return DefinitionSnippet - */ - public function getSnippet() - { - return $this->snippet; - } - - /** - * Checks whether event contains snippet. - * - * @return Boolean - */ - public function hasSnippet() - { - return null !== $this->getSnippet(); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Event/SuiteEvent.php b/vendor/behat/behat/src/Behat/Behat/Event/SuiteEvent.php deleted file mode 100644 index 01a9b80..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Event/SuiteEvent.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Behat\Behat\Event; - -use Symfony\Component\EventDispatcher\Event; - -use Behat\Behat\DataCollector\LoggerDataCollector; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Suite event. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class SuiteEvent extends Event implements EventInterface -{ - private $logger; - private $completed; - private $parameters; - - /** - * Initializes suite event. - * - * @param LoggerDataCollector $logger suite logger - * @param mixed $parameters context parameters - * @param Boolean $completed is suite completed - */ - public function __construct(LoggerDataCollector $logger, $parameters, $completed) - { - $this->logger = $logger; - $this->parameters = $parameters; - $this->completed = (Boolean) $completed; - } - - /** - * Returns suite logger. - * - * @return LoggerDataCollector - */ - public function getLogger() - { - return $this->logger; - } - - /** - * Returns context parameters. - * - * @return mixed - */ - public function getContextParameters() - { - return $this->parameters; - } - - /** - * Checks whether test suite was completed entirely. - * - * @return Boolean - */ - public function isCompleted() - { - return $this->completed; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/AmbiguousException.php b/vendor/behat/behat/src/Behat/Behat/Exception/AmbiguousException.php deleted file mode 100644 index caa9e59..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/AmbiguousException.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Ambiguous exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class AmbiguousException extends BehaviorException -{ - protected $text; - protected $matches = array(); - - /** - * Initializes ambiguous exception. - * - * @param string $text step description - * @param array $matches ambigious matches (array of Definition's) - */ - public function __construct($text, array $matches) - { - $this->text = $text; - $this->matches = $matches; - - $message = sprintf("Ambiguous match of \"%s\":", $text); - foreach ($matches as $definition) { - $message .= sprintf("\nto `%s` from %s", $definition->getRegex(), $definition->getPath()); - } - - parent::__construct($message); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/BehaviorException.php b/vendor/behat/behat/src/Behat/Behat/Exception/BehaviorException.php deleted file mode 100644 index 29366a8..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/BehaviorException.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract Behat exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class BehaviorException extends Exception -{ -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/ErrorException.php b/vendor/behat/behat/src/Behat/Behat/Exception/ErrorException.php deleted file mode 100644 index aa9a766..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/ErrorException.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Error handler exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ErrorException extends BehaviorException -{ - private $levels = array( - E_WARNING => 'Warning', - E_NOTICE => 'Notice', - E_USER_ERROR => 'User Error', - E_USER_WARNING => 'User Warning', - E_USER_NOTICE => 'User Notice', - E_STRICT => 'Runtime Notice', - E_RECOVERABLE_ERROR => 'Catchable Fatal Error', - ); - - /** - * Initializes error handler exception. - * - * @param string $level error level - * @param string $message error message - * @param string $file error file - * @param string $line error line - */ - public function __construct($level, $message, $file, $line) - { - parent::__construct(sprintf('%s: %s in %s line %d', - isset($this->levels[$level]) ? $this->levels[$level] : $level, - $message, - $file, - $line - )); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/Exception.php b/vendor/behat/behat/src/Behat/Behat/Exception/Exception.php deleted file mode 100644 index a8f0b47..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/Exception.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Exception extends \Exception -{ -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/FormatterException.php b/vendor/behat/behat/src/Behat/Behat/Exception/FormatterException.php deleted file mode 100644 index aa0d638..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/FormatterException.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat Formatter exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FormatterException extends Exception -{ -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/PendingException.php b/vendor/behat/behat/src/Behat/Behat/Exception/PendingException.php deleted file mode 100644 index 2077cb9..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/PendingException.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pending exception (throw this to mark step as "pending"). - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class PendingException extends BehaviorException -{ - /** - * Initializes pending exception. - * - * @param string $text TODO text - */ - public function __construct($text = 'write pending definition') - { - parent::__construct(sprintf('TODO: %s', $text)); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/RedundantException.php b/vendor/behat/behat/src/Behat/Behat/Exception/RedundantException.php deleted file mode 100644 index e8e42e4..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/RedundantException.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -use Behat\Behat\Definition\DefinitionInterface; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Redundant exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class RedundantException extends BehaviorException -{ - /** - * Initializes redundant exception. - * - * @param DefinitionInterface $step2 duplicate step definition - * @param DefinitionInterface $step1 firstly matched step definition - */ - public function __construct(DefinitionInterface $step2, DefinitionInterface $step1) - { - $message = sprintf("Step \"%s\" is already defined in %s\n\n%s\n%s", - $step2->getRegex(), $step1->getPath(), $step1->getPath(), $step2->getPath() - ); - - parent::__construct($message); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Exception/UndefinedException.php b/vendor/behat/behat/src/Behat/Behat/Exception/UndefinedException.php deleted file mode 100644 index ae15370..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Exception/UndefinedException.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Behat\Behat\Exception; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Undefined exception. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class UndefinedException extends BehaviorException -{ - protected $text; - - /** - * Initialize undefined exception. - * - * @param string $text step text - */ - public function __construct($text) - { - $this->text = $text; - parent::__construct(sprintf('Undefined step "%s"', $text)); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Extension/Extension.php b/vendor/behat/behat/src/Behat/Behat/Extension/Extension.php deleted file mode 100644 index 628ac90..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Extension/Extension.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Behat\Behat\Extension; - -use Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Loader\XmlFileLoader, - Symfony\Component\DependencyInjection\Loader\YamlFileLoader, - Symfony\Component\Config\FileLocator, - Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat base extension class. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Extension implements ExtensionInterface -{ - /** - * Loads a specific configuration. - * - * @param array $config Extension configuration hash (from behat.yml) - * @param ContainerBuilder $container ContainerBuilder instance - */ - public function load(array $config, ContainerBuilder $container) - { - if (file_exists($config = __DIR__.DIRECTORY_SEPARATOR.'services.xml')) { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config')); - $loader->load($config); - } - if (file_exists($config = __DIR__.DIRECTORY_SEPARATOR.'services.yml')) { - $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/config')); - $loader->load($config); - } - } - - /** - * Setups configuration for current extension. - * - * @param ArrayNodeDefinition $builder - */ - public function getConfig(ArrayNodeDefinition $builder) - { - $builder - ->useAttributeAsKey('name') - ->prototype('variable') - ; - } - - /** - * Returns compiler passes used by this extension. - * - * @return array - */ - public function getCompilerPasses() - { - return array(); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionInterface.php b/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionInterface.php deleted file mode 100644 index 12406e0..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Behat\Behat\Extension; - -use Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Behat extension interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ExtensionInterface -{ - /** - * Loads a specific configuration. - * - * @param array $config Extension configuration hash (from behat.yml) - * @param ContainerBuilder $container ContainerBuilder instance - */ - public function load(array $config, ContainerBuilder $container); - - /** - * Setups configuration for current extension. - * - * @param ArrayNodeDefinition $builder - */ - public function getConfig(ArrayNodeDefinition $builder); - - /** - * Returns compiler passes used by this extension. - * - * @return array - */ - public function getCompilerPasses(); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionManager.php b/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionManager.php deleted file mode 100644 index 9390a00..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionManager.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Behat\Behat\Extension; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Extensions manager. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ExtensionManager -{ - private $basePath; - private $extensions = array(); - - /** - * Initializes manager. - * - * @param string $basePath base path where to search extension files - */ - public function __construct($basePath) - { - $this->basePath = $basePath; - } - - /** - * Activate extension by its id. - * - * @param string $id phar file name, php file name, class name - */ - public function activateExtension($id) - { - $extensionId = strtolower(preg_replace('/[^a-zA-Z0-9]/', '_', $id)); - if (!isset($this->extensions[$extensionId])) { - $this->extensions[$extensionId] = $this->initializeExtension($id); - } - - return $extensionId; - } - - /** - * Returns specific extension by its id. - * - * @param string $id - * - * @return ExtensionInterface - * - * @throws \RuntimeException - */ - public function getExtension($id) - { - if (!isset($this->extensions[$id])) { - throw new \RuntimeException( - sprintf('Extension "%s" has not been activated.', $id) - ); - } - - return $this->extensions[$id]; - } - - /** - * Returns all activated extensions. - * - * @return array - */ - public function getExtensions() - { - return $this->extensions; - } - - /** - * Returns activated extension classes. - * - * @return array - */ - public function getExtensionClasses() - { - return array_unique( - array_map( - function($extension) { - return get_class($extension); - }, - $this->extensions - ) - ); - } - - /** - * Initializes extension by id. - * - * @param string $id - * - * @return ExtensionInterface - * - * @throws \RuntimeException - */ - protected function initializeExtension($id) - { - $extension = null; - if (class_exists($id)) { - $extension = new $id; - } elseif (file_exists($this->basePath.DIRECTORY_SEPARATOR.$id)) { - $extension = require($this->basePath.DIRECTORY_SEPARATOR.$id); - } else { - $extension = require($id); - } - - if (null === $extension) { - throw new \RuntimeException(sprintf( - '"%s" extension could not be found.', $id - )); - } - if (!is_object($extension)) { - throw new \RuntimeException(sprintf( - '"%s" extension could not be initialized.', $id - )); - } - if (!$extension instanceof ExtensionInterface) { - throw new \RuntimeException(sprintf( - '"%s" extension class should implement ExtensionInterface.', - get_class($extension) - )); - } - - return $extension; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/ConsoleFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/ConsoleFormatter.php deleted file mode 100644 index 2b06961..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/ConsoleFormatter.php +++ /dev/null @@ -1,303 +0,0 @@ -<?php - -namespace Behat\Behat\Formatter; - -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag, - Symfony\Component\EventDispatcher\EventDispatcher, - Symfony\Component\EventDispatcher\Event, - Symfony\Component\Translation\Translator, - Symfony\Component\Console\Output\StreamOutput, - Symfony\Component\Console\Formatter\OutputFormatterStyle; - -use Behat\Behat\Event\StepEvent, - Behat\Behat\Exception\FormatterException, - Behat\Behat\Console\Formatter\OutputFormatter; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Console formatter. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class ConsoleFormatter implements FormatterInterface -{ - /** - * Formatter parameters. - * - * @var ParameterBag - */ - protected $parameters; - - private $translator; - private $console; - - /** - * Initialize formatter. - * - * @uses getDefaultParameters() - */ - public function __construct() - { - $defaultLanguage = null; - if (($locale = getenv('LANG')) && preg_match('/^([a-z]{2})/', $locale, $matches)) { - $defaultLanguage = $matches[1]; - } - - $this->parameters = new ParameterBag(array_merge(array( - 'language' => $defaultLanguage, - 'verbose' => false, - 'decorated' => true, - 'time' => true, - 'base_path' => null, - 'support_path' => null, - 'output' => null, - 'output_path' => null, - 'output_styles' => array(), - 'output_decorate' => null, - 'snippets' => true, - 'snippets_paths' => false, - 'paths' => true, - 'expand' => false, - 'multiline_arguments' => true, - ), $this->getDefaultParameters())); - } - - /** - * Set formatter translator. - * - * @param Translator $translator - */ - final public function setTranslator(Translator $translator) - { - $this->translator = $translator; - } - - /** - * Returns default parameters to construct ParameterBag. - * - * @return array - */ - abstract protected function getDefaultParameters(); - - /** - * Checks if current formatter has parameter. - * - * @param string $name - * - * @return Boolean - */ - final public function hasParameter($name) - { - return $this->parameters->has($name); - } - - /** - * Sets formatter parameter. - * - * @param string $name - * @param mixed $value - */ - final public function setParameter($name, $value) - { - $this->parameters->set($name, $value); - } - - /** - * Returns parameter value. - * - * @param string $name - * - * @return mixed - */ - final public function getParameter($name) - { - return $this->parameters->get($name); - } - - /** - * Returns color code from tester result status code. - * - * @param integer $result tester result status code - * - * @return string passed|pending|skipped|undefined|failed - */ - final protected function getResultColorCode($result) - { - switch ($result) { - case StepEvent::PASSED: return 'passed'; - case StepEvent::SKIPPED: return 'skipped'; - case StepEvent::PENDING: return 'pending'; - case StepEvent::UNDEFINED: return 'undefined'; - case StepEvent::FAILED: return 'failed'; - } - } - - /** - * Writes message(s) to output console. - * - * @param string|array $messages message or array of messages - * @param Boolean $newline do we need to append newline after messages - * - * @uses getWritingConsole() - */ - final protected function write($messages, $newline = false) - { - $this->getWritingConsole()->write($messages, $newline); - } - - /** - * Writes newlined message(s) to output console. - * - * @param string|array $messages message or array of messages - */ - final protected function writeln($messages = '') - { - $this->write($messages, true); - } - - /** - * Returns console instance, prepared to write. - * - * @return StreamOutput - * - * @uses createOutputConsole() - * @uses configureOutputConsole() - */ - final protected function getWritingConsole() - { - if (null === $this->console) { - $this->console = $this->createOutputConsole(); - } - $this->configureOutputConsole($this->console); - - return $this->console; - } - - /** - * Returns new output stream for console. - * - * Override this method & call flushOutputConsole() to write output in another stream - * - * @return resource - * - * @throws FormatterException - */ - protected function createOutputStream() - { - if (is_resource($stream = $this->parameters->get('output'))) { - return $stream; - } - - $outputPath = $this->parameters->get('output_path'); - - if (null === $outputPath) { - $stream = fopen('php://stdout', 'w'); - } elseif (!is_dir($outputPath)) { - $stream = fopen($outputPath, 'w'); - } else { - throw new FormatterException(sprintf( - 'Filename expected as "output_path" parameter of "%s" formatter, but got: "%s"', - basename(str_replace('\\', '/', get_class($this))), $outputPath - )); - } - - return $stream; - } - - /** - * Returns new output console. - * - * @return StreamOutput - * - * @uses createOutputStream() - */ - protected function createOutputConsole() - { - $stream = $this->createOutputStream(); - $format = new OutputFormatter(); - - // set user-defined styles - foreach ($this->parameters->get('output_styles') as $name => $options) { - $style = new OutputFormatterStyle(); - - if (isset($options[0])) { - $style->setForeground($options[0]); - } - if (isset($options[1])) { - $style->setBackground($options[1]); - } - if (isset($options[2])) { - $style->setOptions($options[2]); - } - - $format->setStyle($name, $style); - } - - return new StreamOutput( - $stream, StreamOutput::VERBOSITY_NORMAL, $this->parameters->get('output_decorate'), $format - ); - } - - /** - * Configure output console parameters. - * - * @param StreamOutput $console - */ - protected function configureOutputConsole(StreamOutput $console) - { - $console->setVerbosity( - $this->parameters->get('verbose') ? StreamOutput::VERBOSITY_VERBOSE : StreamOutput::VERBOSITY_NORMAL - ); - $console->getFormatter()->setDecorated( - $this->parameters->get('decorated') - ); - } - - /** - * Clear output console, so on next write formatter will need to init (create) it again. - * - * @see createOutputConsole() - */ - final protected function flushOutputConsole() - { - $this->console = null; - } - - /** - * Translates message to output language. - * - * @param string $message message to translate - * @param array $parameters message parameters - * - * @return string - */ - final protected function translate($message, array $parameters = array()) - { - return $this->translator->trans( - $message, $parameters, 'behat', $this->parameters->get('language') - ); - } - - /** - * Translates numbered message to output language. - * - * @param string $message message specification to translate - * @param string $number choice number - * @param array $parameters message parameters - * - * @return string - */ - final protected function translateChoice($message, $number, array $parameters = array()) - { - return $this->translator->transChoice( - $message, $number, $parameters, 'behat', $this->parameters->get('language') - ); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/FailedScenariosFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/FailedScenariosFormatter.php deleted file mode 100644 index e4e03af..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/FailedScenariosFormatter.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -namespace Behat\Behat\Formatter; - -use Behat\Behat\Event\ScenarioEvent, - Behat\Behat\Event\OutlineExampleEvent, - Behat\Behat\Event\OutlineEvent, - Behat\Behat\Event\StepEvent; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Failed scenarios formatter. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FailedScenariosFormatter extends ConsoleFormatter -{ - /** - * {@inheritdoc} - */ - protected function getDefaultParameters() - { - return array(); - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - $events = array('afterScenario', 'afterOutlineExample'); - - return array_combine($events, $events); - } - - /** - * Listens to "scenario.after" event. - * - * @param ScenarioEvent $event - */ - public function afterScenario(ScenarioEvent $event) - { - if (StepEvent::FAILED === $event->getResult()) { - $scenario = $event->getScenario(); - $this->writeln($scenario->getFile().':'.$scenario->getLine()); - } - } - - /** - * Listens to "outline.example.after" event. - * - * @param ScenarioEvent $event - */ - public function afterOutlineExample(OutlineExampleEvent $event) - { - if (StepEvent::FAILED === $event->getResult()) { - $outline = $event->getOutline(); - $examples = $outline->getExamples(); - $lines = $examples->getRowLines(); - $this->writeln($outline->getFile().':'.$lines[$event->getIteration() + 1]); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterDispatcher.php b/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterDispatcher.php deleted file mode 100644 index 7e7198a..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterDispatcher.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -namespace Behat\Behat\Formatter; - -use Symfony\Component\Translation\Translator, - Symfony\Component\EventDispatcher\EventDispatcher; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Formatter dispatcher. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FormatterDispatcher -{ - private $class; - private $name; - private $description; - - /** - * Initializes formatter dispatcher. - * - * @param string $class Formatter class - * @param string $name Name of the formatter - * @param string $description Formatter description - * - * @throws \RuntimeException - */ - public function __construct($class, $name = null, $description = null) - { - $refClass = new \ReflectionClass($class); - if (!$refClass->implementsInterface('Behat\Behat\Formatter\FormatterInterface')) { - throw new \RuntimeException(sprintf( - 'Formatter class "%s" should implement FormatterInterface', $class - )); - } - - $this->class = $class; - $this->name = null !== $name ? strtolower($name) : null; - $this->description = $description; - } - - /** - * Returns formatter name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns formatter description. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Returns formatter class. - * - * @return string - */ - public function getClass() - { - return $this->class; - } - - /** - * Initializes formatter instance. - * - * @return FormatterInterface - */ - public function createFormatter() - { - $class = $this->class; - - return new $class(); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterInterface.php b/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterInterface.php deleted file mode 100644 index 19ca76d..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterInterface.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace Behat\Behat\Formatter; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface, - Symfony\Component\Translation\Translator; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Formatter interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface FormatterInterface extends EventSubscriberInterface -{ - /** - * Set formatter translator. - * - * @param Translator $translator - */ - public function setTranslator(Translator $translator); - - /** - * Checks if current formatter has parameter. - * - * @param string $name - * - * @return Boolean - */ - public function hasParameter($name); - - /** - * Sets formatter parameter. - * - * @param string $name - * @param mixed $value - */ - public function setParameter($name, $value); - - /** - * Returns parameter value. - * - * @param string $name - * - * @return mixed - */ - public function getParameter($name); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterManager.php b/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterManager.php deleted file mode 100644 index 0749983..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/FormatterManager.php +++ /dev/null @@ -1,143 +0,0 @@ -<?php - -namespace Behat\Behat\Formatter; - -use Behat\Behat\Formatter\FormatterInterface; - -use Symfony\Component\Translation\Translator, - Symfony\Component\EventDispatcher\EventDispatcher; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Formatters manager. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class FormatterManager -{ - private $translator; - private $eventDispatcher; - private $dispatchers = array(); - private $formatters = array(); - - /** - * Initializes format manager. - * - * @param Translator $translator - * @param EventDispatcher $eventDispatcher - */ - public function __construct(Translator $translator, EventDispatcher $eventDispatcher) - { - $this->translator = $translator; - $this->eventDispatcher = $eventDispatcher; - } - - /** - * Adds formatter dispatcher to the manager. - * - * @param FormatterDispatcher $dispatcher Formatter dispatcher - */ - public function addDispatcher(FormatterDispatcher $dispatcher) - { - $this->dispatchers[$dispatcher->getName()] = $dispatcher; - } - - /** - * Returns registered formatter dispatchers. - * - * @return array - */ - public function getDispatchers() - { - return $this->dispatchers; - } - - /** - * Inits specific formatter class by format name. - * - * @param string $name - * - * @return array - * - * @throws \RuntimeException - */ - public function initFormatter($name) - { - if (class_exists($name)) { - $dispatcher = new FormatterDispatcher($name); - } elseif (isset($this->dispatchers[strtolower($name)])) { - $dispatcher = $this->dispatchers[strtolower($name)]; - } else { - throw new \RuntimeException("Unknown formatter: \"$name\". " . - 'Available formatters are: ' . implode(', ', array_keys($this->dispatchers)) - ); - } - - $formatter = $dispatcher->createFormatter(); - $formatter->setTranslator($this->translator); - $this->eventDispatcher->addSubscriber($formatter, -5); - - return $this->formatters[] = $formatter; - } - - /** - * Sets specific parameter in all initialized formatters. - * - * @param string $param - * @param mixed $value - */ - public function setFormattersParameter($param, $value) - { - foreach ($this->formatters as $formatter) { - $formatter->setParameter($param, $value); - } - } - - /** - * Returns all initialized formatters. - * - * @return array - */ - public function getFormatters() - { - return $this->formatters; - } - - /** - * Disables formatter. - * - * @param FormatterInterface $formatter - */ - public function disableFormatter(FormatterInterface $formatter) - { - $unsubscribe = array($this->eventDispatcher, 'removeSubscriber'); - $this->formatters = array_filter($this->formatters, - function($registered) use($formatter, $unsubscribe) { - if ($registered === $formatter) { - call_user_func($unsubscribe, $registered); - - return false; - } - - return true; - } - ); - } - - /** - * Disables all initialized formatters. - */ - public function disableFormatters() - { - foreach ($this->getFormatters() as $formatter) { - $this->disableFormatter($formatter); - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/HtmlFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/HtmlFormatter.php deleted file mode 100644 index 3bf793e..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/HtmlFormatter.php +++ /dev/null @@ -1,1017 +0,0 @@ -<?php - -namespace Behat\Behat\Formatter; - -use Behat\Behat\Definition\DefinitionInterface, - Behat\Behat\DataCollector\LoggerDataCollector, - Behat\Behat\Definition\DefinitionSnippet, - Behat\Behat\Exception\UndefinedException; - -use Behat\Gherkin\Node\AbstractNode, - Behat\Gherkin\Node\FeatureNode, - Behat\Gherkin\Node\BackgroundNode, - Behat\Gherkin\Node\AbstractScenarioNode, - Behat\Gherkin\Node\OutlineNode, - Behat\Gherkin\Node\ScenarioNode, - Behat\Gherkin\Node\StepNode, - Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; - -/* - * This file is part of the Behat. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * HTML formatter. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class HtmlFormatter extends PrettyFormatter -{ - /** - * Deffered footer template part. - * - * @var string - */ - protected $footer; - - /** - * {@inheritdoc} - */ - protected function getDefaultParameters() - { - return array( - 'template_path' => null - ); - } - - /** - * {@inheritdoc} - */ - protected function printSuiteHeader(LoggerDataCollector $logger) - { - $this->parameters->set('decorated', false); - - $template = $this->getHtmlTemplate(); - $header = mb_substr($template, 0, mb_strpos($template, '{{content}}')); - $this->footer = mb_substr($template, mb_strpos($template, '{{content}}') + 11); - - $this->writeln($header); - } - - /** - * {@inheritdoc} - */ - protected function printSuiteFooter(LoggerDataCollector $logger) - { - $this->printSummary($logger); - $this->writeln($this->footer); - } - - /** - * {@inheritdoc} - */ - protected function printFeatureHeader(FeatureNode $feature) - { - $this->writeln('<div class="feature">'); - - parent::printFeatureHeader($feature); - } - - /** - * {@inheritdoc} - */ - protected function printFeatureOrScenarioTags(AbstractNode $node) - { - if (count($tags = $node->getOwnTags())) { - $this->writeln('<ul class="tags">'); - foreach ($tags as $tag) { - $this->writeln("<li>@$tag</li>"); - } - $this->writeln('</ul>'); - } - } - - /** - * {@inheritdoc} - */ - protected function printFeatureName(FeatureNode $feature) - { - $this->writeln('<h2>'); - $this->writeln('<span class="keyword">' . $feature->getKeyword() . ': </span>'); - $this->writeln('<span class="title">' . $feature->getTitle() . '</span>'); - $this->writeln('</h2>'); - } - - /** - * {@inheritdoc} - */ - protected function printFeatureDescription(FeatureNode $feature) - { - $lines = explode("\n", $feature->getDescription()); - - $this->writeln('<p>'); - foreach ($lines as $line) { - $this->writeln(htmlspecialchars($line) . "<br />"); - } - $this->writeln('</p>'); - } - - /** - * {@inheritdoc} - */ - protected function printFeatureFooter(FeatureNode $feature) - { - $this->writeln('</div>'); - } - - /** - * {@inheritdoc} - */ - protected function printBackgroundHeader(BackgroundNode $background) - { - $this->writeln('<div class="scenario background">'); - - $this->printScenarioName($background); - } - - /** - * {@inheritdoc} - */ - protected function printBackgroundFooter(BackgroundNode $background) - { - $this->writeln('</ol>'); - $this->writeln('</div>'); - } - - /** - * {@inheritdoc} - */ - protected function printScenarioHeader(ScenarioNode $scenario) - { - $this->writeln('<div class="scenario">'); - - $this->printFeatureOrScenarioTags($scenario); - $this->printScenarioName($scenario); - } - - /** - * {@inheritdoc} - */ - protected function printScenarioName(AbstractScenarioNode $scenario) - { - $this->writeln('<h3>'); - $this->writeln('<span class="keyword">' . $scenario->getKeyword() . ': </span>'); - if ($scenario->getTitle()) { - $this->writeln('<span class="title">' . $scenario->getTitle() . '</span>'); - } - $this->printScenarioPath($scenario); - $this->writeln('</h3>'); - - $this->writeln('<ol>'); - } - - /** - * {@inheritdoc} - */ - protected function printScenarioFooter(ScenarioNode $scenario) - { - $this->writeln('</ol>'); - $this->writeln('</div>'); - } - - /** - * {@inheritdoc} - */ - protected function printOutlineHeader(OutlineNode $outline) - { - $this->writeln('<div class="scenario outline">'); - - $this->printFeatureOrScenarioTags($outline); - $this->printScenarioName($outline); - } - - /** - * {@inheritdoc} - */ - protected function printOutlineSteps(OutlineNode $outline) - { - parent::printOutlineSteps($outline); - $this->writeln('</ol>'); - } - - /** - * {@inheritdoc} - */ - protected function printOutlineExamplesSectionHeader(TableNode $examples) - { - $this->writeln('<div class="examples">'); - - if (!$this->getParameter('expand')) { - $this->writeln('<h4>' . $examples->getKeyword() . '</h4>'); - $this->writeln('<table>'); - $this->writeln('<thead>'); - $this->printColorizedTableRow($examples->getRow(0), 'skipped'); - $this->writeln('</thead>'); - $this->writeln('<tbody>'); - } - } - - /** - * {@inheritdoc} - */ - protected function printOutlineExampleResult(TableNode $examples, $iteration, $result, $isSkipped) - { - if (!$this->getParameter('expand')) { - $color = $this->getResultColorCode($result); - - $this->printColorizedTableRow($examples->getRow($iteration + 1), $color); - $this->printOutlineExampleResultExceptions($examples, $this->delayedStepEvents); - } else { - $this->write('<h4>' . $examples->getKeyword() . ': '); - foreach ($examples->getRow($iteration + 1) as $value) { - $this->write('<span>' . $value . '</span>'); - } - $this->writeln('</h4>'); - - foreach ($this->delayedStepEvents as $event) { - $this->writeln('<ol>'); - $this->printStep( - $event->getStep(), - $event->getResult(), - $event->getDefinition(), - $event->getSnippet(), - $event->getException() - ); - $this->writeln('</ol>'); - } - } - } - - /** - * {@inheritdoc} - */ - protected function printOutlineExampleResultExceptions(TableNode $examples, array $events) - { - $colCount = count($examples->getRow(0)); - - foreach ($events as $event) { - $exception = $event->getException(); - if ($exception && !$exception instanceof UndefinedException) { - $error = $this->relativizePathsInString($exception->getMessage()); - - $this->writeln('<tr class="failed exception">'); - $this->writeln('<td colspan="' . $colCount . '">'); - $this->writeln('<pre class="backtrace">' . htmlspecialchars($error) . '</pre>'); - $this->writeln('</td>'); - $this->writeln('</tr>'); - } - } - } - - /** - * {@inheritdoc} - */ - protected function printOutlineFooter(OutlineNode $outline) - { - if (!$this->getParameter('expand')) { - $this->writeln('</tbody>'); - $this->writeln('</table>'); - } - $this->writeln('</div>'); - $this->writeln('</div>'); - } - - /** - * {@inheritdoc} - */ - protected function printStep(StepNode $step, $result, DefinitionInterface $definition = null, - $snippet = null, \Exception $exception = null) - { - $this->writeln('<li class="' . $this->getResultColorCode($result) . '">'); - - parent::printStep($step, $result, $definition, $snippet, $exception); - - $this->writeln('</li>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepBlock(StepNode $step, DefinitionInterface $definition = null, $color) - { - $this->writeln('<div class="step">'); - - $this->printStepName($step, $definition, $color); - if (null !== $definition) { - $this->printStepDefinitionPath($step, $definition); - } - - $this->writeln('</div>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepName(StepNode $step, DefinitionInterface $definition = null, $color) - { - $type = $step->getType(); - $text = $this->inOutlineSteps ? $step->getCleanText() : $step->getText(); - - if (null !== $definition) { - $text = $this->colorizeDefinitionArguments($text, $definition, $color); - } - - $this->writeln('<span class="keyword">' . $type . ' </span>'); - $this->writeln('<span class="text">' . $text . '</span>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepDefinitionPath(StepNode $step, DefinitionInterface $definition) - { - if ($this->getParameter('paths')) { - if ($this->hasParameter('paths_base_url')) { - $this->printPathLink($definition); - } else { - $this->printPathComment($this->relativizePathsInString($definition->getPath())); - } - } - } - - /** - * {@inheritdoc} - */ - protected function printStepPyStringArgument(PyStringNode $pystring, $color = null) - { - $this->writeln('<pre class="argument">' . htmlspecialchars((string) $pystring) . '</pre>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepTableArgument(TableNode $table, $color = null) - { - $this->writeln('<table class="argument">'); - - $this->writeln('<thead>'); - $headers = $table->getRow(0); - $this->printColorizedTableRow($headers, 'row'); - $this->writeln('</thead>'); - - $this->writeln('<tbody>'); - foreach ($table->getHash() as $row) { - $this->printColorizedTableRow($row, 'row'); - } - $this->writeln('</tbody>'); - - $this->writeln('</table>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepException(\Exception $exception, $color) - { - $error = $this->relativizePathsInString($exception->getMessage()); - - $this->writeln('<pre class="backtrace">' . htmlspecialchars($error) . '</pre>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepSnippet(DefinitionSnippet $snippet) - { - $this->writeln('<div class="snippet"><pre>' . htmlspecialchars($snippet) . '</pre></div>'); - } - - /** - * {@inheritdoc} - */ - protected function colorizeDefinitionArguments($text, DefinitionInterface $definition, $color) - { - $regex = $definition->getRegex(); - $paramColor = $color . '_param'; - - // If it's just a string - skip - if ('/' !== substr($regex, 0, 1)) { - return $text; - } - - // Find arguments with offsets - $matches = array(); - preg_match($regex, $text, $matches, PREG_OFFSET_CAPTURE); - array_shift($matches); - - // Replace arguments with colorized ones - $shift = 0; - $lastReplacementPosition = 0; - foreach ($matches as $key => $match) { - if (!is_numeric($key) || -1 === $match[1] || false !== strpos($match[0], '<')) { - continue; - } - - $offset = $match[1] + $shift; - $value = $match[0]; - - // Skip inner matches - if ($lastReplacementPosition > $offset) { - continue; - } - $lastReplacementPosition = $offset + strlen($value); - - $begin = substr($text, 0, $offset); - $end = substr($text, $offset + strlen($value)); - $format = "{+strong class=\"$paramColor\"-}%s{+/strong-}"; - $text = sprintf('%s'.$format.'%s', $begin, $value, $end); - - // Keep track of how many extra characters are added - $shift += strlen($format) - 2; - $lastReplacementPosition += strlen($format) - 2; - } - - // Replace "<", ">" with colorized ones - $text = preg_replace('/(<[^>]+>)/', "{+strong class=\"$paramColor\"-}\$1{+/strong-}", $text); - $text = htmlspecialchars($text, ENT_NOQUOTES); - $text = strtr($text, array('{+' => '<', '-}' => '>')); - - return $text; - } - - /** - * {@inheritdoc} - */ - protected function printColorizedTableRow($row, $color) - { - $this->writeln('<tr class="' . $color . '">'); - - foreach ($row as $column) { - $this->writeln('<td>' . $column . '</td>'); - } - - $this->writeln('</tr>'); - } - - /** - * Prints path link, which links to the source containing the step definition. - * - * @param DefinitionInterface $definition - */ - protected function printPathLink(DefinitionInterface $definition) - { - $url = $this->getParameter('paths_base_url') - . $this->relativizePathsInString($definition->getCallbackReflection()->getFileName()); - $path = $this->relativizePathsInString($definition->getPath()); - $this->writeln('<span class="path"><a href="' . $url . '">' . $path . '</a></span>'); - } - - /** - * {@inheritdoc} - */ - protected function printPathComment($path, $indentCount = 0) - { - $this->writeln('<span class="path">' . $path . '</span>'); - } - - /** - * {@inheritdoc} - */ - protected function printSummary(LoggerDataCollector $logger) - { - $results = $logger->getScenariosStatuses(); - $result = $results['failed'] > 0 ? 'failed' : 'passed'; - $this->writeln('<div class="summary '.$result.'">'); - - $this->writeln('<div class="counters">'); - parent::printSummary($logger); - $this->writeln('</div>'); - - $this->writeln(<<<'HTML' -<div class="switchers"> - <a href="javascript:void(0)" id="behat_show_all">[+] all</a> - <a href="javascript:void(0)" id="behat_hide_all">[-] all</a> -</div> -HTML -); - - $this->writeln('</div>'); - } - - /** - * {@inheritdoc} - */ - protected function printScenariosSummary(LoggerDataCollector $logger) - { - $this->writeln('<p class="scenarios">'); - parent::printScenariosSummary($logger); - $this->writeln('</p>'); - } - - /** - * {@inheritdoc} - */ - protected function printStepsSummary(LoggerDataCollector $logger) - { - $this->writeln('<p class="steps">'); - parent::printStepsSummary($logger); - $this->writeln('</p>'); - } - - /** - * {@inheritdoc} - */ - protected function printTimeSummary(LoggerDataCollector $logger) - { - $this->writeln('<p class="time">'); - parent::printTimeSummary($logger); - $this->writeln('</p>'); - } - - /** - * {@inheritdoc} - */ - protected function printStatusesSummary(array $statusesStatistics) - { - $statuses = array(); - $statusTpl = '<strong class="%s">%s</strong>'; - foreach ($statusesStatistics as $status => $count) { - if ($count) { - $transStatus = $this->translateChoice( - "{$status}_count", $count, array('%1%' => $count) - ); - $statuses[] = sprintf($statusTpl, $status, $transStatus); - } - } - if (count($statuses)) { - $this->writeln(' ('.implode(', ', $statuses).')'); - } - } - - /** - * Get HTML template. - * - * @return string - */ - protected function getHtmlTemplate() - { - $templatePath = $this->parameters->get('template_path') - ?: $this->parameters->get('support_path') . DIRECTORY_SEPARATOR . 'html.tpl'; - - if (file_exists($templatePath)) { - return file_get_contents($templatePath); - } - - return -'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns ="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> - <title>Behat Test Suite - - - - - -
- {{content}} -
- - - -'; - } - - /** - * Get HTML template style. - * - * @return string - */ - protected function getHtmlTemplateStyle() - { - return <<<'HTMLTPL' - body { - margin:0px; - padding:0px; - position:relative; - padding-top:75px; - } - #behat { - float:left; - font-family: Georgia, serif; - font-size:18px; - line-height:26px; - width:100%; - } - #behat .statistics { - float:left; - width:100%; - margin-bottom:15px; - } - #behat .statistics p { - text-align:right; - padding:5px 15px; - margin:0px; - border-right:10px solid #000; - } - #behat .statistics.failed p { - border-color:#C20000; - } - #behat .statistics.passed p { - border-color:#3D7700; - } - #behat .feature { - margin:15px; - } - #behat h2, #behat h3, #behat h4 { - margin:0px 0px 5px 0px; - padding:0px; - font-family:Georgia; - } - #behat h2 .title, #behat h3 .title, #behat h4 .title { - font-weight:normal; - } - #behat .path { - font-size:10px; - font-weight:normal; - font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace !important; - color:#999; - padding:0px 5px; - float:right; - } - #behat .path a:link, - #behat .path a:visited { - color:#999; - } - #behat .path a:hover, - #behat .path a:active { - background-color:#000; - color:#fff; - } - #behat h3 .path { - margin-right:4%; - } - #behat ul.tags { - font-size:14px; - font-weight:bold; - color:#246AC1; - list-style:none; - margin:0px; - padding:0px; - } - #behat ul.tags li { - display:inline; - } - #behat ul.tags li:after { - content:' '; - } - #behat ul.tags li:last-child:after { - content:''; - } - #behat .feature > p { - margin-top:0px; - margin-left:20px; - } - #behat .scenario { - margin-left:20px; - margin-bottom:20px; - } - #behat .scenario > ol, - #behat .scenario .examples > ol { - margin:0px; - list-style:none; - padding:0px; - } - #behat .scenario > ol { - margin-left:20px; - } - #behat .scenario > ol:after, - #behat .scenario .examples > ol:after { - content:''; - display:block; - clear:both; - } - #behat .scenario > ol li, - #behat .scenario .examples > ol li { - float:left; - width:95%; - padding-left:5px; - border-left:5px solid; - margin-bottom:4px; - } - #behat .scenario > ol li .argument, - #behat .scenario .examples > ol li .argument { - margin:10px 20px; - font-size:16px; - overflow:hidden; - } - #behat .scenario > ol li table.argument, - #behat .scenario .examples > ol li table.argument { - border:1px solid #d2d2d2; - } - #behat .scenario > ol li table.argument thead td, - #behat .scenario .examples > ol li table.argument thead td { - font-weight: bold; - } - #behat .scenario > ol li table.argument td, - #behat .scenario .examples > ol li table.argument td { - padding:5px 10px; - background:#f3f3f3; - } - #behat .scenario > ol li .keyword, - #behat .scenario .examples > ol li .keyword { - font-weight:bold; - } - #behat .scenario > ol li .path, - #behat .scenario .examples > ol li .path { - float:right; - } - #behat .scenario .examples { - margin-top:20px; - margin-left:40px; - } - #behat .scenario .examples h4 span { - font-weight:normal; - background:#f3f3f3; - color:#999; - padding:0 5px; - margin-left:10px; - } - #behat .scenario .examples table { - margin-left:20px; - } - #behat .scenario .examples table thead td { - font-weight:bold; - text-align:center; - } - #behat .scenario .examples table td { - padding:2px 10px; - font-size:16px; - } - #behat .scenario .examples table .failed.exception td { - border-left:5px solid #000; - border-color:#C20000 !important; - padding-left:0px; - } - pre { - font-family:monospace; - } - .snippet { - font-size:14px; - color:#000; - margin-left:20px; - } - .backtrace { - font-size:12px; - line-height:18px; - color:#000; - overflow:hidden; - margin-left:20px; - padding:15px; - border-left:2px solid #C20000; - background: #fff; - margin-right:15px; - } - #behat .passed { - background:#DBFFB4; - border-color:#65C400 !important; - color:#3D7700; - } - #behat .failed { - background:#FFFBD3; - border-color:#C20000 !important; - color:#C20000; - } - #behat .undefined, #behat .pending { - border-color:#FAF834 !important; - background:#FCFB98; - color:#000; - } - #behat .skipped { - background:lightCyan; - border-color:cyan !important; - color:#000; - } - #behat .summary { - position: absolute; - top: 0px; - left: 0px; - width:100%; - font-family: Arial, sans-serif; - font-size: 14px; - line-height: 18px; - } - #behat .summary .counters { - padding: 10px; - border-top: 0px; - border-bottom: 0px; - border-right: 0px; - border-left: 5px; - border-style: solid; - height: 52px; - overflow: hidden; - } - #behat .summary .switchers { - position: absolute; - right: 15px; - top: 25px; - } - #behat .summary .switcher { - text-decoration: underline; - cursor: pointer; - } - #behat .summary .switchers a { - margin-left: 10px; - color: #000; - } - #behat .summary .switchers a:hover { - text-decoration:none; - } - #behat .summary p { - margin:0px; - } - #behat .jq-toggle > .scenario, - #behat .jq-toggle > ol, - #behat .jq-toggle > .examples { - display:none; - } - #behat .jq-toggle-opened > .scenario, - #behat .jq-toggle-opened > ol, - #behat .jq-toggle-opened > .examples { - display:block; - } - #behat .jq-toggle > h2, - #behat .jq-toggle > h3 { - cursor:pointer; - } - #behat .jq-toggle > h2:after, - #behat .jq-toggle > h3:after { - content:' |+'; - font-weight:bold; - } - #behat .jq-toggle-opened > h2:after, - #behat .jq-toggle-opened > h3:after { - content:' |-'; - font-weight:bold; - } -HTMLTPL; - } - - /** - * Get HTML template style. - * - * @return string - */ - protected function getHtmlTemplatePrintStyle() - { - return <<<'HTMLTPL' - body { - padding:0px; - } - - #behat { - font-size:11px; - } - - #behat .jq-toggle > .scenario, - #behat .jq-toggle > .scenario .examples, - #behat .jq-toggle > ol { - display:block; - } - - #behat .summary { - position:relative; - } - - #behat .summary .counters { - border:none; - } - - #behat .summary .switchers { - display:none; - } - - #behat .step .path { - display:none; - } - - #behat .jq-toggle > h2:after, - #behat .jq-toggle > h3:after { - content:''; - font-weight:bold; - } - - #behat .jq-toggle-opened > h2:after, - #behat .jq-toggle-opened > h3:after { - content:''; - font-weight:bold; - } - - #behat .scenario > ol li, - #behat .scenario .examples > ol li { - border-left:none; - } -HTMLTPL; - } - - /** - * Get HTML template script. - * - * @return string - */ - protected function getHtmlTemplateScript() - { - return <<<'HTMLTPL' - $(document).ready(function(){ - $('#behat .feature h2').click(function(){ - $(this).parent().toggleClass('jq-toggle-opened'); - }).parent().addClass('jq-toggle'); - - $('#behat .scenario h3').click(function(){ - $(this).parent().toggleClass('jq-toggle-opened'); - }).parent().addClass('jq-toggle'); - - $('#behat_show_all').click(function(){ - $('#behat .feature').addClass('jq-toggle-opened'); - $('#behat .scenario').addClass('jq-toggle-opened'); - }); - - $('#behat_hide_all').click(function(){ - $('#behat .feature').removeClass('jq-toggle-opened'); - $('#behat .scenario').removeClass('jq-toggle-opened'); - }); - - $('#behat .summary .counters .scenarios .passed') - .addClass('switcher') - .click(function(){ - var $scenario = $('.feature .scenario:not(:has(.failed, .pending))'); - var $feature = $scenario.parent(); - - $('#behat_hide_all').click(); - - $scenario.addClass('jq-toggle-opened'); - $feature.addClass('jq-toggle-opened'); - }); - - $('#behat .summary .counters .steps .passed') - .addClass('switcher') - .click(function(){ - var $scenario = $('.feature .scenario:has(.passed)'); - var $feature = $scenario.parent(); - - $('#behat_hide_all').click(); - - $scenario.addClass('jq-toggle-opened'); - $feature.addClass('jq-toggle-opened'); - }); - - $('#behat .summary .counters .failed') - .addClass('switcher') - .click(function(){ - var $scenario = $('.feature .scenario:has(.failed)'); - var $feature = $scenario.parent(); - - $('#behat_hide_all').click(); - - $scenario.addClass('jq-toggle-opened'); - $feature.addClass('jq-toggle-opened'); - }); - - $('#behat .summary .counters .skipped') - .addClass('switcher') - .click(function(){ - var $scenario = $('.feature .scenario:has(.skipped)'); - var $feature = $scenario.parent(); - - $('#behat_hide_all').click(); - - $scenario.addClass('jq-toggle-opened'); - $feature.addClass('jq-toggle-opened'); - }); - - $('#behat .summary .counters .pending') - .addClass('switcher') - .click(function(){ - var $scenario = $('.feature .scenario:has(.pending)'); - var $feature = $scenario.parent(); - - $('#behat_hide_all').click(); - - $scenario.addClass('jq-toggle-opened'); - $feature.addClass('jq-toggle-opened'); - }); - }); -HTMLTPL; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/JUnitFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/JUnitFormatter.php deleted file mode 100644 index c693841..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/JUnitFormatter.php +++ /dev/null @@ -1,297 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Progress formatter. - * - * @author Konstantin Kudryashov - */ -class JUnitFormatter extends ConsoleFormatter -{ - /** - * Current XML filename. - * - * @var string - */ - protected $filename; - /** - * Test cases. - * - * @var array - */ - protected $testcases = array(); - /** - * Total steps count. - * - * @var integer - */ - protected $stepsCount = 0; - /** - * Total exceptions count. - * - * @var integer - */ - protected $exceptionsCount = 0; - /** - * Step exceptions. - * - * @var array - */ - protected $exceptions = array(); - /** - * Feature start time. - * - * @var float - */ - protected $featureStartTime; - /** - * Scenario start time. - * - * @var float - */ - protected $scenarioStartTime; - - /** - * {@inheritdoc} - */ - protected function getDefaultParameters() - { - return array(); - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - $events = array( - 'beforeFeature', 'afterFeature', 'beforeScenario', 'afterScenario', - 'beforeOutlineExample', 'afterOutlineExample', 'afterStep' - ); - - return array_combine($events, $events); - } - - /** - * Listens to "feature.before" event. - * - * @param FeatureEvent $event - * - * @uses printTestSuiteHeader() - */ - public function beforeFeature(FeatureEvent $event) - { - $feature = $event->getFeature(); - $this->filename = 'TEST-' . basename($feature->getFile(), '.feature') . '.xml'; - - $this->printTestSuiteHeader($feature); - - $this->stepsCount = 0; - $this->testcases = array(); - $this->exceptionsCount = 0; - $this->featureStartTime = microtime(true); - } - - /** - * Listens to "feature.after" event. - * - * @param FeatureEvent $event - * - * @uses printTestSuiteFooter() - * @uses flushOutputConsole() - */ - public function afterFeature(FeatureEvent $event) - { - $this->printTestSuiteFooter($event->getFeature(), microtime(true) - $this->featureStartTime); - $this->flushOutputConsole(); - } - - /** - * Listens to "scenario.before" event. - * - * @param ScenarioEvent $event - */ - public function beforeScenario(ScenarioEvent $event) - { - $this->scenarioStartTime = microtime(true); - } - - /** - * Listens to "scenario.after" event. - * - * @param ScenarioEvent $event - * - * @uses printTestCase() - */ - public function afterScenario(ScenarioEvent $event) - { - $this->printTestCase($event->getScenario(), microtime(true) - $this->scenarioStartTime, $event); - } - - /** - * Listens to "outline.example.before" event. - * - * @param OutlineExampleEvent $event - */ - public function beforeOutlineExample(OutlineExampleEvent $event) - { - $this->scenarioStartTime = microtime(true); - } - - /** - * Listens to "outline.example.after" event. - * - * @param OutlineExampleEvent $event - * - * @uses printTestCase() - */ - public function afterOutlineExample(OutlineExampleEvent $event) - { - $this->printTestCase($event->getOutline(), microtime(true) - $this->scenarioStartTime, $event); - } - - /** - * Listens to "step.after" event. - * - * @param StepEvent $event - */ - public function afterStep(StepEvent $event) - { - if ($event->hasException()) { - $this->exceptions[] = $event->getException(); - $this->exceptionsCount++; - } - - ++$this->stepsCount; - } - - /** - * Prints testsuite header. - * - * @param FeatureNode $feature - */ - protected function printTestSuiteHeader(FeatureNode $feature) - { - $this->writeln(''); - } - - /** - * Prints testsuite footer. - * - * @param FeatureNode $feature - * @param float $time - */ - protected function printTestSuiteFooter(FeatureNode $feature, $time) - { - $suiteStats = sprintf('classname="behat.features" errors="0" failures="%d" name="%s" file="%s" tests="%d" time="%F"', - $this->exceptionsCount, - htmlspecialchars($feature->getTitle()), - htmlspecialchars($feature->getFile()), - $this->stepsCount, - $time - ); - - $this->writeln(""); - $this->writeln(implode("\n", $this->testcases)); - $this->writeln(''); - } - - /** - * Prints testcase. - * - * @param ScenarioNode $scenario - * @param float $time - * @param EventInterface $event - */ - protected function printTestCase(ScenarioNode $scenario, $time, EventInterface $event) - { - $className = $scenario->getFeature()->getTitle(); - $name = $scenario->getTitle(); - $name .= $event instanceof OutlineExampleEvent - ? ', Ex #' . ($event->getIteration() + 1) - : ''; - $caseStats = sprintf('classname="%s" name="%s" time="%F"', - htmlspecialchars($className), - htmlspecialchars($name), - $time - ); - - $xml = " \n"; - - foreach ($this->exceptions as $exception) { - $xml .= sprintf( - ' ', - htmlspecialchars($exception->getMessage()), - $this->getResultColorCode($event->getResult()) - ); - $exception = str_replace(array(''), '', (string) $exception); - $xml .= "\n"; - } - $this->exceptions = array(); - - $xml .= " "; - - $this->testcases[] = $xml; - } - - /** - * {@inheritdoc} - */ - protected function createOutputStream() - { - $outputPath = $this->parameters->get('output_path'); - - if (null === $outputPath) { - throw new FormatterException(sprintf( - 'You should specify "output_path" parameter for %s', get_class($this) - )); - } elseif (is_file($outputPath)) { - throw new FormatterException(sprintf( - 'Directory path expected as "output_path" parameter of %s, but got: %s', - get_class($this), - $outputPath - )); - } - - if (!is_dir($outputPath)) { - mkdir($outputPath, 0777, true); - } - - return fopen($outputPath . DIRECTORY_SEPARATOR . $this->filename, 'w'); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/PrettyFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/PrettyFormatter.php deleted file mode 100644 index 54051f5..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/PrettyFormatter.php +++ /dev/null @@ -1,1024 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretty formatter. - * - * @author Konstantin Kudryashov - */ -class PrettyFormatter extends ProgressFormatter -{ - /** - * Maximum line length. - * - * @var integer - */ - protected $maxLineLength = 0; - /** - * Are we in background. - * - * @var Boolean - */ - protected $inBackground = false; - /** - * Is background printed. - * - * @var Boolean - */ - protected $isBackgroundPrinted = false; - /** - * Are we in outline steps. - * - * @var Boolean - */ - protected $inOutlineSteps = false; - /** - * Are we in outline example. - * - * @var Boolean - */ - protected $inOutlineExample = false; - /** - * Is outline headline printed. - * - * @var Boolean - */ - protected $isOutlineHeaderPrinted = false; - /** - * Delayed scenario event. - * - * @var EventInterface - */ - protected $delayedScenarioEvent; - /** - * Delayed step events. - * - * @var array - */ - protected $delayedStepEvents = array(); - /** - * Current step indentation. - * - * @var integer - */ - protected $stepIndent = ' '; - - /** - * {@inheritdoc} - */ - protected function getDefaultParameters() - { - return array(); - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - $events = array( - 'beforeSuite', 'afterSuite', 'beforeFeature', 'afterFeature', 'beforeScenario', - 'afterScenario', 'beforeBackground', 'afterBackground', 'beforeOutline', 'afterOutline', - 'beforeOutlineExample', 'afterOutlineExample', 'afterStep' - ); - - return array_combine($events, $events); - } - - /** - * Listens to "suite.before" event. - * - * @param SuiteEvent $event - * - * @uses printSuiteHeader() - */ - public function beforeSuite(SuiteEvent $event) - { - $this->printSuiteHeader($event->getLogger()); - } - - /** - * Listens to "suite.after" event. - * - * @param SuiteEvent $event - * - * @uses printSuiteFooter() - */ - public function afterSuite(SuiteEvent $event) - { - $this->printSuiteFooter($event->getLogger()); - } - - /** - * Listens to "feature.before" event. - * - * @param FeatureEvent $event - * - * @uses printFeatureHeader() - */ - public function beforeFeature(FeatureEvent $event) - { - $this->isBackgroundPrinted = false; - $this->printFeatureHeader($event->getFeature()); - } - - /** - * Listens to "feature.after" event. - * - * @param FeatureEvent $event - * - * @uses printFeatureFooter() - */ - public function afterFeature(FeatureEvent $event) - { - $this->printFeatureFooter($event->getFeature()); - } - - /** - * Listens to "background.before" event. - * - * @param BackgroundEvent $event - * - * @uses printBackgroundHeader() - */ - public function beforeBackground(BackgroundEvent $event) - { - $this->inBackground = true; - - if ($this->isBackgroundPrinted) { - return; - } - - $this->printBackgroundHeader($event->getBackground()); - } - - /** - * Listens to "background.after" event. - * - * @param BackgroundEvent $event - * - * @uses printBackgroundFooter() - */ - public function afterBackground(BackgroundEvent $event) - { - $this->inBackground = false; - - if ($this->isBackgroundPrinted) { - return; - } - $this->isBackgroundPrinted = true; - - $this->printBackgroundFooter($event->getBackground()); - - if (null !== $this->delayedScenarioEvent) { - $method = $this->delayedScenarioEvent[0]; - $event = $this->delayedScenarioEvent[1]; - - $this->$method($event); - } - } - - /** - * Listens to "outline.before" event. - * - * @param OutlineEvent $event - * - * @uses printOutlineHeader() - */ - public function beforeOutline(OutlineEvent $event) - { - $outline = $event->getOutline(); - - if (!$this->isBackgroundPrinted && $outline->getFeature()->hasBackground()) { - $this->delayedScenarioEvent = array(__FUNCTION__, $event); - - return; - } - - $this->isOutlineHeaderPrinted = false; - - $this->printOutlineHeader($outline); - } - - /** - * Listens to "outline.example.before" event. - * - * @param OutlineExampleEvent $event - * - * @uses printOutlineExampleHeader() - */ - public function beforeOutlineExample(OutlineExampleEvent $event) - { - $this->inOutlineExample = true; - $this->delayedStepEvents = array(); - - $this->printOutlineExampleHeader($event->getOutline(), $event->getIteration()); - } - - /** - * Listens to "outline.example.after" event. - * - * @param OutlineExampleEvent $event - * - * @uses printOutlineExampleFooter() - */ - public function afterOutlineExample(OutlineExampleEvent $event) - { - $this->inOutlineExample = false; - - $this->printOutlineExampleFooter( - $event->getOutline(), $event->getIteration(), $event->getResult(), $event->isSkipped() - ); - } - - /** - * Listens to "outline.after" event. - * - * @param OutlineEvent $event - * - * @uses printOutlineFooter() - */ - public function afterOutline(OutlineEvent $event) - { - $this->printOutlineFooter($event->getOutline()); - } - - /** - * Listens to "scenario.before" event. - * - * @param ScenarioEvent $event - * - * @uses printScenarioHeader() - */ - public function beforeScenario(ScenarioEvent $event) - { - $scenario = $event->getScenario(); - - if (!$this->isBackgroundPrinted && $scenario->getFeature()->hasBackground()) { - $this->delayedScenarioEvent = array(__FUNCTION__, $event); - - return; - } - - $this->printScenarioHeader($scenario); - } - - /** - * Listens to "scenario.after" event. - * - * @param ScenarioEvent $event - * - * @uses printScenarioFooter() - */ - public function afterScenario(ScenarioEvent $event) - { - $this->printScenarioFooter($event->getScenario()); - } - - /** - * Listens to "step.after" event. - * - * @param StepEvent $event - * - * @uses printStep() - */ - public function afterStep(StepEvent $event) - { - if ($this->inBackground && $this->isBackgroundPrinted) { - return; - } - - if (!$this->inBackground && $this->inOutlineExample) { - $this->delayedStepEvents[] = $event; - - return; - } - - $this->printStep( - $event->getStep(), - $event->getResult(), - $event->getDefinition(), - $event->getSnippet(), - $event->getException() - ); - } - - /** - * Prints feature header. - * - * @param FeatureNode $feature - * - * @uses printFeatureOrScenarioTags() - * @uses printFeatureName() - * @uses printFeatureDescription() - */ - protected function printFeatureHeader(FeatureNode $feature) - { - $this->printFeatureOrScenarioTags($feature); - $this->printFeatureName($feature); - if (null !== $feature->getDescription()) { - $this->printFeatureDescription($feature); - } - - $this->writeln(); - } - - /** - * Prints node tags. - * - * @param AbstractNode $node - */ - protected function printFeatureOrScenarioTags(AbstractNode $node) - { - if (count($tags = $node->getOwnTags())) { - $tags = implode(' ', array_map(function($tag){ - return '@' . $tag; - }, $tags)); - - if ($node instanceof FeatureNode) { - $indent = ''; - } else { - $indent = ' '; - } - - $this->writeln("$indent{+tag}$tags{-tag}"); - } - } - - /** - * Prints feature keyword and name. - * - * @param FeatureNode $feature - * - * @uses getFeatureOrScenarioName() - */ - protected function printFeatureName(FeatureNode $feature) - { - $this->writeln($this->getFeatureOrScenarioName($feature)); - } - - /** - * Prints feature description. - * - * @param FeatureNode $feature - */ - protected function printFeatureDescription(FeatureNode $feature) - { - $lines = explode("\n", $feature->getDescription()); - - foreach ($lines as $line) { - $this->writeln(" $line"); - } - } - - /** - * Prints feature footer. - * - * @param FeatureNode $feature - */ - protected function printFeatureFooter(FeatureNode $feature) - { - } - - /** - * Prints scenario keyword and name. - * - * @param AbstractScenarioNode $scenario - * - * @uses getFeatureOrScenarioName() - * @uses printScenarioPath() - */ - protected function printScenarioName(AbstractScenarioNode $scenario) - { - $title = explode("\n", $this->getFeatureOrScenarioName($scenario)); - - $this->write(array_shift($title)); - $this->printScenarioPath($scenario); - - if (count($title)) { - $this->writeln(implode("\n", $title)); - } - } - - /** - * Prints scenario definition path. - * - * @param AbstractScenarioNode $scenario - * - * @uses getFeatureOrScenarioName() - * @uses printPathComment() - */ - protected function printScenarioPath(AbstractScenarioNode $scenario) - { - if ($this->getParameter('paths')) { - $lines = explode("\n", $this->getFeatureOrScenarioName($scenario)); - $nameLength = mb_strlen(current($lines)); - $indentCount = $nameLength > $this->maxLineLength ? 0 : $this->maxLineLength - $nameLength; - - $this->printPathComment( - $this->relativizePathsInString($scenario->getFile()).':'.$scenario->getLine(), $indentCount - ); - } else { - $this->writeln(); - } - } - - /** - * Prints background header. - * - * @param BackgroundNode $background - * - * @uses printScenarioName() - * @uses printScenarioPath() - */ - protected function printBackgroundHeader(BackgroundNode $background) - { - $this->maxLineLength = $this->getMaxLineLength($this->maxLineLength, $background); - - $this->printScenarioName($background); - } - - /** - * Prints background footer. - * - * @param BackgroundNode $background - */ - protected function printBackgroundFooter(BackgroundNode $background) - { - $this->writeln(); - } - - /** - * Prints outline header. - * - * @param OutlineNode $outline - * - * @uses printFeatureOrScenarioTags() - * @uses printScenarioName() - */ - protected function printOutlineHeader(OutlineNode $outline) - { - $this->maxLineLength = $this->getMaxLineLength($this->maxLineLength, $outline); - - $this->printFeatureOrScenarioTags($outline); - $this->printScenarioName($outline); - } - - /** - * Prints outline footer. - * - * @param OutlineNode $outline - */ - protected function printOutlineFooter(OutlineNode $outline) - { - $this->writeln(); - } - - /** - * Prints outline example header. - * - * @param OutlineNode $outline - * @param integer $iteration - */ - protected function printOutlineExampleHeader(OutlineNode $outline, $iteration) - { - } - - /** - * Prints outline example result. - * - * @param OutlineNode $outline outline instance - * @param integer $iteration example row number - * @param integer $result result code - * @param Boolean $skipped is outline example skipped - * - * @uses printOutlineSteps() - * @uses printOutlineExamplesSectionHeader() - * @uses printOutlineExampleResult() - */ - protected function printOutlineExampleFooter(OutlineNode $outline, $iteration, $result, $skipped) - { - if (!$this->isOutlineHeaderPrinted) { - $this->printOutlineSteps($outline); - $this->printOutlineExamplesSectionHeader($outline->getExamples()); - $this->isOutlineHeaderPrinted = true; - } - - $this->printOutlineExampleResult($outline->getExamples(), $iteration, $result, $skipped); - } - - /** - * Prints outline steps. - * - * @param OutlineNode $outline - */ - protected function printOutlineSteps(OutlineNode $outline) - { - $this->inOutlineSteps = true; - - foreach ($this->delayedStepEvents as $event) { - $this->printStep($event->getStep(), StepEvent::SKIPPED, $event->getDefinition()); - } - - $this->inOutlineSteps = false; - } - - /** - * Prints outline examples header. - * - * @param TableNode $examples - * - * @uses printColorizedTableRow() - */ - protected function printOutlineExamplesSectionHeader(TableNode $examples) - { - $this->writeln(); - $keyword = $examples->getKeyword(); - - if (!$this->getParameter('expand')) { - $this->writeln(" $keyword:"); - $this->printColorizedTableRow($examples->getRowAsString(0), 'skipped'); - } - } - - /** - * Prints outline example result. - * - * @param TableNode $examples examples table - * @param integer $iteration example row - * @param integer $result result code - * @param boolean $isSkipped is outline example skipped - * - * @uses printColorizedTableRow() - * @uses printOutlineExampleResultExceptions() - */ - protected function printOutlineExampleResult(TableNode $examples, $iteration, $result, $isSkipped) - { - if (!$this->getParameter('expand')) { - $color = $this->getResultColorCode($result); - - $this->printColorizedTableRow($examples->getRowAsString($iteration + 1), $color); - $this->printOutlineExampleResultExceptions($examples, $this->delayedStepEvents); - } else { - $this->write(' ' . $examples->getKeyword() . ': '); - $this->writeln('| ' . implode(' | ', $examples->getRow($iteration + 1)) . ' |'); - - $this->stepIndent = ' '; - foreach ($this->delayedStepEvents as $event) { - $this->printStep( - $event->getStep(), - $event->getResult(), - $event->getDefinition(), - $event->getSnippet(), - $event->getException() - ); - } - $this->stepIndent = ' '; - - if ($iteration < count($examples->getRows()) - 2) { - $this->writeln(); - } - } - } - - /** - * Prints outline example exceptions. - * - * @param TableNode $examples examples table - * @param array $events failed steps events - */ - protected function printOutlineExampleResultExceptions(TableNode $examples, array $events) - { - foreach ($events as $event) { - $exception = $event->getException(); - if ($exception && !$exception instanceof UndefinedException) { - $color = $this->getResultColorCode($event->getResult()); - - if ($this->parameters->get('verbose')) { - $error = (string) $exception; - } else { - $error = $exception->getMessage(); - } - $error = $this->relativizePathsInString($error); - - $this->writeln( - " {+$color}" . strtr($error, array("\n" => "\n ")) . "{-$color}" - ); - } - } - } - - /** - * Prints scenario header. - * - * @param ScenarioNode $scenario - * - * @uses printFeatureOrScenarioTags() - * @uses printScenarioName() - */ - protected function printScenarioHeader(ScenarioNode $scenario) - { - $this->maxLineLength = $this->getMaxLineLength($this->maxLineLength, $scenario); - - $this->printFeatureOrScenarioTags($scenario); - $this->printScenarioName($scenario); - } - - /** - * Prints scenario footer. - * - * @param ScenarioNode $scenario - */ - protected function printScenarioFooter(ScenarioNode $scenario) - { - $this->writeln(); - } - - /** - * Prints step. - * - * @param StepNode $step step node - * @param integer $result result code - * @param DefinitionInterface $definition definition (if found one) - * @param string $snippet snippet (if step is undefined) - * @param \Exception $exception exception (if step is failed) - * - * @uses printStepBlock() - * @uses printStepArguments() - * @uses printStepException() - * @uses printStepSnippet() - */ - protected function printStep(StepNode $step, $result, DefinitionInterface $definition = null, - $snippet = null, \Exception $exception = null) - { - $color = $this->getResultColorCode($result); - - $this->printStepBlock($step, $definition, $color); - - if ($this->parameters->get('multiline_arguments')) { - $this->printStepArguments($step->getArguments(), $color); - } - if (null !== $exception && - (!$exception instanceof UndefinedException || null === $snippet)) { - $this->printStepException($exception, $color); - } - if (null !== $snippet && $this->getParameter('snippets')) { - $this->printStepSnippet($snippet); - } - } - - /** - * Prints step block (name & definition path). - * - * @param StepNode $step step node - * @param DefinitionInterface $definition definition (if found one) - * @param string $color color code - * - * @uses printStepName() - * @uses printStepDefinitionPath() - */ - protected function printStepBlock(StepNode $step, DefinitionInterface $definition = null, $color) - { - $this->printStepName($step, $definition, $color); - if (null !== $definition) { - $this->printStepDefinitionPath($step, $definition); - } else { - $this->writeln(); - } - } - - /** - * Prints step name. - * - * @param StepNode $step step node - * @param DefinitionInterface $definition definition (if found one) - * @param string $color color code - * - * @uses colorizeDefinitionArguments() - */ - protected function printStepName(StepNode $step, DefinitionInterface $definition = null, $color) - { - $type = $step->getType(); - $text = $this->inOutlineSteps ? $step->getCleanText() : $step->getText(); - $indent = $this->stepIndent; - - if (null !== $definition) { - $text = $this->colorizeDefinitionArguments($text, $definition, $color); - } - - $this->write("$indent{+$color}$type $text{-$color}"); - } - - /** - * Prints step definition path. - * - * @param StepNode $step step node - * @param DefinitionInterface $definition definition (if found one) - * - * @uses printPathComment() - */ - protected function printStepDefinitionPath(StepNode $step, DefinitionInterface $definition) - { - if ($this->getParameter('paths')) { - $type = $step->getType(); - $text = $this->inOutlineSteps ? $step->getCleanText() : $step->getText(); - $indent = $this->stepIndent; - $nameLength = mb_strlen("$indent$type $text"); - $indentCount = $nameLength > $this->maxLineLength ? 0 : $this->maxLineLength - $nameLength; - - $this->printPathComment( - $this->relativizePathsInString($definition->getPath()), $indentCount - ); - - if ($this->getParameter('expand')) { - $this->maxLineLength = max($this->maxLineLength, $nameLength); - } - } else { - $this->writeln(); - } - } - - /** - * Prints step arguments. - * - * @param array $arguments step arguments - * @param string $color color name - * - * @uses printStepPyStringArgument() - * @uses printStepTableArgument() - */ - protected function printStepArguments(array $arguments, $color) - { - foreach ($arguments as $argument) { - if ($argument instanceof PyStringNode) { - $this->printStepPyStringArgument($argument, $color); - } elseif ($argument instanceof TableNode) { - $this->printStepTableArgument($argument, $color); - } - } - } - - /** - * Prints step exception. - * - * @param \Exception $exception - * @param string $color - */ - protected function printStepException(\Exception $exception, $color) - { - $indent = $this->stepIndent; - - if ($this->parameters->get('verbose')) { - $error = (string) $exception; - } else { - $error = $exception->getMessage(); - } - $error = $this->relativizePathsInString($error); - - $this->writeln( - "$indent {+$color}" . strtr($error, array("\n" => "\n$indent ")) . "{-$color}" - ); - } - - /** - * Prints step snippet - * - * @param DefinitionSnippet $snippet - */ - protected function printStepSnippet(DefinitionSnippet $snippet) - { - } - - /** - * Prints PyString argument. - * - * @param PyStringNode $pystring pystring node - * @param string $color color name - */ - protected function printStepPyStringArgument(PyStringNode $pystring, $color = null) - { - $indent = $this->stepIndent; - $string = strtr( - sprintf("$indent \"\"\"\n%s\n\"\"\"", (string) $pystring), array("\n" => "\n$indent ") - ); - - if (null !== $color) { - $this->writeln("{+$color}$string{-$color}"); - } else { - $this->writeln($string); - } - } - - /** - * Prints table argument. - * - * @param TableNode $table - * @param string $color - */ - protected function printStepTableArgument(TableNode $table, $color = null) - { - $indent = $this->stepIndent; - $string = strtr("$indent " . (string) $table, array("\n" => "\n$indent ")); - - if (null !== $color) { - $this->writeln("{+$color}$string{-$color}"); - } else { - $this->writeln($string); - } - } - - /** - * Prints table row in color. - * - * @param array $row - * @param string $color - */ - protected function printColorizedTableRow($row, $color) - { - $string = preg_replace( - '/|([^|]*)|/', - "{+$color}\$1{-$color}", - ' ' . $row - ); - - $this->writeln($string); - } - - /** - * Prints suite header. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printSuiteHeader(LoggerDataCollector $logger) - { - } - - /** - * Prints suite footer information. - * - * @param LoggerDataCollector $logger suite logger - * - * @uses printSummary() - * @uses printUndefinedStepsSnippets() - */ - protected function printSuiteFooter(LoggerDataCollector $logger) - { - $this->printSummary($logger); - $this->printUndefinedStepsSnippets($logger); - } - - /** - * Returns feature or scenario name. - * - * @param AbstractNode $node - * @param Boolean $haveBaseIndent - * - * @return string - */ - protected function getFeatureOrScenarioName(AbstractNode $node, $haveBaseIndent = true) - { - $keyword = $node->getKeyword(); - $baseIndent = ($node instanceof FeatureNode) || !$haveBaseIndent ? '' : ' '; - - $lines = explode("\n", $node->getTitle()); - $title = array_shift($lines); - - if (count($lines)) { - foreach ($lines as $line) { - $title .= "\n" . $baseIndent.' '.$line; - } - } - - return "$baseIndent$keyword:" . ($title ? ' ' . $title : ''); - } - - /** - * Returns step text with colorized arguments. - * - * @param string $text - * @param DefinitionInterface $definition - * @param string $color - * - * @return string - */ - protected function colorizeDefinitionArguments($text, DefinitionInterface $definition, $color) - { - $regex = $definition->getRegex(); - $paramColor = $color . '_param'; - - // If it's just a string - skip - if ('/' !== substr($regex, 0, 1)) { - return $text; - } - - // Find arguments with offsets - $matches = array(); - preg_match($regex, $text, $matches, PREG_OFFSET_CAPTURE); - array_shift($matches); - - // Replace arguments with colorized ones - $shift = 0; - $lastReplacementPosition = 0; - foreach ($matches as $key => $match) { - if (!is_numeric($key) || -1 === $match[1] || false !== strpos($match[0], '<')) { - continue; - } - - $offset = $match[1] + $shift; - $value = $match[0]; - - // Skip inner matches - if ($lastReplacementPosition > $offset) { - continue; - } - $lastReplacementPosition = $offset + strlen($value); - - $begin = substr($text, 0, $offset); - $end = substr($text, $lastReplacementPosition); - $format = "{-$color}{+$paramColor}%s{-$paramColor}{+$color}"; - $text = sprintf("%s{$format}%s", $begin, $value, $end); - - // Keep track of how many extra characters are added - $shift += strlen($format) - 2; - $lastReplacementPosition += strlen($format) - 2; - } - - // Replace "<", ">" with colorized ones - $text = preg_replace('/(<[^>]+>)/', - "{-$color}{+$paramColor}\$1{-$paramColor}{+$color}", - $text - ); - - return $text; - } - - /** - * Returns max lines size for section elements. - * - * @param integer $max previous max value - * @param AbstractScenarioNode $scenario element for calculations - * - * @return integer - */ - protected function getMaxLineLength($max, AbstractScenarioNode $scenario) - { - $lines = explode("\n", $this->getFeatureOrScenarioName($scenario, false)); - $max = max($max, mb_strlen(current($lines)) + 2); - - foreach ($scenario->getSteps() as $step) { - $text = $step instanceof ExampleStepNode ? $step->getCleanText() : $step->getText(); - $stepDescription = $step->getType() . ' ' . $text; - $max = max($max, mb_strlen($stepDescription) + 4); - } - - return $max; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/ProgressFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/ProgressFormatter.php deleted file mode 100644 index 82edd7f..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/ProgressFormatter.php +++ /dev/null @@ -1,414 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Progress formatter. - * - * @author Konstantin Kudryashov - */ -class ProgressFormatter extends ConsoleFormatter -{ - /** - * Maximum line length. - * - * @var integer - */ - protected $maxLineLength = 0; - - /** - * {@inheritdoc} - */ - protected function getDefaultParameters() - { - return array(); - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - $events = array('afterSuite', 'afterStep'); - - return array_combine($events, $events); - } - - /** - * Listens to "suite.after" event. - * - * @param SuiteEvent $event - * - * @uses printFailedSteps() - * @uses printPendingSteps() - * @uses printSummary() - * @uses printUndefinedStepsSnippets() - */ - public function afterSuite(SuiteEvent $event) - { - $logger = $event->getLogger(); - - $this->writeln("\n"); - $this->printFailedSteps($logger); - $this->printPendingSteps($logger); - $this->printSummary($logger); - $this->printUndefinedStepsSnippets($logger); - } - - /** - * Listens to "step.after" event. - * - * @param StepEvent $event - * - * @uses printStep() - */ - public function afterStep(StepEvent $event) - { - $this->printStep( - $event->getStep(), - $event->getResult(), - $event->getDefinition(), - $event->getSnippet(), - $event->getException() - ); - } - - /** - * Prints step. - * - * @param StepNode $step step node - * @param integer $result step result code - * @param DefinitionInterface $definition definition instance (if step defined) - * @param string $snippet snippet (if step is undefined) - * @param \Exception $exception exception (if step is failed) - * - * @uses StepEvent - */ - protected function printStep(StepNode $step, $result, DefinitionInterface $definition = null, - $snippet = null, \Exception $exception = null) - { - switch ($result) { - case StepEvent::PASSED: - $this->write('{+passed}.{-passed}'); - break; - case StepEvent::SKIPPED: - $this->write('{+skipped}-{-skipped}'); - break; - case StepEvent::PENDING: - $this->write('{+pending}P{-pending}'); - break; - case StepEvent::UNDEFINED: - $this->write('{+undefined}U{-undefined}'); - break; - case StepEvent::FAILED: - $this->write('{+failed}F{-failed}'); - break; - } - } - - /** - * Prints all failed steps info. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printFailedSteps(LoggerDataCollector $logger) - { - if (count($logger->getFailedStepsEvents())) { - $header = $this->translate('failed_steps_title'); - $this->writeln("{+failed}(::) $header (::){-failed}\n"); - $this->printExceptionEvents($logger->getFailedStepsEvents()); - } - } - - /** - * Prints all pending steps information. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printPendingSteps(LoggerDataCollector $logger) - { - if (count($logger->getPendingStepsEvents())) { - $header = $this->translate('pending_steps_title'); - $this->writeln("{+pending}(::) $header (::){-pending}\n"); - $this->printExceptionEvents($logger->getPendingStepsEvents()); - } - } - - /** - * Prints exceptions information. - * - * @param array $events failed step events - */ - protected function printExceptionEvents(array $events) - { - foreach ($events as $number => $event) { - $exception = $event->getException(); - - if (null !== $exception) { - $color = $exception instanceof PendingException ? 'pending' : 'failed'; - - if ($this->parameters->get('verbose')) { - $error = (string) $exception; - } else { - $error = $exception->getMessage(); - } - $error = sprintf("%s. %s", - str_pad((string) ($number + 1), 2, '0', STR_PAD_LEFT), - strtr($error, array("\n" => "\n ")) - ); - $error = $this->relativizePathsInString($error); - - $this->writeln("{+$color}$error{-$color}"); - } - - $this->printStepPath($event->getStep(), $event->getDefinition(), $exception); - } - } - - /** - * Prints path to step. - * - * @param StepNode $step step node - * @param DefinitionInterface $definition definition (if step defined) - * @param \Exception $exception exception (if step failed) - */ - protected function printStepPath(StepNode $step, DefinitionInterface $definition = null, - \Exception $exception = null) - { - $color = $exception instanceof PendingException ? 'pending' : 'failed'; - $type = $step->getType(); - $text = $step->getText(); - $stepPath = "In step `$type $text'."; - $stepPathLn = mb_strlen($stepPath); - - $node = $step->getParent(); - if ($node instanceof BackgroundNode) { - $scenarioPath = "From scenario background."; - } else { - $title = $node->getTitle(); - $title = $title ? "`$title'" : '***'; - $scenarioPath = "From scenario $title."; - } - $scenarioPathLn = mb_strlen($scenarioPath); - - $feature = $node->getFeature(); - $title = $feature->getTitle(); - $title = $title ? "`$title'" : '***'; - $featurePath = "Of feature $title."; - $featurePathLn = mb_strlen($featurePath); - - $this->maxLineLength = max($this->maxLineLength, $stepPathLn); - $this->maxLineLength = max($this->maxLineLength, $scenarioPathLn); - $this->maxLineLength = max($this->maxLineLength, $featurePathLn); - - $this->write(" {+$color}$stepPath{-$color}"); - if (null !== $definition) { - $indentCount = $this->maxLineLength - $stepPathLn; - $this->printPathComment( - $this->relativizePathsInString($definition->getPath()), $indentCount - ); - } else { - $this->writeln(); - } - - $this->write(" {+$color}$scenarioPath{-$color}"); - $indentCount = $this->maxLineLength - $scenarioPathLn; - $this->printPathComment( - $this->relativizePathsInString($node->getFile()) . ':' . $node->getLine(), $indentCount - ); - - $this->write(" {+$color}$featurePath{-$color}"); - $indentCount = $this->maxLineLength - $featurePathLn; - $this->printPathComment( - $this->relativizePathsInString($feature->getFile()), $indentCount - ); - - $this->writeln(); - } - - /** - * Prints summary suite run information. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printSummary(LoggerDataCollector $logger) - { - $this->printScenariosSummary($logger); - $this->printStepsSummary($logger); - - if ($this->parameters->get('time')) { - $this->printTimeSummary($logger); - } - } - - /** - * Prints scenarios summary information. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printScenariosSummary(LoggerDataCollector $logger) - { - $count = $logger->getScenariosCount(); - $header = $this->translateChoice('scenarios_count', $count, array('%1%' => $count)); - $this->write($header); - $this->printStatusesSummary($logger->getScenariosStatuses()); - } - - /** - * Prints steps summary information. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printStepsSummary(LoggerDataCollector $logger) - { - $count = $logger->getStepsCount(); - $header = $this->translateChoice('steps_count', $count, array('%1%' => $count)); - $this->write($header); - $this->printStatusesSummary($logger->getStepsStatuses()); - } - - /** - * Prints statuses summary. - * - * @param array $statusesStatistics statuses statistic hash (status => count) - */ - protected function printStatusesSummary(array $statusesStatistics) - { - $statuses = array(); - foreach ($statusesStatistics as $status => $count) { - if ($count) { - $transStatus = $this->translateChoice( - "{$status}_count", $count, array('%1%' => $count) - ); - $statuses[] = "{+$status}$transStatus{-$status}"; - } - } - $this->writeln(count($statuses) ? ' ' . sprintf('(%s)', implode(', ', $statuses)) : ''); - } - - /** - * Prints suite run time inforamtion. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printTimeSummary(LoggerDataCollector $logger) - { - $time = $logger->getTotalTime(); - $minutes = floor($time / 60); - $seconds = round($time - ($minutes * 60), 3); - - $this->writeln($minutes . 'm' . $seconds . 's'); - } - - /** - * Prints undefined steps snippets. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printUndefinedStepsSnippets(LoggerDataCollector $logger) - { - if ($this->getParameter('snippets') && count($logger->getDefinitionsSnippets())) { - $header = $this->translate('proposal_title'); - $this->writeln("\n{+undefined}$header{-undefined}\n"); - $this->printSnippets($logger); - } - } - - /** - * Prints steps snippets. - * - * @param LoggerDataCollector $logger suite logger - */ - protected function printSnippets(LoggerDataCollector $logger) - { - foreach ($logger->getDefinitionsSnippets() as $snippet) { - $snippetText = $snippet->getSnippet(); - - if ($this->getParameter('snippets_paths')) { - $indent = str_pad( - '', mb_strlen($snippetText) - mb_strlen(ltrim($snippetText)), ' ' - ); - $this->writeln("{+undefined}$indent/**{-undefined}"); - foreach ($snippet->getSteps() as $step) { - $this->writeln(sprintf( - '{+undefined}%s * %s %s # %s:%d{-undefined}', $indent, - $step->getType(), $step->getText(), - $this->relativizePathsInString($step->getFile()), $step->getLine() - )); - } - - if (false !== mb_strpos($snippetText, '/**')) { - $snippetText = str_replace('/**', ' *', $snippetText); - } else { - $this->writeln("{+undefined}$indent */{-undefined}"); - } - } - - $this->writeln("{+undefined}$snippetText{-undefined}\n"); - } - } - - /** - * Prints path comment. - * - * @param string $path item path - * @param integer $indentCount indenation number - */ - protected function printPathComment($path, $indentCount = 0) - { - $indent = str_repeat(' ', $indentCount); - $this->writeln("$indent {+comment}# $path{-comment}"); - } - - /** - * Returns string with relativized paths. - * - * @param string $string - * - * @return string - */ - protected function relativizePathsInString($string) - { - if ($basePath = $this->parameters->get('base_path')) { - $basePath = realpath($basePath) . DIRECTORY_SEPARATOR; - $string = str_replace($basePath, '', $string); - } - - return $string; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Formatter/SnippetsFormatter.php b/vendor/behat/behat/src/Behat/Behat/Formatter/SnippetsFormatter.php deleted file mode 100644 index efb9e0b..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Formatter/SnippetsFormatter.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Snippets formatter. - * - * @author Konstantin Kudryashov - */ -class SnippetsFormatter extends ProgressFormatter -{ - /** - * {@inheritdoc} - */ - protected function getDefaultParameters() - { - return array(); - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - return array('afterSuite' => 'afterSuite'); - } - - /** - * Listens to "suite.after" event. - * - * @param SuiteEvent $event - * - * @uses printUndefinedStepsSnippets() - */ - public function afterSuite(SuiteEvent $event) - { - $logger = $event->getLogger(); - - $this->writeln(); - $this->printSnippets($logger); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Gherkin/Loader/FeatureSuiteLoader.php b/vendor/behat/behat/src/Behat/Behat/Gherkin/Loader/FeatureSuiteLoader.php deleted file mode 100644 index e99ebbb..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Gherkin/Loader/FeatureSuiteLoader.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Behat\Gherkin\Loader\AbstractFileLoader, - Behat\Gherkin\Gherkin; - -use Symfony\Component\Finder\Finder; - -/** - * Gherkin loader with features/ path support. - * - * @author Konstantin Kudryashov - */ -class FeatureSuiteLoader extends AbstractFileLoader -{ - private $featuresPath; - private $gherkin; - - /** - * Initializes loader. - * - * @param string $featuresPath - * @param Gherkin $gherkin - */ - public function __construct($featuresPath, Gherkin $gherkin) - { - $this->featuresPath = $featuresPath; - $this->gherkin = $gherkin; - } - - /** - * Checks if current loader supports provided resource. - * - * @param mixed $resource Resource to load - * - * @return Boolean - */ - public function supports($resource) - { - return '' === $resource - && is_dir($this->featuresPath); - } - - /** - * Loads features from provided resource. - * - * @param mixed $resource Resource to load - * - * @return array - */ - public function load($resource) - { - if (!$this->featuresPath || !file_exists($this->featuresPath)) { - return array(); - } - - $iterator = Finder::create() - ->depth(0) - ->sortByName() - ->in($this->featuresPath) - ; - - $features = array(); - foreach ($iterator as $path) { - $resource = (string) $path; - $loader = $this->gherkin->resolveLoader($resource); - - if (null !== $loader) { - $features = array_merge($features, $loader->load($resource)); - } - } - - return $features; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/HelpPrinter/DefinitionsPrinter.php b/vendor/behat/behat/src/Behat/Behat/HelpPrinter/DefinitionsPrinter.php deleted file mode 100644 index 5f1f545..0000000 --- a/vendor/behat/behat/src/Behat/Behat/HelpPrinter/DefinitionsPrinter.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Definitions printer. - * - * @author Konstantin Kudryashov - */ -class DefinitionsPrinter -{ - private $dispatcher; - - /** - * Initializes definition dispatcher. - * - * @param DefinitionDispatcher $dispatcher - */ - public function __construct(DefinitionDispatcher $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Prints step definitions into console. - * - * @param OutputInterface $output - * @param string $search - * @param string $language - * @param Boolean $shortNotation - */ - public function printDefinitions(OutputInterface $output, $search = null, $language = 'en', $shortNotation = true) - { - $output->getFormatter()->setStyle( - 'capture', new OutputFormatterStyle('yellow', null, array('bold')) - ); - $output->getFormatter()->setStyle( - 'path', new OutputFormatterStyle('black') - ); - - $output->writeln($this->getDefinitionsForPrint($search, $language, $shortNotation)); - } - - /** - * Returns available definitions in string. - * - * @param string $search search string - * @param string $language default definitions language - * @param Boolean $shortNotation show short notation instead of full one - * - * @return string - */ - private function getDefinitionsForPrint($search = null, $language = 'en', $shortNotation = true) - { - if ($shortNotation) { - $template = '{type} {regex}'; - } else { - $template = <<{type} {regex} - {description}# {path} - -TPL; - } - - $definitions = array(); - foreach ($this->dispatcher->getDefinitions() as $regex => $definition) { - $regex = $this->dispatcher->translateDefinitionRegex($regex, $language); - if ($search && !preg_match('/'.str_replace(' ', '.*', preg_quote($search, '/').'/'), $regex)) { - continue; - } - - $regex = preg_replace_callback('/\((?!\?:)[^\)]*\)/', function($capture) { - return "{$capture[0]}"; - }, $regex); - - $definitions[] = strtr($template, array( - '{regex}' => $regex, - '{type}' => str_pad($definition->getType(), 5, ' ', STR_PAD_LEFT), - '{description}' => $definition->getDescription() ? '- '.$definition->getDescription()."\n " : '', - '{path}' => $definition->getPath() - )); - } - - return implode("\n", $definitions); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/HelpPrinter/StorySyntaxPrinter.php b/vendor/behat/behat/src/Behat/Behat/HelpPrinter/StorySyntaxPrinter.php deleted file mode 100644 index b536464..0000000 --- a/vendor/behat/behat/src/Behat/Behat/HelpPrinter/StorySyntaxPrinter.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Story syntax printer. - * - * @author Konstantin Kudryashov - */ -class StorySyntaxPrinter -{ - private $dumper; - - /** - * Initializes definition dispatcher. - * - * @param KeywordsDumper $dumper - */ - public function __construct(KeywordsDumper $dumper) - { - $dumper->setKeywordsDumperFunction(array($this, 'dumpKeywords')); - $this->dumper = $dumper; - } - - /** - * Prints example story syntax into console. - * - * @param OutputInterface $output - * @param string $language - */ - public function printSyntax(OutputInterface $output, $language = 'en') - { - $output->getFormatter()->setStyle('comment', new OutputFormatterStyle('yellow')); - $output->getFormatter()->setStyle( - 'keyword', new OutputFormatterStyle('green', null, array('bold')) - ); - - $story = $this->dumper->dump($language); - $story = preg_replace('/^\#.*/', '$0', $story); - - $output->writeln($story); - } - - /** - * Keywords dumper. - * - * @param array $keywords keywords list - * - * @return string - */ - public function dumpKeywords(array $keywords) - { - $dump = ''.implode('|', $keywords).''; - - if (1 < count($keywords)) { - return '['.$dump.']'; - } - - return $dump; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterFeature.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterFeature.php deleted file mode 100644 index fd5825f..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterFeature.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * AfterFeature hook class. - * - * @author Konstantin Kudryashov - */ -class AfterFeature extends FeatureHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'afterFeature'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterScenario.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterScenario.php deleted file mode 100644 index 7107dc8..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterScenario.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * AfterScenario hook class. - * - * @author Konstantin Kudryashov - */ -class AfterScenario extends ScenarioHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'afterScenario'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterStep.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterStep.php deleted file mode 100644 index 92ef30a..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterStep.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * AfterStep hook class. - * - * @author Konstantin Kudryashov - */ -class AfterStep extends StepHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'afterStep'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterSuite.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterSuite.php deleted file mode 100644 index b001469..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/AfterSuite.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * AfterSuite hook class. - * - * @author Konstantin Kudryashov - */ -class AfterSuite extends SuiteHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'afterSuite'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeFeature.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeFeature.php deleted file mode 100644 index 883ed0f..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeFeature.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * BeforeFeature hook class. - * - * @author Konstantin Kudryashov - */ -class BeforeFeature extends FeatureHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'beforeFeature'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeScenario.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeScenario.php deleted file mode 100644 index 3a89b13..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeScenario.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * BeforeScenario hook class. - * - * @author Konstantin Kudryashov - */ -class BeforeScenario extends ScenarioHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'beforeScenario'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeStep.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeStep.php deleted file mode 100644 index 7d525ef..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeStep.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * BeforeStep hook class. - * - * @author Konstantin Kudryashov - */ -class BeforeStep extends StepHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'beforeStep'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeSuite.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeSuite.php deleted file mode 100644 index 4d0c197..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/BeforeSuite.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * BeforeSuite hook class. - * - * @author Konstantin Kudryashov - */ -class BeforeSuite extends SuiteHook -{ - /** - * {@inheritdoc} - */ - public function getEventName() - { - return 'beforeSuite'; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/FeatureHook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/FeatureHook.php deleted file mode 100644 index 9480105..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/FeatureHook.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * FeatureHook hook class. - * - * @author Konstantin Kudryashov - */ -abstract class FeatureHook extends FilterableHook -{ - /** - * {@inheritdoc} - */ - public function __construct($callback, $filterString = null) - { - parent::__construct($callback, $filterString); - - if (!$this->isClosure()) { - $methodRefl = new \ReflectionMethod($callback[0], $callback[1]); - - if (!$methodRefl->isStatic()) { - throw new \InvalidArgumentException(sprintf( - '"%s" hook callback: %s::%s() must be a static method', - basename(str_replace('\\', '/', get_class($this))), $callback[0], $callback[1] - )); - } - } - } - - /** - * {@inheritdoc} - */ - public function filterMatches(EventInterface $event) - { - if (null === ($filterString = $this->getFilter())) { - return true; - } - - $feature = $event->getFeature(); - - if (false !== strpos($filterString, '@')) { - $filter = new TagFilter($filterString); - - if ($filter->isFeatureMatch($feature)) { - return true; - } - } elseif (!empty($filterString)) { - $filter = new NameFilter($filterString); - - if ($filter->isFeatureMatch($feature)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/FilterableHook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/FilterableHook.php deleted file mode 100644 index bf97711..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/FilterableHook.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base filterable hook class. - * - * @author Konstantin Kudryashov - */ -abstract class FilterableHook extends Hook -{ - private $filter; - - /** - * Initializes hook. - * - * @param callback $callback callback - * @param string $filterString hook filter - */ - public function __construct($callback, $filterString = null) - { - parent::__construct($callback); - - $this->filter = $filterString; - } - - /** - * Returns filter string. - * - * @return stirng - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Checks that current hook matches provided event object. - * - * @param EventInterface $event - * - * @return Boolean - */ - abstract public function filterMatches(EventInterface $event); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/Hook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/Hook.php deleted file mode 100644 index 7395883..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/Hook.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base hook class. - * - * @author Konstantin Kudryashov - */ -abstract class Hook extends Annotation implements HookInterface -{ - /** - * Constructs annotation. - * - * @param callback $callback - * - * @throws \InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException(sprintf( - '"%s" hook callback should be a valid callable, but %s given', - basename(str_replace('\\', '/', get_class($this))), gettype($callback) - )); - } - parent::__construct($callback); - } - - /** - * Runs hook callback. - * - * @param EventInterface $event - */ - public function run(EventInterface $event) - { - call_user_func($this->getCallback(), $event); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/ScenarioHook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/ScenarioHook.php deleted file mode 100644 index abf7919..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/ScenarioHook.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * ScenarioHook hook class. - * - * @author Konstantin Kudryashov - */ -abstract class ScenarioHook extends FilterableHook -{ - /** - * {@inheritdoc} - */ - public function filterMatches(EventInterface $event) - { - if (null === ($filterString = $this->getFilter())) { - return true; - } - - if ($event instanceof ScenarioEvent) { - $scenario = $event->getScenario(); - } else { - $scenario = $event->getOutline(); - } - - if (false !== strpos($filterString, '@')) { - $filter = new TagFilter($filterString); - - if ($filter->isScenarioMatch($scenario)) { - return true; - } - } elseif (!empty($filterString)) { - $filter = new NameFilter($filterString); - - if ($filter->isScenarioMatch($scenario)) { - return true; - } - } - - return false; - } - - /** - * Runs hook callback. - * - * @param EventInterface $event - */ - public function run(EventInterface $event) - { - call_user_func($this->getCallbackForContext($event->getContext()), $event); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/StepHook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/StepHook.php deleted file mode 100644 index cba68d0..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/StepHook.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * StepHook hook class. - * - * @author Konstantin Kudryashov - */ -abstract class StepHook extends FilterableHook -{ - /** - * {@inheritdoc} - */ - public function filterMatches(EventInterface $event) - { - if (null === ($filterString = $this->getFilter())) { - return true; - } - - $scenario = $event->getLogicalParent(); - - if (false !== strpos($filterString, '@')) { - $filter = new TagFilter($filterString); - - if ($filter->isScenarioMatch($scenario)) { - return true; - } - } elseif (!empty($filterString)) { - $filter = new NameFilter($filterString); - - if ($filter->isScenarioMatch($scenario)) { - return true; - } - } - - return false; - } - - /** - * Runs hook callback. - * - * @param EventInterface $event - */ - public function run(EventInterface $event) - { - call_user_func($this->getCallbackForContext($event->getContext()), $event); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/SuiteHook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/SuiteHook.php deleted file mode 100644 index 69ab044..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Annotation/SuiteHook.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * SuiteHook hook class. - * - * @author Konstantin Kudryashov - */ -abstract class SuiteHook extends Hook -{ - /** - * {@inheritdoc} - */ - public function __construct($callback) - { - parent::__construct($callback); - - if (!$this->isClosure()) { - $methodRefl = new \ReflectionMethod($callback[0], $callback[1]); - - if (!$methodRefl->isStatic()) { - throw new \InvalidArgumentException(sprintf( - '"%s" hook callback: %s::%s() must be a static method', - basename(str_replace('\\', '/', get_class($this))), $callback[0], $callback[1] - )); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/HookDispatcher.php b/vendor/behat/behat/src/Behat/Behat/Hook/HookDispatcher.php deleted file mode 100644 index 276c6b4..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/HookDispatcher.php +++ /dev/null @@ -1,307 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Hook dispatcher. - * - * @author Konstantin Kudryashov - */ -class HookDispatcher implements EventSubscriberInterface -{ - private $hooks = array(); - private $dryRun = false; - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - $events = array( - 'beforeSuite', 'afterSuite', 'beforeFeature', 'afterFeature', 'beforeScenario', - 'afterScenario', 'beforeOutlineExample', 'afterOutlineExample', 'beforeStep', 'afterStep' - ); - - return array_combine($events, $events); - } - - /** - * Sets hook dispatcher to dry-run mode. - * - * @param Boolean $dryRun - */ - public function setDryRun($dryRun = true) - { - $this->dryRun = (bool) $dryRun; - } - - /** - * Adds hook into dispatcher. - * - * @param HookInterface $hook - */ - public function addHook(HookInterface $hook) - { - if (!isset($this->hooks[$hook->getEventName()])) { - $this->hooks[$hook->getEventName()] = array(); - } - - $this->hooks[$hook->getEventName()][] = $hook; - } - - /** - * Returns all available hooks. - * - * @return array - */ - public function getHooks() - { - return $this->hooks; - } - - /** - * Cleans dispatcher. - */ - public function clean() - { - $this->hooks = array(); - } - - /** - * Listens to "suite.before" event. - * - * @param SuiteEvent $event - * - * @uses fireSuiteHooks() - */ - public function beforeSuite(SuiteEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "suite.after" event. - * - * @param SuiteEvent $event - * - * @uses fireSuiteHooks() - */ - public function afterSuite(SuiteEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "feature.before" event. - * - * @param FeatureEvent $event - * - * @uses fireFeatureHooks() - */ - public function beforeFeature(FeatureEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "feature.after" event. - * - * @param FeatureEvent $event - * - * @uses fireFeatureHooks() - */ - public function afterFeature(FeatureEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "scenario.before" event. - * - * @param ScenarioEvent $event - * - * @uses fireScenarioHooks() - */ - public function beforeScenario(ScenarioEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "scenario.after" event. - * - * @param ScenarioEvent $event - * - * @uses fireScenarioHooks() - */ - public function afterScenario(ScenarioEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "outline.example.before" event. - * - * @param OutlineExampleEvent $event - * - * @uses fireScenarioHooks() - */ - public function beforeOutlineExample(OutlineExampleEvent $event) - { - $this->fireHooks('beforeScenario', $event); - } - - /** - * Listens to "outline.example.after" event. - * - * @param OutlineExampleEvent $event - * - * @uses fireScenarioHooks() - */ - public function afterOutlineExample(OutlineExampleEvent $event) - { - $this->fireHooks('afterScenario', $event); - } - - /** - * Listens to "step.before" event. - * - * @param StepEvent $event - * - * @uses fireStepHooks() - */ - public function beforeStep(StepEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Listens to "step.after" event. - * - * @param StepEvent $event - * - * @uses fireStepHooks() - */ - public function afterStep(StepEvent $event) - { - $this->fireHooks(__FUNCTION__, $event); - } - - /** - * Custom error handler. - * - * This method used as custom error handler when step is running. - * - * @see set_error_handler() - * - * @param $code - * @param $message - * @param $file - * @param $line - * - * @throws \Behat\Behat\Exception\ErrorException - */ - public function errorHandler($code, $message, $file, $line) - { - if (0 === error_reporting()) { - return; // error reporting turned off or more likely suppresed with @ - } - throw new ErrorException($code, $message, $file, $line); - } - - /** - * Runs hooks with specified name. - * - * @param string $name hooks name - * @param EventInterface $event event to which hooks glued - * - * @throws \Exception - */ - protected function fireHooks($name, EventInterface $event) - { - if ($this->dryRun) { - return; - } - - $hooks = isset($this->hooks[$name]) ? $this->hooks[$name] : array(); - - foreach ($hooks as $hook) { - $runable = $hook instanceof FilterableHook ? $hook->filterMatches($event) : true; - - if ($runable) { - if (defined('BEHAT_ERROR_REPORTING')) { - $errorLevel = BEHAT_ERROR_REPORTING; - } else { - $errorLevel = E_ALL ^ E_WARNING; - } - - set_error_handler(array($this, 'errorHandler'), $errorLevel); - - try { - $hook->run($event); - } catch (\Exception $e) { - restore_error_handler(); - $this->addHookInformationToException($hook, $e); - throw $e; - } - - restore_error_handler(); - } - } - } - - /** - * Adds hook information to exception thrown from it. - * - * @param HookInterface $hook hook instance - * @param \Exception $exception exception - */ - private function addHookInformationToException(HookInterface $hook, \Exception $exception) - { - $refl = new \ReflectionObject($exception); - $message = $refl->getProperty('message'); - - $message->setAccessible(true); - $message->setValue($exception, sprintf( - 'Exception has been thrown in "%s" hook, defined in %s'."\n\n%s", - $hook->getEventName(), - $hook->getPath(), - $exception->getMessage() - )); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/HookInterface.php b/vendor/behat/behat/src/Behat/Behat/Hook/HookInterface.php deleted file mode 100644 index 33143eb..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/HookInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Hook interface. - * - * @author Konstantin Kudryashov - */ -interface HookInterface -{ - /** - * Returns hooked event type. - * - * @return string - */ - public function getEventName(); - - /** - * Runs hook callback. - * - * @param EventInterface $event - */ - public function run(EventInterface $event); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Loader/ClosuredHookLoader.php b/vendor/behat/behat/src/Behat/Behat/Hook/Loader/ClosuredHookLoader.php deleted file mode 100644 index a8ec35f..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Loader/ClosuredHookLoader.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Closured hook definitions loader. - * - * @author Konstantin Kudryashov - */ -class ClosuredHookLoader implements HookLoaderInterface -{ - private $dispatcher; - - /** - * Initializes loader. - * - * @param HookDispatcher $dispatcher - */ - public function __construct(HookDispatcher $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Loads definitions from provided resource. - * - * @param mixed $resource - */ - public function load($resource) - { - $hooks = $this; - - require_once($resource); - } - - /** - * Hooks into "suite.before". - * - * @param callback $callback hook callback - */ - public function beforeSuite($callback) - { - $this->dispatcher->addHook(new BeforeSuite($callback)); - } - - /** - * Hooks into "suite.after". - * - * @param callback $callback hook callback - */ - public function afterSuite($callback) - { - $this->dispatcher->addHook(new AfterSuite($callback)); - } - - /** - * Hooks into "feature.before". - * - * @param string $filter filter string (tags or name) - * @param callback $callback hook callback - */ - public function beforeFeature($filter, $callback) - { - $this->dispatcher->addHook(new BeforeFeature($callback, '' !== $filter ? $filter : null)); - } - - /** - * Hooks into "feature.after". - * - * @param string $filter filter string (tags or name) - * @param callback $callback hook callback - */ - public function afterFeature($filter, $callback) - { - $this->dispatcher->addHook(new AfterFeature($callback, '' !== $filter ? $filter : null)); - } - - /** - * Hooks into "scenario.before" OR "outline.example.before". - * - * @param string $filter filter string (tags or name) - * @param callback $callback hook callback - */ - public function beforeScenario($filter, $callback) - { - $this->dispatcher->addHook(new BeforeScenario($callback, '' !== $filter ? $filter : null)); - } - - /** - * Hooks into "scenario.after" OR "outline.example.after". - * - * @param string $filter filter string (tags or name) - * @param callback $callback hook callback - */ - public function afterScenario($filter, $callback) - { - $this->dispatcher->addHook(new AfterScenario($callback, '' !== $filter ? $filter : null)); - } - - /** - * Hooks into "step.before". - * - * @param string $filter filter string (tags or name) - * @param callback $callback hook callback - */ - public function beforeStep($filter, $callback) - { - $this->dispatcher->addHook(new BeforeStep($callback, '' !== $filter ? $filter : null)); - } - - /** - * Hooks into "step.after". - * - * @param string $filter filter string (tags or name) - * @param callback $callback hook callback - */ - public function afterStep($filter, $callback) - { - $this->dispatcher->addHook(new AfterStep($callback, '' !== $filter ? $filter : null)); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Loader/HookLoaderInterface.php b/vendor/behat/behat/src/Behat/Behat/Hook/Loader/HookLoaderInterface.php deleted file mode 100644 index c1d64cc..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Loader/HookLoaderInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Hook loader interface. - * - * @author Konstantin Kudryashov - */ -interface HookLoaderInterface -{ - /** - * Loads definitions from provided resource. - * - * @param mixed $resource - */ - public function load($resource); -} diff --git a/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php b/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php deleted file mode 100644 index ef182e0..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Background tester. - * - * @author Konstantin Kudryashov - */ -class BackgroundTester implements NodeVisitorInterface -{ - private $logicalParent; - private $container; - private $dispatcher; - private $context; - private $dryRun = false; - - /** - * Initializes tester. - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - $this->dispatcher = $container->get('behat.event_dispatcher'); - } - - /** - * Sets logical parent of the step, which is always a ScenarioNode. - * - * @param ScenarioNode $parent - */ - public function setLogicalParent(ScenarioNode $parent) - { - $this->logicalParent = $parent; - } - - /** - * Sets run context. - * - * @param ContextInterface $context - */ - public function setContext(ContextInterface $context) - { - $this->context = $context; - } - - /** - * Sets tester to dry-run mode. - * - * @param Boolean $dryRun - */ - public function setDryRun($dryRun = true) - { - $this->dryRun = (bool) $dryRun; - } - - /** - * Visits & tests BackgroundNode. - * - * @param AbstractNode $background - * - * @return integer - */ - public function visit(AbstractNode $background) - { - $this->dispatcher->dispatch('beforeBackground', new BackgroundEvent($background)); - - $result = 0; - $skip = false; - - // Visit & test steps - foreach ($background->getSteps() as $step) { - $tester = $this->container->get('behat.tester.step'); - $tester->setLogicalParent($this->logicalParent); - $tester->setContext($this->context); - $tester->skip($skip || $this->dryRun); - - $stResult = $step->accept($tester); - - if (0 !== $stResult) { - $skip = true; - } - $result = max($result, $stResult); - } - - $this->dispatcher->dispatch('afterBackground', new BackgroundEvent($background, $result, $skip)); - - return $result; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Tester/FeatureTester.php b/vendor/behat/behat/src/Behat/Behat/Tester/FeatureTester.php deleted file mode 100644 index a40456a..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Tester/FeatureTester.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Feature tester. - * - * @author Konstantin Kudryashov - */ -class FeatureTester implements NodeVisitorInterface -{ - private $container; - private $dispatcher; - private $parameters; - private $dryRun = false; - - /** - * Initializes tester. - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - $this->dispatcher = $container->get('behat.event_dispatcher'); - $this->parameters = $container->get('behat.context.dispatcher')->getContextParameters(); - } - - /** - * Sets tester to dry-run mode. - * - * @param Boolean $dryRun - */ - public function setDryRun($dryRun = true) - { - $this->dryRun = (bool) $dryRun; - } - - /** - * Visits & tests FeatureNode. - * - * @param AbstractNode $feature - * - * @return integer - * - * @throws BehaviorException if unknown scenario type (neither Outline or Scenario) found in feature - */ - public function visit(AbstractNode $feature) - { - $result = 0; - - // If feature has scenarios - run them - if ($feature->hasScenarios()) { - $this->dispatcher->dispatch( - 'beforeFeature', new FeatureEvent($feature, $this->parameters) - ); - - foreach ($feature->getScenarios() as $scenario) { - if ($scenario instanceof OutlineNode) { - $tester = $this->container->get('behat.tester.outline'); - } elseif ($scenario instanceof ScenarioNode) { - $tester = $this->container->get('behat.tester.scenario'); - } else { - throw new BehaviorException( - 'Unknown scenario type found: ' . get_class($scenario) - ); - } - - $tester->setDryRun($this->dryRun); - $result = max($result, $scenario->accept($tester)); - } - - $this->dispatcher->dispatch( - 'afterFeature', new FeatureEvent($feature, $this->parameters, $result) - ); - } - - return $result; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php b/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php deleted file mode 100644 index 4c66601..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Outline tester. - * - * @author Konstantin Kudryashov - */ -class OutlineTester extends ScenarioTester -{ - /** - * Initializes tester. - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - $this->dispatcher = $container->get('behat.event_dispatcher'); - } - - /** - * Visits & tests OutlineNode. - * - * @param AbstractNode $outline - * - * @return integer - */ - public function visit(AbstractNode $outline) - { - $this->dispatcher->dispatch('beforeOutline', new OutlineEvent($outline)); - - $result = 0; - - // Run examples of outline - foreach ($outline->getExamples()->getHash() as $iteration => $tokens) { - $itResult = $this->visitOutlineExample($outline, $iteration, $tokens); - - $result = max($result, $itResult); - } - - $this->dispatcher->dispatch('afterOutline', new OutlineEvent($outline, $result)); - - return $result; - } - - /** - * Visits & tests OutlineNode example. - * - * @param OutlineNode $outline outline instance - * @param integer $row row number - * @param array $tokens step replacements for tokens - * - * @return integer - */ - private function visitOutlineExample(OutlineNode $outline, $row, array $tokens = array()) - { - $context = $this->container->get('behat.context.dispatcher')->createContext(); - $itResult = 0; - $skip = false; - - $this->dispatcher->dispatch('beforeOutlineExample', new OutlineExampleEvent( - $outline, $row, $context - )); - - // Visit & test background if has one - if ($outline->getFeature()->hasBackground()) { - $bgResult = $this->visitBackground( - $outline->getFeature()->getBackground(), $outline, $context - ); - if (0 !== $bgResult) { - $skip = true; - } - $itResult = max($itResult, $bgResult); - } - - // Visit & test steps - foreach ($outline->getSteps() as $step) { - $stResult = $this->visitStep($step, $outline, $context, $tokens, $skip); - if (0 !== $stResult) { - $skip = true; - } - $itResult = max($itResult, $stResult); - } - - $this->dispatcher->dispatch('afterOutlineExample', new OutlineExampleEvent( - $outline, $row, $context, $itResult, $skip - )); - - return $itResult; - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php b/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php deleted file mode 100644 index e8c5d25..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Scenario Tester. - * - * @author Konstantin Kudryashov - */ -class ScenarioTester implements NodeVisitorInterface -{ - protected $container; - protected $dispatcher; - private $context; - private $dryRun = false; - - /** - * Initializes tester. - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - $this->dispatcher = $container->get('behat.event_dispatcher'); - $this->context = $container->get('behat.context.dispatcher')->createContext(); - } - - /** - * Sets tester to dry-run mode. - * - * @param Boolean $dryRun - */ - public function setDryRun($dryRun = true) - { - $this->dryRun = (bool) $dryRun; - } - - /** - * Visits & tests ScenarioNode. - * - * @param AbstractNode $scenario - * - * @return integer - */ - public function visit(AbstractNode $scenario) - { - $this->dispatcher->dispatch('beforeScenario', new ScenarioEvent($scenario, $this->context)); - - $result = 0; - $skip = false; - - // Visit & test background if has one - if ($scenario->getFeature()->hasBackground()) { - $bgResult = $this->visitBackground( - $scenario->getFeature()->getBackground(), $scenario, $this->context - ); - if (0 !== $bgResult) { - $skip = true; - } - $result = max($result, $bgResult); - } - - // Visit & test steps - foreach ($scenario->getSteps() as $step) { - $stResult = $this->visitStep($step, $scenario, $this->context, array(), $skip); - if (0 !== $stResult) { - $skip = true; - } - $result = max($result, $stResult); - } - - $this->dispatcher->dispatch('afterScenario', new ScenarioEvent( - $scenario, $this->context, $result, $skip - )); - - return $result; - } - - /** - * Visits & tests BackgroundNode. - * - * @param BackgroundNode $background - * @param ScenarioNode $logicalParent - * @param ContextInterface $context - * - * @see BackgroundTester::visit() - * - * @return integer - */ - protected function visitBackground(BackgroundNode $background, ScenarioNode $logicalParent, - ContextInterface $context) - { - $tester = $this->container->get('behat.tester.background'); - $tester->setLogicalParent($logicalParent); - $tester->setContext($context); - $tester->setDryRun($this->dryRun); - - return $background->accept($tester); - } - - /** - * Visits & tests StepNode. - * - * @param StepNode $step step instance - * @param ScenarioNode $logicalParent logical parent of the step - * @param ContextInterface $context context instance - * @param array $tokens step replacements for tokens - * @param boolean $skip mark step as skipped? - * - * @see StepTester::visit() - * - * @return integer - */ - protected function visitStep(StepNode $step, ScenarioNode $logicalParent, - ContextInterface $context, array $tokens = array(), $skip = false) - { - if ($logicalParent instanceof OutlineNode) { - $step = $step->createExampleRowStep($tokens); - } - - $tester = $this->container->get('behat.tester.step'); - $tester->setLogicalParent($logicalParent); - $tester->setContext($context); - $tester->skip($skip || $this->dryRun); - - return $step->accept($tester); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php b/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php deleted file mode 100644 index 761dcb7..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step Tester. - * - * @author Konstantin Kudryashov - */ -class StepTester implements NodeVisitorInterface -{ - private $logicalParent; - private $dispatcher; - private $context; - private $definitions; - private $skip = false; - - /** - * Initializes tester. - * - * @param ContainerInterface $container - */ - public function __construct(ContainerInterface $container) - { - $this->dispatcher = $container->get('behat.event_dispatcher'); - $this->definitions = $container->get('behat.definition.dispatcher'); - } - - /** - * Sets logical parent of the step, which is always a ScenarioNode. - * - * @param ScenarioNode $parent - */ - public function setLogicalParent(ScenarioNode $parent) - { - $this->logicalParent = $parent; - } - - /** - * Sets run context. - * - * @param ContextInterface $context - */ - public function setContext(ContextInterface $context) - { - $this->context = $context; - } - - /** - * Marks test as skipped. - * - * @param Boolean $skip skip test? - */ - public function skip($skip = true) - { - $this->skip = $skip; - } - - /** - * Visits & tests StepNode. - * - * @param AbstractNode $step - * - * @return integer - */ - public function visit(AbstractNode $step) - { - $this->dispatcher->dispatch('beforeStep', new StepEvent( - $step, $this->logicalParent, $this->context - )); - $afterEvent = $this->executeStep($step); - $this->dispatcher->dispatch('afterStep', $afterEvent); - - return $afterEvent->getResult(); - } - - /** - * Searches and runs provided step with DefinitionDispatcher. - * - * @param StepNode $step step node - * - * @return StepEvent - */ - protected function executeStep(StepNode $step) - { - $context = $this->context; - $result = null; - $definition = null; - $exception = null; - $snippet = null; - - try { - $definition = $this->definitions->findDefinition($this->context, $step); - - if ($this->skip) { - return new StepEvent( - $step, $this->logicalParent, $context, StepEvent::SKIPPED, $definition - ); - } - - try { - $this->executeStepDefinition($step, $definition); - $result = StepEvent::PASSED; - } catch (PendingException $e) { - $result = StepEvent::PENDING; - $exception = $e; - } catch (\Exception $e) { - $result = StepEvent::FAILED; - $exception = $e; - } - } catch (UndefinedException $e) { - $result = StepEvent::UNDEFINED; - $snippet = $this->definitions->proposeDefinition($this->context, $step); - $exception = $e; - } catch (\Exception $e) { - $result = StepEvent::FAILED; - $exception = $e; - } - - return new StepEvent( - $step, $this->logicalParent, $context, $result, $definition, $exception, $snippet - ); - } - - /** - * Executes provided step definition. - * - * @param StepNode $step step node - * @param DefinitionInterface $definition step definition - */ - protected function executeStepDefinition(StepNode $step, DefinitionInterface $definition) - { - $this->executeStepsChain($step, $definition->run($this->context)); - } - - /** - * Executes steps chain (if there's one). - * - * @param StepNode $step step node - * @param mixed $chain chain - * - * @throws \Exception - */ - private function executeStepsChain(StepNode $step, $chain = null) - { - if (null === $chain) { - return; - } - - $chain = is_array($chain) ? $chain : array($chain); - foreach ($chain as $chainItem) { - if ($chainItem instanceof SubstepInterface) { - $substepNode = $chainItem->getStepNode(); - $substepNode->setParent($step->getParent()); - $substepEvent = $this->executeStep($substepNode); - - if (StepEvent::PASSED !== $substepEvent->getResult()) { - throw $substepEvent->getException(); - } - } elseif (is_callable($chainItem)) { - $this->executeStepsChain($step, call_user_func($chainItem)); - } - } - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Util/LICENSE b/vendor/behat/behat/src/Behat/Behat/Util/LICENSE deleted file mode 100644 index 886394c..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/LICENSE +++ /dev/null @@ -1,128 +0,0 @@ - The "Artistic License" - - Preamble - -The intent of this document is to state the conditions under which a -Package may be copied, such that the Copyright Holder maintains some -semblance of artistic control over the development of the package, -while giving the users of the package the right to use and distribute -the Package in a more-or-less customary fashion, plus the right to make -reasonable modifications. - -Definitions: - - "Package" refers to the collection of files distributed by the - Copyright Holder, and derivatives of that collection of files - created through textual modification. - - "Standard Version" refers to such a Package if it has not been - modified, or has been modified in accordance with the wishes - of the Copyright Holder as specified below. - - "Copyright Holder" is whoever is named in the copyright or - copyrights for the package. - - "You" is you, if you're thinking about copying or distributing - this Package. - - "Reasonable copying fee" is whatever you can justify on the - basis of media cost, duplication charges, time of people involved, - and so on. (You will not be required to justify it to the - Copyright Holder, but only to the computing community at large - as a market that must bear the fee.) - - "Freely Available" means that no fee is charged for the item - itself, though there may be fees involved in handling the item. - It also means that recipients of the item may redistribute it - under the same conditions they received it. - -1. You may make and give away verbatim copies of the source form of the -Standard Version of this Package without restriction, provided that you -duplicate all of the original copyright notices and associated disclaimers. - -2. You may apply bug fixes, portability fixes and other modifications -derived from the Public Domain or from the Copyright Holder. A Package -modified in such a way shall still be considered the Standard Version. - -3. You may otherwise modify your copy of this Package in any way, provided -that you insert a prominent notice in each changed file stating how and -when you changed that file, and provided that you do at least ONE of the -following: - - a) place your modifications in the Public Domain or otherwise make them - Freely Available, such as by posting said modifications to Usenet or - an equivalent medium, or placing the modifications on a major archive - site such as uunet.uu.net, or by allowing the Copyright Holder to include - your modifications in the Standard Version of the Package. - - b) use the modified Package only within your corporation or organization. - - c) rename any non-standard executables so the names do not conflict - with standard executables, which must also be provided, and provide - a separate manual page for each non-standard executable that clearly - documents how it differs from the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -4. You may distribute the programs of this Package in object code or -executable form, provided that you do at least ONE of the following: - - a) distribute a Standard Version of the executables and library files, - together with instructions (in the manual page or equivalent) on where - to get the Standard Version. - - b) accompany the distribution with the machine-readable source of - the Package with your modifications. - - c) give non-standard executables non-standard names, and clearly - document the differences in manual pages (or equivalent), together - with instructions on where to get the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -5. You may charge a reasonable copying fee for any distribution of this -Package. You may charge any fee you choose for support of this -Package. You may not charge a fee for this Package itself. However, -you may distribute this Package in aggregate with other (possibly -commercial) programs as part of a larger (possibly commercial) software -distribution provided that you do not advertise this Package as a -product of your own. You may embed this Package's interpreter within -an executable of yours (by linking); this shall be construed as a mere -form of aggregation, provided that the complete Standard Version of the -interpreter is so embedded. - -6. The scripts and library files supplied as input to or produced as -output from the programs of this Package do not automatically fall -under the copyright of this Package, but belong to whoever generated -them, and may be sold commercially, and may be aggregated with this -Package. If such scripts or library files are aggregated with this -Package via the so-called "undump" or "unexec" methods of producing a -binary executable image, then distribution of such an image shall -neither be construed as a distribution of this Package nor shall it -fall under the restrictions of Paragraphs 3 and 4, provided that you do -not represent such an executable image as a Standard Version of this -Package. - -7. C subroutines (or comparably compiled subroutines in other -languages) supplied by you and linked into this Package in order to -emulate subroutines and variables of the language defined by this -Package shall not be considered part of this Package, but are the -equivalent of input as in Paragraph 6, provided these subroutines do -not change the language in any way that would cause it to fail the -regression tests for the language. - -8. Aggregation of this Package with a commercial distribution is always -permitted provided that the use of this Package is embedded; that is, -when no overt attempt is made to make this Package's interfaces visible -to the end user of the commercial distribution. Such use shall not be -construed as a distribution of this Package. - -9. The name of the Copyright Holder may not be used to endorse or promote -products derived from this software without specific prior written permission. - -10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - - The End - diff --git a/vendor/behat/behat/src/Behat/Behat/Util/Transliterator.php b/vendor/behat/behat/src/Behat/Behat/Util/Transliterator.php deleted file mode 100644 index 1196904..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/Transliterator.php +++ /dev/null @@ -1,427 +0,0 @@ - - * @author Jonathan H. Wage - * @author - */ -class Transliterator -{ - /** - * Check if a string has utf7 characters in it - * - * By bmorel at ssi dot fr - * - * @param string $string - * @return boolean $bool - */ - public static function seemsUtf8($string) - { - for ($i = 0; $i < strlen($string); $i++) { - if (ord($string[$i]) < 0x80) continue; # 0bbbbbbb - elseif ((ord($string[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb - elseif ((ord($string[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb - elseif ((ord($string[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb - elseif ((ord($string[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb - elseif ((ord($string[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b - else return false; # Does not match any model - for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ? - if ((++$i == strlen($string)) || ((ord($string[$i]) & 0xC0) != 0x80)) - - return false; - } - } - - return true; - } - - /** - * Remove any illegal characters, accents, etc. - * - * @param string $string String to unaccent - * @return string $string Unaccented string - */ - public static function unaccent($string) - { - if (!preg_match('/[\x80-\xff]/', $string)) { - return $string; - } - - if (self::seemsUtf8($string)) { - $chars = array( - // Decompositions for Latin-1 Supplement - chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', - chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', - chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', - chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', - chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', - chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', - chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', - chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', - chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', - chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', - chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', - chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', - chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', - chr(195).chr(159) => 's', chr(195).chr(160) => 'a', - chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', - chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', - chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', - chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', - chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', - chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', - chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', - chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', - chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', - chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', - chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', - chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', - chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', - chr(195).chr(191) => 'y', - // Decompositions for Latin Extended-A - chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', - chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', - chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', - chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', - chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', - chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', - chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', - chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', - chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', - chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', - chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', - chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', - chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', - chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', - chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', - chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', - chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', - chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', - chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', - chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', - chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', - chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', - chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', - chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', - chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', - chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', - chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', - chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', - chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', - chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', - chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', - chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', - chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', - chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', - chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', - chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', - chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', - chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', - chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', - chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', - chr(197).chr(148) => 'R', chr(197).chr(149) => 'r', - chr(197).chr(150) => 'R', chr(197).chr(151) => 'r', - chr(197).chr(152) => 'R', chr(197).chr(153) => 'r', - chr(197).chr(154) => 'S', chr(197).chr(155) => 's', - chr(197).chr(156) => 'S', chr(197).chr(157) => 's', - chr(197).chr(158) => 'S', chr(197).chr(159) => 's', - chr(197).chr(160) => 'S', chr(197).chr(161) => 's', - chr(197).chr(162) => 'T', chr(197).chr(163) => 't', - chr(197).chr(164) => 'T', chr(197).chr(165) => 't', - chr(197).chr(166) => 'T', chr(197).chr(167) => 't', - chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', - chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', - chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', - chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', - chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', - chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', - chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', - chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', - chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', - chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', - chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', - chr(197).chr(190) => 'z', chr(197).chr(191) => 's', - // Euro Sign - chr(226).chr(130).chr(172) => 'E', - // GBP (Pound) Sign - chr(194).chr(163) => '', - 'Ä' => 'Ae', 'ä' => 'ae', 'Ü' => 'Ue', 'ü' => 'ue', - 'Ö' => 'Oe', 'ö' => 'oe', 'ß' => 'ss', - // Norwegian characters - 'Å'=>'Aa','Æ'=>'Ae','Ø'=>'O','æ'=>'a','ø'=>'o','å'=>'aa' - ); - - $string = strtr($string, $chars); - } else { - // Assume ISO-8859-1 if not UTF-8 - $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158) - .chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194) - .chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202) - .chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210) - .chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218) - .chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227) - .chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235) - .chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243) - .chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251) - .chr(252).chr(253).chr(255); - - $chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy"; - - $string = strtr($string, $chars['in'], $chars['out']); - $doubleChars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); - $doubleChars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); - $string = str_replace($doubleChars['in'], $doubleChars['out'], $string); - } - - return $string; - } - - /** - * US-ASCII transliterations of Unicode text - * Ported Sean M. Burke's Text::Unidecode Perl module (He did all the hard work!) - * Warning: you should only pass this well formed UTF-8! - * Be aware it works by making a copy of the input string which it appends transliterated - * characters to - it uses a PHP output buffer to do this - it means, memory use will increase, - * requiring up to the same amount again as the input string - * - * @see http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm - * @param string UTF-8 string to convert - * @author - * @param string (default = ?) Character use if character unknown - * @return string US-ASCII string - */ - public static function utf8ToAscii($str, $unknown = '?') - { - static $UTF8_TO_ASCII; - - if (strlen($str) == 0) { - return; - } - - preg_match_all('/.{1}|[^\x00]{1,1}$/us', $str, $ar); - $chars = $ar[0]; - - foreach ($chars as $i => $c) { - $ud = 0; - if (ord($c{0})>=0 && ord($c{0})<=127) { continue; } // ASCII - next please - if (ord($c{0})>=192 && ord($c{0})<=223) { $ord = (ord($c{0})-192)*64 + (ord($c{1})-128); } - if (ord($c{0})>=224 && ord($c{0})<=239) { $ord = (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128); } - if (ord($c{0})>=240 && ord($c{0})<=247) { $ord = (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128); } - if (ord($c{0})>=248 && ord($c{0})<=251) { $ord = (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128); } - if (ord($c{0})>=252 && ord($c{0})<=253) { $ord = (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128); } - if (ord($c{0})>=254 && ord($c{0})<=255) { $chars{$i} = $unknown; continue; } //error - - $bank = $ord >> 8; - - if (!array_key_exists($bank, (array) $UTF8_TO_ASCII)) { - $bankfile = __DIR__. '/data/'. sprintf("x%02x",$bank).'.php'; - if (file_exists($bankfile)) { - include $bankfile; - } else { - $UTF8_TO_ASCII[$bank] = array(); - } - } - - $newchar = $ord & 255; - if (array_key_exists($newchar, $UTF8_TO_ASCII[$bank])) { - $chars{$i} = $UTF8_TO_ASCII[$bank][$newchar]; - } else { - $chars{$i} = $unknown; - } - } - - return implode('', $chars); - } - - /** - * Does not transliterate correctly eastern languages - * - * @param string $text - * @param string $separator - * @return string - */ - public static function urlize($text, $separator = '-') - { - $text = self::unaccent($text); - - return self::postProcessText($text, $separator); - } - - /** - * Uses transliteration tables to convert any kind of utf8 character - * - * @param string $text - * @param string $separator - * @return string $text - */ - public static function transliterate($text, $separator = '-') - { - if (preg_match('/[\x80-\xff]/', $text) && self::validUtf8($text)) { - $text = self::utf8ToAscii($text); - } - - return self::postProcessText($text, $separator); - } - - /** - * Tests a string as to whether it's valid UTF-8 and supported by the - * Unicode standard - * Note: this function has been modified to simple return true or false - * @author - * @param string UTF-8 encoded string - * @return boolean true if valid - * @see http://hsivonen.iki.fi/php-utf8/ - */ - public static function validUtf8($str) - { - $mState = 0; // cached expected number of octets after the current octet - // until the beginning of the next UTF8 character sequence - $mUcs4 = 0; // cached Unicode character - $mBytes = 1; // cached expected number of octets in the current sequence - - $len = strlen($str); - for ($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); - if ($mState == 0) { - // When mState is zero we expect either a US-ASCII character or a - // multi-octet sequence. - if (0 == (0x80 & ($in))) { - // US-ASCII, pass straight through. - $mBytes = 1; - } elseif (0xC0 == (0xE0 & ($in))) { - // First octet of 2 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x1F) << 6; - $mState = 1; - $mBytes = 2; - } elseif (0xE0 == (0xF0 & ($in))) { - // First octet of 3 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x0F) << 12; - $mState = 2; - $mBytes = 3; - } elseif (0xF0 == (0xF8 & ($in))) { - // First octet of 4 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x07) << 18; - $mState = 3; - $mBytes = 4; - } elseif (0xF8 == (0xFC & ($in))) { - /* First octet of 5 octet sequence. - * - * This is illegal because the encoded codepoint must be either - * (a) not the shortest form or - * (b) outside the Unicode range of 0-0x10FFFF. - * Rather than trying to resynchronize, we will carry on until the end - * of the sequence and let the later error handling code catch it. - */ - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x03) << 24; - $mState = 4; - $mBytes = 5; - } elseif (0xFC == (0xFE & ($in))) { - // First octet of 6 octet sequence, see comments for 5 octet sequence. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 1) << 30; - $mState = 5; - $mBytes = 6; - } else { - /* Current octet is neither in the US-ASCII range nor a legal first - * octet of a multi-octet sequence. - */ - - return false; - } - } else { - // When mState is non-zero, we expect a continuation of the multi-octet - // sequence - if (0x80 == (0xC0 & ($in))) { - // Legal continuation. - $shift = ($mState - 1) * 6; - $tmp = $in; - $tmp = ($tmp & 0x0000003F) << $shift; - $mUcs4 |= $tmp; - /** - * End of the multi-octet sequence. mUcs4 now contains the final - * Unicode codepoint to be output - */ - if (0 == --$mState) { - /* - * Check for illegal sequences and codepoints. - */ - // From Unicode 3.1, non-shortest form is illegal - if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || - ((3 == $mBytes) && ($mUcs4 < 0x0800)) || - ((4 == $mBytes) && ($mUcs4 < 0x10000)) || - (4 < $mBytes) || - // From Unicode 3.2, surrogate characters are illegal - (($mUcs4 & 0xFFFFF800) == 0xD800) || - // Codepoints outside the Unicode range are illegal - ($mUcs4 > 0x10FFFF) - ) { - return false; - } - //initialize UTF8 cache - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - } - } else { - /** - *((0xC0 & (*in) != 0x80) && (mState != 0)) - * Incomplete multi-octet sequence. - */ - - return false; - } - } - } - - return true; - } - - /** - * Cleans up the text and adds separator - * - * @param string $text - * @param string $separator - * @return string - */ - private static function postProcessText($text, $separator) - { - if (function_exists('mb_strtolower')) { - $text = mb_strtolower($text); - } else { - $text = strtolower($text); - } - - // Remove all none word characters - $text = preg_replace('/\W/', ' ', $text); - - // More stripping. Replace spaces with dashes - $text = strtolower(preg_replace('/[^A-Z^a-z^0-9^\/]+/', $separator, - preg_replace('/([a-z\d])([A-Z])/', '\1_\2', - preg_replace('/([A-Z]+)([A-Z][a-z])/', '\1_\2', - preg_replace('/::/', '/', $text))))); - - return trim($text, $separator); - } -} diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x00.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x00.php deleted file mode 100644 index b7285f9..0000000 Binary files a/vendor/behat/behat/src/Behat/Behat/Util/data/x00.php and /dev/null differ diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x01.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x01.php deleted file mode 100644 index 8d03503..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x01.php +++ /dev/null @@ -1,4 +0,0 @@ -','^','V','^','V',"'",'-','/','\\',',','_','\\','/',':','.','`',"'",'^','V','+','-','V','.','@',',','~','"','R','X','G','l','s','x','?','','','','','','','','V','=','"','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x03.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x03.php deleted file mode 100644 index c269b0c..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x03.php +++ /dev/null @@ -1,4 +0,0 @@ -','[?]','[?]','[?]','f','v','u','yr','y','w','th','th','a','o','ac','ae','o','o','o','oe','on','r','k','c','k','g','ng','g','g','w','h','h','h','h','n','n','n','i','e','j','g','ae','a','eo','p','z','s','s','s','c','z','t','t','d','b','b','p','p','e','m','m','m','l','l','ng','ng','d','o','ear','ior','qu','qu','qu','s','yr','yr','yr','q','x','.',':','+','17','18','19','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x18.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x18.php deleted file mode 100644 index 94cb1b7..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x18.php +++ /dev/null @@ -1,4 +0,0 @@ -','.','..','...','.',' -',' - -','','','','','',' ','%0','%00',"'","''","'''",'`','``','```','^','<','>','*','!!','!?','-','_','-','^','***','--','/','-[',']-','[?]','?!','!?','7','PP','(]','[)','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','','','','','','','0','','','','4','5','6','7','8','9','+','-','=','(',')','n','0','1','2','3','4','5','6','7','8','9','+','-','=','(',')','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','ECU','CL','Cr','FF','L','mil','N','Pts','Rs','W','NS','D','EU','K','T','Dr','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','','','','','','','','','','','','','','','','','','','','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x27.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x27.php deleted file mode 100644 index 6b1ae42..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x27.php +++ /dev/null @@ -1,4 +0,0 @@ -','>','>','>','>','>','V','V','V','V','<','<','<','<','<','<','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','#','#','#','#','#','^','^','^','O','#','#','#','#','#','#','#','#','[?]','[?]','[?]','[?]','[?]','[?]','[?]', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x31.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x31.php deleted file mode 100644 index e390265..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x31.php +++ /dev/null @@ -1,4 +0,0 @@ -','n','t','q',',','*','5','<','-','u','8','v','.','%','[','$','+','x','!','&',';',':','4','\\','0','z','7','(','_','?','w',']','#','y',')','=','[d7]','[d17]','[d27]','[d127]','[d37]','[d137]','[d237]','[d1237]','[d47]','[d147]','[d247]','[d1247]','[d347]','[d1347]','[d2347]','[d12347]','[d57]','[d157]','[d257]','[d1257]','[d357]','[d1357]','[d2357]','[d12357]','[d457]','[d1457]','[d2457]','[d12457]','[d3457]','[d13457]','[d23457]','[d123457]','[d67]','[d167]','[d267]','[d1267]','[d367]','[d1367]','[d2367]','[d12367]','[d467]','[d1467]','[d2467]','[d12467]','[d3467]','[d13467]','[d23467]','[d123467]','[d567]','[d1567]','[d2567]','[d12567]','[d3567]','[d13567]','[d23567]','[d123567]','[d4567]','[d14567]','[d24567]','[d124567]','[d34567]','[d134567]','[d234567]','[d1234567]','[d8]','[d18]','[d28]','[d128]','[d38]','[d138]','[d238]','[d1238]','[d48]','[d148]','[d248]','[d1248]','[d348]','[d1348]','[d2348]','[d12348]','[d58]','[d158]','[d258]','[d1258]','[d358]','[d1358]','[d2358]','[d12358]','[d458]','[d1458]','[d2458]','[d12458]','[d3458]','[d13458]','[d23458]','[d123458]','[d68]','[d168]','[d268]','[d1268]','[d368]','[d1368]','[d2368]','[d12368]','[d468]','[d1468]','[d2468]','[d12468]','[d3468]','[d13468]','[d23468]','[d123468]','[d568]','[d1568]','[d2568]','[d12568]','[d3568]','[d13568]','[d23568]','[d123568]','[d4568]','[d14568]','[d24568]','[d124568]','[d34568]','[d134568]','[d234568]','[d1234568]','[d78]','[d178]','[d278]','[d1278]','[d378]','[d1378]','[d2378]','[d12378]','[d478]','[d1478]','[d2478]','[d12478]','[d3478]','[d13478]','[d23478]','[d123478]','[d578]','[d1578]','[d2578]','[d12578]','[d3578]','[d13578]','[d23578]','[d123578]','[d4578]','[d14578]','[d24578]','[d124578]','[d34578]','[d134578]','[d234578]','[d1234578]','[d678]','[d1678]','[d2678]','[d12678]','[d3678]','[d13678]','[d23678]','[d123678]','[d4678]','[d14678]','[d24678]','[d124678]','[d34678]','[d134678]','[d234678]','[d1234678]','[d5678]','[d15678]','[d25678]','[d125678]','[d35678]','[d135678]','[d235678]','[d1235678]','[d45678]','[d145678]','[d245678]','[d1245678]','[d345678]','[d1345678]','[d2345678]','[d12345678]', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x4d.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x4d.php deleted file mode 100644 index b53a1c9..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x4d.php +++ /dev/null @@ -1,4 +0,0 @@ - ','<<','>> ','[','] ','{','} ','[(',')] ','@','X ','[','] ','[[',']] ','((',')) ','[[',']] ','~ ','``',"''",',,','@','1','2','3','4','5','6','7','8','9','','','','','','','~','+','+','+','+','','@',' // ','+10+','+20+','+30+','[?]','[?]','[?]','','','[?]','a','a','i','i','u','u','e','e','o','o','ka','ga','ki','gi','ku','gu','ke','ge','ko','go','sa','za','si','zi','su','zu','se','ze','so','zo','ta','da','ti','di','tu','tu','du','te','de','to','do','na','ni','nu','ne','no','ha','ba','pa','hi','bi','pi','hu','bu','pu','he','be','pe','ho','bo','po','ma','mi','mu','me','mo','ya','ya','yu','yu','yo','yo','ra','ri','ru','re','ro','wa','wa','wi','we','wo','n','vu','[?]','[?]','[?]','[?]','','','','','"','"','[?]','[?]','a','a','i','i','u','u','e','e','o','o','ka','ga','ki','gi','ku','gu','ke','ge','ko','go','sa','za','si','zi','su','zu','se','ze','so','zo','ta','da','ti','di','tu','tu','du','te','de','to','do','na','ni','nu','ne','no','ha','ba','pa','hi','bi','pi','hu','bu','pu','he','be','pe','ho','bo','po','ma','mi','mu','me','mo','ya','ya','yu','yu','yo','yo','ra','ri','ru','re','ro','wa','wa','wi','we','wo','n','vu','ka','ke','va','vi','ve','vo','','','"','"', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x55.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x55.php deleted file mode 100644 index 4156655..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x55.php +++ /dev/null @@ -1,4 +0,0 @@ ->','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','(g)','(n)','(d)','(r)','(m)','(b)','(s)','()','(j)','(c)','(k)','(t)','(p)','(h)','(ga)','(na)','(da)','(ra)','(ma)','(ba)','(sa)','(a)','(ja)','(ca)','(ka)','(ta)','(pa)','(ha)','[?]','[?]','[?]','KIS ','(1) ','(2) ','(3) ','(4) ','(5) ','(6) ','(7) ','(8) ','(9) ','(10) ','(Yue) ','(Huo) ','(Shui) ','(Mu) ','(Jin) ','(Tu) ','(Ri) ','(Zhu) ','(You) ','(She) ','(Ming) ','(Te) ','(Cai) ','(Zhu) ','(Lao) ','(Mi) ','(Nan) ','(Nu) ','(Shi) ','(You) ','(Yin) ','(Zhu) ','(Xiang) ','(Xiu) ','(Xie) ','(Zheng) ','(Shang) ','(Zhong) ','(Xia) ','(Zuo) ','(You) ','(Yi) ','(Zong) ','(Xue) ','(Jian) ','(Qi) ','(Zi) ','(Xie) ','(Ye) ','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','1M','2M','3M','4M','5M','6M','7M','8M','9M','10M','11M','12M','[?]','[?]','[?]','[?]','a','i','u','u','o','ka','ki','ku','ke','ko','sa','si','su','se','so','ta','ti','tu','te','to','na','ni','nu','ne','no','ha','hi','hu','he','ho','ma','mi','mu','me','mo','ya','yu','yo','ra','ri','ru','re','ro','wa','wi','we','wo', -); diff --git a/vendor/behat/behat/src/Behat/Behat/Util/data/x57.php b/vendor/behat/behat/src/Behat/Behat/Util/data/x57.php deleted file mode 100644 index 2481030..0000000 --- a/vendor/behat/behat/src/Behat/Behat/Util/data/x57.php +++ /dev/null @@ -1,4 +0,0 @@ - - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/behat/gherkin/README.md b/vendor/behat/gherkin/README.md deleted file mode 100644 index 911d9f9..0000000 --- a/vendor/behat/gherkin/README.md +++ /dev/null @@ -1,95 +0,0 @@ -Behat Gherkin Parser -==================== - -[![Build Status](https://secure.travis-ci.org/Behat/Gherkin.png)](http://travis-ci.org/Behat/Gherkin) - -This is the new Gherkin parser for Behat. It comes bundled with more than 40 native languages (see i18n) support & much cleaner architecture than previous one. - -Gherkin parser from now on will be separate project from Behat core itself and has no foreign dependencies, which means, that you can use it in your DSL-specific projects. - -Usage ------ - -``` php - array( - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline|Scenario Template', - 'examples' => 'Examples|Scenarios', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But' - ), - 'en-pirate' => array( - 'feature' => 'Ahoy matey!', - 'background' => 'Yo-ho-ho', - 'scenario' => 'Heave to', - 'scenario_outline' => 'Shiver me timbers', - 'examples' => 'Dead men tell no tales', - 'given' => 'Gangway!', - 'when' => 'Blimey!', - 'then' => 'Let go and haul', - 'and' => 'Aye', - 'but' => 'Avast!' - ) -)); -$lexer = new Behat\Gherkin\Lexer($keywords); -$parser = new Behat\Gherkin\Parser($lexer); - -$feature = $parser->parse(file_get_contents('some.feature')); -``` - -Note on Patches/Pull Requests ------------------------------ - -* Fork the project `develop` branch (all new development happens here, master for releases & hotfixes only). -* Make your feature addition or bug fix. -* Add unit tests for it (look at tests/Behat/Gherkin for examples). - This is important so I don't break it in a future version unintentionally. -* Commit -* Send me a pull request. - -Installing Dependencies ------------------------ - -``` bash -wget -nc http://getcomposer.org/composer.phar -php composer.phar update -``` - -Running tests -------------- - -``` bash -phpunit -``` - -Contributing to Gherkin Transaltions ------------------------------------- - -Gherkin supports →40 different languages and you could add more! You might notice -`i18n.php` file in the root of the library. This file is downloaded and **autogenerated** -from original [cucumber/gherkin translations](https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.yml). -So, in order to fix/update/add some translation, you should send Pull Request to the -`cucumber/gherkin` repository. `Behat\Gherkin` will redownload/regenerate translations -from there before each release. - -It might sounds difficult, but this way of dictionary sharing gives you ability to -migrate your `*.feature` files from language to language and library to library without -the need to rewrite/modify them - same dictionary (Gherkin) used everywhere. - -Copyright ---------- - -Copyright (c) 2010 Konstantin Kudryashov (ever.zet). See LICENSE for details. - -Contributors ------------- - -* Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] diff --git a/vendor/behat/gherkin/autoload.php b/vendor/behat/gherkin/autoload.php deleted file mode 100644 index 8dbef14..0000000 --- a/vendor/behat/gherkin/autoload.php +++ /dev/null @@ -1,3 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Release script. - * - * Usage: bin/release 1.0.0RC1 beta - * - * @author Konstantin Kudryashov - */ - -require_once __DIR__.'/../vendor/autoload.php'; - -if (!isset($argv[1])) { - throw new Exception('You must provide version.'); -} - -if (!isset($argv[2])) { - throw new Exception('You must provide stability status (alpha/beta/stable).'); -} - -$version = $argv[1]; -$stability = $argv[2]; - -print sprintf("Releasing gherkin version \"%s\".\n", $version); - -if (is_file('package.xml')) { - unlink(getcwd().'/package.xml'); -} - -copy(getcwd().'/package.xml.tpl', getcwd().'/package.xml'); - -$dirs = array( - 'src', - 'vendor', -); - -$xmlSourceFiles = ''; -foreach ($dirs as $dir) { - $finder = new Symfony\Component\Finder\Finder(); - $sourceFiles = $finder->files()->in($dir); - - foreach ($sourceFiles as $file) { - $xmlSourceFiles .= ''."\n"; - } -} - -function replaceTokens($files, $beginToken, $endToken, $tokens) -{ - if (!is_array($files)) { - $files = array($files); - } - - foreach ($files as $file) { - $content = file_get_contents($file); - foreach ($tokens as $key => $value) { - $content = str_replace($beginToken.$key.$endToken, $value, $content, $count); - } - - file_put_contents($file, $content); - } -} - -replaceTokens(getcwd().'/package.xml', '##', '##', array( - 'GHERKIN_VERSION' => $version - , 'CURRENT_DATE' => date('Y-m-d') - , 'SOURCE_FILES' => $xmlSourceFiles - , 'STABILITY' => $stability -)); - -system('pear package'); -unlink(getcwd().'/package.xml'); - -exit(0); diff --git a/vendor/behat/gherkin/bin/update_i18n b/vendor/behat/gherkin/bin/update_i18n deleted file mode 100644 index 03e0a17..0000000 --- a/vendor/behat/gherkin/bin/update_i18n +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env php - $keywords) { - foreach (array('given', 'when', 'then', 'and', 'but') as $type) { - $stepTypes = explode('|', $keywords[$type]); - - if ('*' === $stepTypes[0]) { - array_shift($stepTypes); - } - - $array[$lang][$type] = implode('|', $stepTypes); - } -} - -file_put_contents(__DIR__.'/../i18n.php', '=5.3.1", - "symfony/finder": ">=2.0,<2.2-dev" - }, - "require-dev": { - "symfony/yaml": ">=2.0,<2.2-dev", - "symfony/translation": ">=2.0,<2.2-dev", - "symfony/config": ">=2.0,<2.2-dev" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files", - "symfony/translation": "If you want to use Symfony2 translations adapter", - "symfony/config": "If you want to use Config component to manage resources" - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - } -} diff --git a/vendor/behat/gherkin/i18n.php b/vendor/behat/gherkin/i18n.php deleted file mode 100644 index adfb2e1..0000000 --- a/vendor/behat/gherkin/i18n.php +++ /dev/null @@ -1,692 +0,0 @@ - - array ( - 'name' => 'English', - 'native' => 'English', - 'feature' => 'Feature|Business Need|Ability', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline|Scenario Template', - 'examples' => 'Examples|Scenarios', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But', - ), - 'ar' => - array ( - 'name' => 'Arabic', - 'native' => 'العربية', - 'feature' => 'خاصية', - 'background' => 'الخلفية', - 'scenario' => 'سيناريو', - 'scenario_outline' => 'سيناريو مخطط', - 'examples' => 'امثلة', - 'given' => 'بفرض', - 'when' => 'متى|عندما', - 'then' => 'اذاً|ثم', - 'and' => 'و', - 'but' => 'لكن', - ), - 'bm' => - array ( - 'name' => 'Malay', - 'native' => 'Bahasa Melayu', - 'feature' => 'Fungsi', - 'background' => 'Latar Belakang', - 'scenario' => 'Senario', - 'scenario_outline' => 'Menggariskan Senario ', - 'examples' => 'Contoh ', - 'given' => 'Bagi', - 'when' => 'Apabila', - 'then' => 'Kemudian', - 'and' => 'Dan', - 'but' => 'Tetapi', - ), - 'bg' => - array ( - 'name' => 'Bulgarian', - 'native' => 'български', - 'feature' => 'Функционалност', - 'background' => 'Предистория', - 'scenario' => 'Сценарий', - 'scenario_outline' => 'Рамка на сценарий', - 'examples' => 'Примери', - 'given' => 'Дадено', - 'when' => 'Когато', - 'then' => 'То', - 'and' => 'И', - 'but' => 'Но', - ), - 'ca' => - array ( - 'name' => 'Catalan', - 'native' => 'català', - 'background' => 'Rerefons|Antecedents', - 'feature' => 'Característica|Funcionalitat', - 'scenario' => 'Escenari', - 'scenario_outline' => 'Esquema de l\'escenari', - 'examples' => 'Exemples', - 'given' => 'Donat|Donada|Atès|Atesa', - 'when' => 'Quan', - 'then' => 'Aleshores|Cal', - 'and' => 'I', - 'but' => 'Però', - ), - 'cy-GB' => - array ( - 'name' => 'Welsh', - 'native' => 'Cymraeg', - 'background' => 'Cefndir', - 'feature' => 'Arwedd', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Amlinellol', - 'examples' => 'Enghreifftiau', - 'given' => 'Anrhegedig a', - 'when' => 'Pryd', - 'then' => 'Yna', - 'and' => 'A', - 'but' => 'Ond', - ), - 'cs' => - array ( - 'name' => 'Czech', - 'native' => 'Česky', - 'feature' => 'Požadavek', - 'background' => 'Pozadí|Kontext', - 'scenario' => 'Scénář', - 'scenario_outline' => 'Náčrt Scénáře|Osnova scénáře', - 'examples' => 'Příklady', - 'given' => 'Pokud', - 'when' => 'Když', - 'then' => 'Pak', - 'and' => 'A také|A', - 'but' => 'Ale', - ), - 'da' => - array ( - 'name' => 'Danish', - 'native' => 'dansk', - 'feature' => 'Egenskab', - 'background' => 'Baggrund', - 'scenario' => 'Scenarie', - 'scenario_outline' => 'Abstrakt Scenario', - 'examples' => 'Eksempler', - 'given' => 'Givet', - 'when' => 'Når', - 'then' => 'Så', - 'and' => 'Og', - 'but' => 'Men', - ), - 'de' => - array ( - 'name' => 'German', - 'native' => 'Deutsch', - 'feature' => 'Funktionalität', - 'background' => 'Grundlage', - 'scenario' => 'Szenario', - 'scenario_outline' => 'Szenariogrundriss', - 'examples' => 'Beispiele', - 'given' => 'Angenommen|Gegeben sei', - 'when' => 'Wenn', - 'then' => 'Dann', - 'and' => 'Und', - 'but' => 'Aber', - ), - 'en-au' => - array ( - 'name' => 'Australian', - 'native' => 'Australian', - 'feature' => 'Crikey', - 'background' => 'Background', - 'scenario' => 'Mate', - 'scenario_outline' => 'Blokes', - 'examples' => 'Cobber', - 'given' => 'Ya know how', - 'when' => 'When', - 'then' => 'Ya gotta', - 'and' => 'N', - 'but' => 'Cept', - ), - 'en-lol' => - array ( - 'name' => 'LOLCAT', - 'native' => 'LOLCAT', - 'feature' => 'OH HAI', - 'background' => 'B4', - 'scenario' => 'MISHUN', - 'scenario_outline' => 'MISHUN SRSLY', - 'examples' => 'EXAMPLZ', - 'given' => 'I CAN HAZ', - 'when' => 'WEN', - 'then' => 'DEN', - 'and' => 'AN', - 'but' => 'BUT', - ), - 'en-pirate' => - array ( - 'name' => 'Pirate', - 'native' => 'Pirate', - 'feature' => 'Ahoy matey!', - 'background' => 'Yo-ho-ho', - 'scenario' => 'Heave to', - 'scenario_outline' => 'Shiver me timbers', - 'examples' => 'Dead men tell no tales', - 'given' => 'Gangway!', - 'when' => 'Blimey!', - 'then' => 'Let go and haul', - 'and' => 'Aye', - 'but' => 'Avast!', - ), - 'en-Scouse' => - array ( - 'name' => 'Scouse', - 'native' => 'Scouse', - 'feature' => 'Feature', - 'background' => 'Dis is what went down', - 'scenario' => 'The thing of it is', - 'scenario_outline' => 'Wharrimean is', - 'examples' => 'Examples', - 'given' => 'Givun|Youse know when youse got', - 'when' => 'Wun|Youse know like when', - 'then' => 'Dun|Den youse gotta', - 'and' => 'An', - 'but' => 'Buh', - ), - 'en-tx' => - array ( - 'name' => 'Texan', - 'native' => 'Texan', - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'All y\'all', - 'examples' => 'Examples', - 'given' => 'Given y\'all', - 'when' => 'When y\'all', - 'then' => 'Then y\'all', - 'and' => 'And y\'all', - 'but' => 'But y\'all', - ), - 'eo' => - array ( - 'name' => 'Esperanto', - 'native' => 'Esperanto', - 'feature' => 'Trajto', - 'background' => 'Fono', - 'scenario' => 'Scenaro', - 'scenario_outline' => 'Konturo de la scenaro', - 'examples' => 'Ekzemploj', - 'given' => 'Donitaĵo', - 'when' => 'Se', - 'then' => 'Do', - 'and' => 'Kaj', - 'but' => 'Sed', - ), - 'es' => - array ( - 'name' => 'Spanish', - 'native' => 'español', - 'background' => 'Antecedentes', - 'feature' => 'Característica', - 'scenario' => 'Escenario', - 'scenario_outline' => 'Esquema del escenario', - 'examples' => 'Ejemplos', - 'given' => 'Dado|Dada|Dados|Dadas', - 'when' => 'Cuando', - 'then' => 'Entonces', - 'and' => 'Y', - 'but' => 'Pero', - ), - 'et' => - array ( - 'name' => 'Estonian', - 'native' => 'eesti keel', - 'feature' => 'Omadus', - 'background' => 'Taust', - 'scenario' => 'Stsenaarium', - 'scenario_outline' => 'Raamstsenaarium', - 'examples' => 'Juhtumid', - 'given' => 'Eeldades', - 'when' => 'Kui', - 'then' => 'Siis', - 'and' => 'Ja', - 'but' => 'Kuid', - ), - 'fi' => - array ( - 'name' => 'Finnish', - 'native' => 'suomi', - 'feature' => 'Ominaisuus', - 'background' => 'Tausta', - 'scenario' => 'Tapaus', - 'scenario_outline' => 'Tapausaihio', - 'examples' => 'Tapaukset', - 'given' => 'Oletetaan', - 'when' => 'Kun', - 'then' => 'Niin', - 'and' => 'Ja', - 'but' => 'Mutta', - ), - 'fr' => - array ( - 'name' => 'French', - 'native' => 'français', - 'feature' => 'Fonctionnalité', - 'background' => 'Contexte', - 'scenario' => 'Scénario', - 'scenario_outline' => 'Plan du scénario|Plan du Scénario', - 'examples' => 'Exemples', - 'given' => 'Soit|Etant donné|Etant donnée|Etant donnés|Etant données|Étant donné|Étant donnée|Étant donnés|Étant données', - 'when' => 'Quand|Lorsque|Lorsqu\'<', - 'then' => 'Alors', - 'and' => 'Et', - 'but' => 'Mais', - ), - 'he' => - array ( - 'name' => 'Hebrew', - 'native' => 'עברית', - 'feature' => 'תכונה', - 'background' => 'רקע', - 'scenario' => 'תרחיש', - 'scenario_outline' => 'תבנית תרחיש', - 'examples' => 'דוגמאות', - 'given' => 'בהינתן', - 'when' => 'כאשר', - 'then' => 'אז|אזי', - 'and' => 'וגם', - 'but' => 'אבל', - ), - 'hr' => - array ( - 'name' => 'Croatian', - 'native' => 'hrvatski', - 'feature' => 'Osobina|Mogućnost|Mogucnost', - 'background' => 'Pozadina', - 'scenario' => 'Scenarij', - 'scenario_outline' => 'Skica|Koncept', - 'examples' => 'Primjeri|Scenariji', - 'given' => 'Zadan|Zadani|Zadano', - 'when' => 'Kada|Kad', - 'then' => 'Onda', - 'and' => 'I', - 'but' => 'Ali', - ), - 'hu' => - array ( - 'name' => 'Hungarian', - 'native' => 'magyar', - 'feature' => 'Jellemző', - 'background' => 'Háttér', - 'scenario' => 'Forgatókönyv', - 'scenario_outline' => 'Forgatókönyv vázlat', - 'examples' => 'Példák', - 'given' => 'Amennyiben|Adott', - 'when' => 'Majd|Ha|Amikor', - 'then' => 'Akkor', - 'and' => 'És', - 'but' => 'De', - ), - 'id' => - array ( - 'name' => 'Indonesian', - 'native' => 'Bahasa Indonesia', - 'feature' => 'Fitur', - 'background' => 'Dasar', - 'scenario' => 'Skenario', - 'scenario_outline' => 'Skenario konsep', - 'examples' => 'Contoh', - 'given' => 'Dengan', - 'when' => 'Ketika', - 'then' => 'Maka', - 'and' => 'Dan', - 'but' => 'Tapi', - ), - 'is' => - array ( - 'name' => 'Icelandic', - 'native' => 'Íslenska', - 'feature' => 'Eiginleiki', - 'background' => 'Bakgrunnur', - 'scenario' => 'Atburðarás', - 'scenario_outline' => 'Lýsing Atburðarásar|Lýsing Dæma', - 'examples' => 'Dæmi|Atburðarásir', - 'given' => 'Ef', - 'when' => 'Þegar', - 'then' => 'Þá', - 'and' => 'Og', - 'but' => 'En', - ), - 'it' => - array ( - 'name' => 'Italian', - 'native' => 'italiano', - 'feature' => 'Funzionalità', - 'background' => 'Contesto', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Schema dello scenario', - 'examples' => 'Esempi', - 'given' => 'Dato|Data|Dati|Date', - 'when' => 'Quando', - 'then' => 'Allora', - 'and' => 'E', - 'but' => 'Ma', - ), - 'ja' => - array ( - 'name' => 'Japanese', - 'native' => '日本語', - 'feature' => 'フィーチャ|機能', - 'background' => '背景', - 'scenario' => 'シナリオ', - 'scenario_outline' => 'シナリオアウトライン|シナリオテンプレート|テンプレ|シナリオテンプレ', - 'examples' => '例|サンプル', - 'given' => '前提<', - 'when' => 'もし<', - 'then' => 'ならば<', - 'and' => 'かつ<', - 'but' => 'しかし<|但し<|ただし<', - ), - 'ko' => - array ( - 'name' => 'Korean', - 'native' => '한국어', - 'background' => '배경', - 'feature' => '기능', - 'scenario' => '시나리오', - 'scenario_outline' => '시나리오 개요', - 'examples' => '예', - 'given' => '조건<|먼저<', - 'when' => '만일<|만약<', - 'then' => '그러면<', - 'and' => '그리고<', - 'but' => '하지만<|단<', - ), - 'lt' => - array ( - 'name' => 'Lithuanian', - 'native' => 'lietuvių kalba', - 'feature' => 'Savybė', - 'background' => 'Kontekstas', - 'scenario' => 'Scenarijus', - 'scenario_outline' => 'Scenarijaus šablonas', - 'examples' => 'Pavyzdžiai|Scenarijai|Variantai', - 'given' => 'Duota', - 'when' => 'Kai', - 'then' => 'Tada', - 'and' => 'Ir', - 'but' => 'Bet', - ), - 'lu' => - array ( - 'name' => 'Luxemburgish', - 'native' => 'Lëtzebuergesch', - 'feature' => 'Funktionalitéit', - 'background' => 'Hannergrond', - 'scenario' => 'Szenario', - 'scenario_outline' => 'Plang vum Szenario', - 'examples' => 'Beispiller', - 'given' => 'ugeholl', - 'when' => 'wann', - 'then' => 'dann', - 'and' => 'an|a', - 'but' => 'awer|mä', - ), - 'lv' => - array ( - 'name' => 'Latvian', - 'native' => 'latviešu', - 'feature' => 'Funkcionalitāte|Fīča', - 'background' => 'Konteksts|Situācija', - 'scenario' => 'Scenārijs', - 'scenario_outline' => 'Scenārijs pēc parauga', - 'examples' => 'Piemēri|Paraugs', - 'given' => 'Kad', - 'when' => 'Ja', - 'then' => 'Tad', - 'and' => 'Un', - 'but' => 'Bet', - ), - 'nl' => - array ( - 'name' => 'Dutch', - 'native' => 'Nederlands', - 'feature' => 'Functionaliteit', - 'background' => 'Achtergrond', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Abstract Scenario', - 'examples' => 'Voorbeelden', - 'given' => 'Gegeven|Stel', - 'when' => 'Als', - 'then' => 'Dan', - 'and' => 'En', - 'but' => 'Maar', - ), - 'no' => - array ( - 'name' => 'Norwegian', - 'native' => 'norsk', - 'feature' => 'Egenskap', - 'background' => 'Bakgrunn', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenariomal|Abstrakt Scenario', - 'examples' => 'Eksempler', - 'given' => 'Gitt', - 'when' => 'Når', - 'then' => 'Så', - 'and' => 'Og', - 'but' => 'Men', - ), - 'pl' => - array ( - 'name' => 'Polish', - 'native' => 'polski', - 'feature' => 'Właściwość|Funkcja|Aspekt|Potrzeba biznesowa', - 'background' => 'Założenia', - 'scenario' => 'Scenariusz', - 'scenario_outline' => 'Szablon scenariusza', - 'examples' => 'Przykłady', - 'given' => 'Zakładając|Mając', - 'when' => 'Jeżeli|Jeśli|Gdy|Kiedy', - 'then' => 'Wtedy', - 'and' => 'Oraz|I', - 'but' => 'Ale', - ), - 'pt' => - array ( - 'name' => 'Portuguese', - 'native' => 'português', - 'background' => 'Contexto|Cenário de Fundo|Cenario de Fundo|Fundo', - 'feature' => 'Funcionalidade|Característica|Caracteristica', - 'scenario' => 'Cenário|Cenario', - 'scenario_outline' => 'Esquema do Cenário|Esquema do Cenario|Delineação do Cenário|Delineacao do Cenario', - 'examples' => 'Exemplos|Cenários|Cenarios', - 'given' => 'Dado|Dada|Dados|Dadas', - 'when' => 'Quando', - 'then' => 'Então|Entao', - 'and' => 'E', - 'but' => 'Mas', - ), - 'ro' => - array ( - 'name' => 'Romanian', - 'native' => 'română', - 'background' => 'Context', - 'feature' => 'Functionalitate|Funcționalitate|Funcţionalitate', - 'scenario' => 'Scenariu', - 'scenario_outline' => 'Structura scenariu|Structură scenariu', - 'examples' => 'Exemple', - 'given' => 'Date fiind|Dat fiind|Dati fiind|Dați fiind|Daţi fiind', - 'when' => 'Cand|Când', - 'then' => 'Atunci', - 'and' => 'Si|Și|Şi', - 'but' => 'Dar', - ), - 'ru' => - array ( - 'name' => 'Russian', - 'native' => 'русский', - 'feature' => 'Функция|Функционал|Свойство', - 'background' => 'Предыстория|Контекст', - 'scenario' => 'Сценарий', - 'scenario_outline' => 'Структура сценария', - 'examples' => 'Примеры', - 'given' => 'Допустим|Дано|Пусть', - 'when' => 'Если|Когда', - 'then' => 'То|Тогда', - 'and' => 'И|К тому же|Также', - 'but' => 'Но|А', - ), - 'sv' => - array ( - 'name' => 'Swedish', - 'native' => 'Svenska', - 'feature' => 'Egenskap', - 'background' => 'Bakgrund', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Abstrakt Scenario|Scenariomall', - 'examples' => 'Exempel', - 'given' => 'Givet', - 'when' => 'När', - 'then' => 'Så', - 'and' => 'Och', - 'but' => 'Men', - ), - 'sk' => - array ( - 'name' => 'Slovak', - 'native' => 'Slovensky', - 'feature' => 'Požiadavka', - 'background' => 'Pozadie', - 'scenario' => 'Scenár', - 'scenario_outline' => 'Náčrt Scenáru', - 'examples' => 'Príklady', - 'given' => 'Pokiaľ', - 'when' => 'Keď', - 'then' => 'Tak', - 'and' => 'A', - 'but' => 'Ale', - ), - 'sr-Latn' => - array ( - 'name' => 'Serbian (Latin)', - 'native' => 'Srpski (Latinica)', - 'feature' => 'Funkcionalnost|Mogućnost|Mogucnost|Osobina', - 'background' => 'Kontekst|Osnova|Pozadina', - 'scenario' => 'Scenario|Primer', - 'scenario_outline' => 'Struktura scenarija|Skica|Koncept', - 'examples' => 'Primeri|Scenariji', - 'given' => 'Zadato|Zadate|Zatati', - 'when' => 'Kada|Kad', - 'then' => 'Onda', - 'and' => 'I', - 'but' => 'Ali', - ), - 'sr-Cyrl' => - array ( - 'name' => 'Serbian', - 'native' => 'Српски', - 'feature' => 'Функционалност|Могућност|Особина', - 'background' => 'Контекст|Основа|Позадина', - 'scenario' => 'Сценарио|Пример', - 'scenario_outline' => 'Структура сценарија|Скица|Концепт', - 'examples' => 'Примери|Сценарији', - 'given' => 'Задато|Задате|Задати', - 'when' => 'Када|Кад', - 'then' => 'Онда', - 'and' => 'И', - 'but' => 'Али', - ), - 'tr' => - array ( - 'name' => 'Turkish', - 'native' => 'Türkçe', - 'feature' => 'Özellik', - 'background' => 'Geçmiş', - 'scenario' => 'Senaryo', - 'scenario_outline' => 'Senaryo taslağı', - 'examples' => 'Örnekler', - 'given' => 'Diyelim ki', - 'when' => 'Eğer ki', - 'then' => 'O zaman', - 'and' => 'Ve', - 'but' => 'Fakat|Ama', - ), - 'uk' => - array ( - 'name' => 'Ukrainian', - 'native' => 'Українська', - 'feature' => 'Функціонал', - 'background' => 'Передумова', - 'scenario' => 'Сценарій', - 'scenario_outline' => 'Структура сценарію', - 'examples' => 'Приклади', - 'given' => 'Припустимо|Припустимо, що|Нехай|Дано', - 'when' => 'Якщо|Коли', - 'then' => 'То|Тоді', - 'and' => 'І|А також|Та', - 'but' => 'Але', - ), - 'uz' => - array ( - 'name' => 'Uzbek', - 'native' => 'Узбекча', - 'feature' => 'Функционал', - 'background' => 'Тарих', - 'scenario' => 'Сценарий', - 'scenario_outline' => 'Сценарий структураси', - 'examples' => 'Мисоллар', - 'given' => 'Агар', - 'when' => 'Агар', - 'then' => 'Унда', - 'and' => 'Ва', - 'but' => 'Лекин|Бирок|Аммо', - ), - 'vi' => - array ( - 'name' => 'Vietnamese', - 'native' => 'Tiếng Việt', - 'feature' => 'Tính năng', - 'background' => 'Bối cảnh', - 'scenario' => 'Tình huống|Kịch bản', - 'scenario_outline' => 'Khung tình huống|Khung kịch bản', - 'examples' => 'Dữ liệu', - 'given' => 'Biết|Cho', - 'when' => 'Khi', - 'then' => 'Thì', - 'and' => 'Và', - 'but' => 'Nhưng', - ), - 'zh-CN' => - array ( - 'name' => 'Chinese simplified', - 'native' => '简体中文', - 'feature' => '功能', - 'background' => '背景', - 'scenario' => '场景|剧本', - 'scenario_outline' => '场景大纲|剧本大纲', - 'examples' => '例子', - 'given' => '假如<|假设<|假定<', - 'when' => '当<', - 'then' => '那么<', - 'and' => '而且<|并且<|同时<', - 'but' => '但是<', - ), - 'zh-TW' => - array ( - 'name' => 'Chinese traditional', - 'native' => '繁體中文', - 'feature' => '功能', - 'background' => '背景', - 'scenario' => '場景|劇本', - 'scenario_outline' => '場景大綱|劇本大綱', - 'examples' => '例子', - 'given' => '假如<|假設<|假定<', - 'when' => '當<', - 'then' => '那麼<', - 'and' => '而且<|並且<|同時<', - 'but' => '但是<', - ), -); \ No newline at end of file diff --git a/vendor/behat/gherkin/libpath.php b/vendor/behat/gherkin/libpath.php deleted file mode 100644 index 35379fe..0000000 --- a/vendor/behat/gherkin/libpath.php +++ /dev/null @@ -1,3 +0,0 @@ - - - gherkin - pear.behat.org - Behat\Gherkin is a BDD DSL for PHP - - Behat\Gherkin is an open source behavior driven development DSL for php 5.3. - - - Konstantin Kudryashov - everzet - ever.zet@gmail.com - yes - - ##CURRENT_DATE## - - ##GHERKIN_VERSION## - 1.0.0 - - - ##STABILITY## - ##STABILITY## - - MIT - - - - - - ##SOURCE_FILES## - - - - - - - - - - - - - - - - - - - 5.3.1 - - - 1.4.0 - - - pcre - - - simplexml - - - xml - - - mbstring - - - - - diff --git a/vendor/behat/gherkin/phpdoc.ini.dist b/vendor/behat/gherkin/phpdoc.ini.dist deleted file mode 100644 index f983946..0000000 --- a/vendor/behat/gherkin/phpdoc.ini.dist +++ /dev/null @@ -1,14 +0,0 @@ -files = "*.php" -ignore = "CVS, .svn, .git, _compiled" -source_path = "./src" -doclet = standard -overview = readme.html -package_comment_dir = ./ -public = on -d = "api" -default_package = "Behat Gherkin" -windowtitle = "Behat Gherkin" -doctitle = "Behat Gherkin: PHP 5.3 Gherkin parser" -header = "Behat Gherkin" -footer = "Behat Gherkin" -tree = on diff --git a/vendor/behat/gherkin/phpunit.xml.dist b/vendor/behat/gherkin/phpunit.xml.dist deleted file mode 100644 index 5f38370..0000000 --- a/vendor/behat/gherkin/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./tests/Behat/Gherkin/ - - - - - - ./src/Behat/Gherkin/ - - - diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php b/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php deleted file mode 100644 index 6ee5785..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Parser cache interface. - * - * @author Konstantin Kudryashov - */ -interface CacheInterface -{ - /** - * Checks that cache for feature exists and is fresh. - * - * @param string $path Feature path - * @param integer $timestamp The last time feature was updated - * - * @return Boolean - */ - public function isFresh($path, $timestamp); - - /** - * Reads feature cache from path. - * - * @param string $path Feature path - * - * @return FeatureNode - */ - public function read($path); - - /** - * Caches feature node. - * - * @param string $path Feature path - * @param FeatureNode $feature Feature instance - */ - public function write($path, FeatureNode $feature); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php b/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php deleted file mode 100644 index f8fe193..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php +++ /dev/null @@ -1,92 +0,0 @@ - -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ - -/** - * File cache. - * Caches feature into a file. - * - * @author Konstantin Kudryashov - */ -class FileCache implements CacheInterface -{ - private $path; - - /** - * Initializes file cache. - * - * @param string $path Path to the folder where to store caches. - */ - public function __construct($path) - { - if (!is_dir($path)) { - mkdir($path, 0777, true); - } - - $this->path = rtrim($path, '/'); - } - - /** - * Checks that cache for feature exists and is fresh. - * - * @param string $path Feature path - * @param integer $timestamp The last time feature was updated - * - * @return Boolean - */ - public function isFresh($path, $timestamp) - { - $cachePath = $this->getCachePathFor($path); - - if (!file_exists($cachePath)) { - return false; - } - - return filemtime($cachePath) > $timestamp; - } - - /** - * Reads feature cache from path. - * - * @param string $path Feature path - * - * @return FeatureNode - */ - public function read($path) - { - return unserialize(file_get_contents($this->getCachePathFor($path))); - } - - /** - * Caches feature node. - * - * @param string $path Feature path - * @param FeatureNode $feature Feature instance - */ - public function write($path, FeatureNode $feature) - { - file_put_contents($this->getCachePathFor($path), serialize($feature)); - } - - /** - * Returns feature cache file path from features path. - * - * @param string $path Feature path - * - * @return string - */ - protected function getCachePathFor($path) - { - return $this->path.'/'.md5($path).'.feature.cache'; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Dumper/GherkinDumper.php b/vendor/behat/gherkin/src/Behat/Gherkin/Dumper/GherkinDumper.php deleted file mode 100644 index d69e477..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Dumper/GherkinDumper.php +++ /dev/null @@ -1,284 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin Dumper. - * - * @author Jean-François Lépine - */ -class GherkinDumper -{ - private $keywords; - private $indent; - - /** - * Constructs dumper. - * - * @param KeywordsInterface $keywords Keywords container - * @param string $indent Indentation - */ - public function __construct(KeywordsInterface $keywords, $indent = ' ') - { - $this->keywords = $keywords; - $this->indent = $indent; - } - - /** - * Dumps a feature. - * - * @see dumpFeature() - * - * @param FeatureNode $feature Feature instance - * - * @return string - */ - public function dump(FeatureNode $feature) - { - return $this->dumpFeature($feature); - } - - /** - * Dumps a background. - * - * @param BackgroundNode $background Background instance - * - * @return string - */ - public function dumpBackground(BackgroundNode $background) - { - $content = $this->dumpKeyword( - $this->keywords->getBackgroundKeywords(), $background->getTitle() - ); - - foreach ($background->getSteps() as $step) { - $content .= - PHP_EOL . $this->dumpIndent(1) - . $this->dumpStep($step); - } - - return $content; - } - - /** - * Dumps comment. - * - * @param string $comment Comment string - * - * @return string - */ - public function dumpComment($comment) - { - return $comment ? '# ' . $comment : ''; - } - - /** - * Dumps feature. - * - * @param FeatureNode $feature Feature instance - * - * @return string - */ - public function dumpFeature(FeatureNode $feature) - { - $language = $feature->getLanguage(); - $this->keywords->setLanguage($language); - - $content = '' - . $this->dumpLanguage($language) - . ($feature->getTags() ? PHP_EOL . $this->dumpTags($feature->getTags(), 0) : '') - . PHP_EOL . $this->dumpKeyword($this->keywords->getFeatureKeywords(), $feature->getTitle(), 0) - . PHP_EOL . $this->dumpText($feature->getDescription(), 1); - - if ($feature->getBackground()) { - $content .= $this->dumpBackground($feature->getBackground()); - } - - $scenarios = $feature->getScenarios(); - foreach ($scenarios as $scenario) { - $content .= PHP_EOL . $this->dumpScenario($scenario); - } - - return $content; - } - - /** - * Dumps keyword. - * - * @param string $keyword Keyword string - * @param string $text Text - * @param integer $indent Indentation - * - * @return string - */ - public function dumpKeyword($keyword, $text, $indent = 0) - { - if (preg_match('!(^.*)\|!', $keyword, $matches)) { - $keyword = $matches[1]; - } - - return $this->dumpIndent($indent) . $keyword . ':' - . ((strlen($text) > 0) ? ' ' . ltrim($this->dumpText($text, $indent + 1)) : '') - ; - } - - /** - * Dumps scenario. - * - * @param ScenarioNode $scenario Scenario instance - * - * @return string - */ - public function dumpScenario(ScenarioNode $scenario) - { - $keyWordToUse = $scenario instanceof OutlineNode ? $this->keywords->getOutlineKeywords() : $this->keywords->getScenarioKeywords(); - - $content = '' - . (sizeof($scenario->getTags()) > 0 ? PHP_EOL . $this->dumpTags($scenario->getTags(), 1) : '') - . PHP_EOL . $this->dumpKeyword($keyWordToUse, $scenario->getTitle(), 1) - ; - - foreach ($scenario->getSteps() as $step) { - $content .= - PHP_EOL . $this->dumpIndent(2) - . $this->dumpStep($step); - } - - if ($scenario instanceof OutlineNode) { - $content .= '' - . PHP_EOL . PHP_EOL . $this->dumpKeyword($this->keywords->getExamplesKeywords(), '', 1) - ; - $examples = $scenario->getExamples(); - $content .= $this->dumpTableNode($examples, 2); - } - - return $content; - } - - /** - * Dumps table node. - * - * @param TableNode $tableNode Table node - * @param integer $indent Indentation - * @return string - */ - public function dumpTableNode(TableNode $tableNode, $indent = 0) - { - $len = sizeof($tableNode->getRows()); - $content = ''; - for ($i = 0; $i < $len; $i++) { - $content .= PHP_EOL . $this->dumpIndent($indent) - . $tableNode->getRowAsString($i); - } - - return $content; - } - - /** - * Dumps indentation. - * - * @param integer $indent Indentation - * - * @return string - */ - public function dumpIndent($indent) - { - return str_repeat($this->indent, $indent); - } - - /** - * Dumps a step. - * - * @param StepNode $step Step node instance - * - * @return string - * - * @throws Exception if invalid step type providen - */ - public function dumpStep(StepNode $step) - { - switch ($step->getType()) { - case 'Given': - $kw = $this->keywords->getGivenKeywords(); - break; - case 'When': - $kw = $this->keywords->getWhenKeywords(); - break; - case 'Then': - $kw = $this->keywords->getThenKeywords(); - break; - case 'But': - $kw = $this->keywords->getButKeywords(); - break; - case 'And': - $kw = $this->keywords->getAndKeywords(); - break; - default: - throw new Exception("invalid type given : " . $step->getType()); - } - - return $this->dumpText($kw . ' ' . $step->getText()); - } - - /** - * Dumps text. - * - * @param string $text Text to dump - * @param integer $indent Indentation - * - * @return string - */ - public function dumpText($text, $indent = 0) - { - return $this->dumpIndent($indent) . implode( - PHP_EOL . $this->dumpIndent($indent), - explode(PHP_EOL, $text) - ); - } - - /** - * Dumps tags. - * - * @param array $tags Array of tags - * @param integer $indent Indentation - * - * @return string - */ - public function dumpTags(array $tags, $indent = 0) - { - if (empty($tags)) { - return ''; - } - - return $this->dumpIndent($indent) . '@' . ltrim(implode(' @', $tags)); - } - - /** - * Dumps language tag. - * - * @param string $language Language name - * - * @return string - */ - public function dumpLanguage($language) - { - return $this->dumpComment($this->dumpKeyword('language', $language)); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Exception/Exception.php b/vendor/behat/gherkin/src/Behat/Gherkin/Exception/Exception.php deleted file mode 100644 index 386060f..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Exception/Exception.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Exception extends \Exception -{} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Exception/LexerException.php b/vendor/behat/gherkin/src/Behat/Gherkin/Exception/LexerException.php deleted file mode 100644 index 1655dbf..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Exception/LexerException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class LexerException extends Exception -{} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Exception/ParserException.php b/vendor/behat/gherkin/src/Behat/Gherkin/Exception/ParserException.php deleted file mode 100644 index 469aa4f..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Exception/ParserException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class ParserException extends Exception -{} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php b/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php deleted file mode 100644 index 07c749d..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Filter interface. - * - * @author Konstantin Kudryashov - */ -interface FilterInterface -{ - /** - * Checks if Feature matches specified filter. - * - * @param FeatureNode $feature Feature instance - * - * @return Boolean - */ - public function isFeatureMatch(FeatureNode $feature); - - /** - * Checks if scenario or outline matches specified filter. - * - * @param ScenarioNode $scenario Scenario or Outline node instance - * - * @return Boolean - */ - public function isScenarioMatch(ScenarioNode $scenario); - - /** - * Filters feature according to the filter. - * - * @param FeatureNode $feature - */ - public function filterFeature(FeatureNode $feature); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php b/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php deleted file mode 100644 index 8608973..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Filters scenarios by definition line number. - * - * @author Konstantin Kudryashov - */ -class LineFilter implements FilterInterface -{ - protected $filterLine; - - /** - * Initializes filter. - * - * @param string $filterLine Line of the scenario to filter on - */ - public function __construct($filterLine) - { - $this->filterLine = intval($filterLine); - } - - /** - * Checks if Feature matches specified filter. - * - * @param FeatureNode $feature Feature instance - * - * @return Boolean - */ - public function isFeatureMatch(FeatureNode $feature) - { - return true; - } - - /** - * Checks if scenario or outline matches specified filter. - * - * @param ScenarioNode $scenario Scenario or Outline node instance - * - * @return Boolean - */ - public function isScenarioMatch(ScenarioNode $scenario) - { - if ($this->filterLine === $scenario->getLine()) { - return true; - } - - if ($scenario instanceof OutlineNode && $scenario->hasExamples()) { - return $this->filterLine === $scenario->getLine() - || in_array($this->filterLine, $scenario->getExamples()->getRowLines()); - } - - return false; - } - - /** - * Filters feature according to the filter. - * - * @param FeatureNode $feature - */ - public function filterFeature(FeatureNode $feature) - { - $scenarios = $feature->getScenarios(); - foreach ($scenarios as $i => $scenario) { - if (!$this->isScenarioMatch($scenario)) { - unset($scenarios[$i]); - continue; - } - - if ($scenario instanceof OutlineNode && $scenario->hasExamples()) { - $lines = $scenario->getExamples()->getRowLines(); - $rows = $scenario->getExamples()->getNumeratedRows(); - - if (current($lines) <= $this->filterLine && end($lines) >= $this->filterLine) { - $scenario->getExamples()->setRows(array()); - $scenario->getExamples()->addRow($rows[$lines[0]], $lines[0]); - - if ($lines[0] !== $this->filterLine) { - $scenario->getExamples()->addRow($rows[$this->filterLine], $this->filterLine); - } - } - } - } - - $feature->setScenarios($scenarios); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php b/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php deleted file mode 100644 index fbcfe2d..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Filters scenarios by definition line number range. - * - * @author Fabian Kiss - */ -class LineRangeFilter implements FilterInterface -{ - protected $filterMinLine; - protected $filterMaxLine; - - /** - * Initializes filter. - * - * @param string $filterMinLine Minimum line of a scenario to filter on - * @param string $filterMaxLine Maximum line of a scenario to filter on - */ - public function __construct($filterMinLine, $filterMaxLine) - { - $this->filterMinLine = intval($filterMinLine); - if ($filterMaxLine == '*') { - $this->filterMaxLine = PHP_INT_MAX; - } else { - $this->filterMaxLine = intval($filterMaxLine); - } - } - - /** - * Checks if Feature matches specified filter. - * - * @param FeatureNode $feature Feature instance - * - * @return Boolean - */ - public function isFeatureMatch(FeatureNode $feature) - { - return true; - } - - /** - * Checks if scenario or outline matches specified filter. - * - * @param ScenarioNode $scenario Scenario or Outline node instance - * - * @return Boolean - */ - public function isScenarioMatch(ScenarioNode $scenario) - { - if ($this->filterMinLine <= $scenario->getLine() - && $this->filterMaxLine >= $scenario->getLine()) { - return true; - } - - if ($scenario instanceof OutlineNode && $scenario->hasExamples()) { - foreach ($scenario->getExamples()->getRowLines() as $line) { - if ($line >= $this->filterMinLine && $line <= $this->filterMaxLine) { - return true; - } - } - } - - return false; - } - - /** - * Filters feature according to the filter. - * - * @param FeatureNode $feature - */ - public function filterFeature(FeatureNode $feature) - { - $scenarios = $feature->getScenarios(); - foreach ($scenarios as $i => $scenario) { - if (!$this->isScenarioMatch($scenario)) { - unset($scenarios[$i]); - continue; - } - - if ($scenario instanceof OutlineNode && $scenario->hasExamples()) { - $lines = $scenario->getExamples()->getRowLines(); - $rows = $scenario->getExamples()->getNumeratedRows(); - - $scenario->getExamples()->setRows(array()); - $scenario->getExamples()->addRow($rows[$lines[0]], $lines[0]); - unset($rows[$lines[0]]); - - foreach ($rows as $line => $row) { - if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) { - $scenario->getExamples()->addRow($row, $line); - } - } - } - } - - $feature->setScenarios($scenarios); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php b/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php deleted file mode 100644 index 4827680..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Filters scenarios by feature/scenario name. - * - * @author Konstantin Kudryashov - */ -class NameFilter extends SimpleFilter -{ - protected $filterString; - - /** - * Initializes filter. - * - * @param string $filterString Name filter string - */ - public function __construct($filterString) - { - $this->filterString = trim($filterString); - } - - /** - * Checks if Feature matches specified filter. - * - * @param FeatureNode $feature Feature instance - * - * @return Boolean - */ - public function isFeatureMatch(FeatureNode $feature) - { - if ('/' === $this->filterString[0]) { - return (bool) preg_match($this->filterString, $feature->getTitle()); - } - - return false !== mb_strpos($feature->getTitle(), $this->filterString); - } - - /** - * Checks if scenario or outline matches specified filter. - * - * @param ScenarioNode $scenario Scenario or Outline node instance - * - * @return Boolean - */ - public function isScenarioMatch(ScenarioNode $scenario) - { - if ('/' === $this->filterString[0] && 1 === preg_match($this->filterString, $scenario->getTitle())) { - return true; - } elseif (false !== mb_strpos($scenario->getTitle(), $this->filterString)) { - return true; - } - - if (null !== $scenario->getFeature()) { - return $this->isFeatureMatch($scenario->getFeature()); - } - - return false; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/SimpleFilter.php b/vendor/behat/gherkin/src/Behat/Gherkin/Filter/SimpleFilter.php deleted file mode 100644 index 862a611..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/SimpleFilter.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract filter class. - * - * @author Konstantin Kudryashov - */ -abstract class SimpleFilter implements FilterInterface -{ - /** - * Filters feature according to the filter. - * - * @param FeatureNode $feature - */ - public function filterFeature(FeatureNode $feature) - { - $scenarios = $feature->getScenarios(); - foreach ($scenarios as $i => $scenario) { - if (!$this->isScenarioMatch($scenario)) { - unset($scenarios[$i]); - } - } - - $feature->setScenarios($scenarios); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php b/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php deleted file mode 100644 index d494a66..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Filters scenarios by feature/scenario tag. - * - * @author Konstantin Kudryashov - */ -class TagFilter extends SimpleFilter -{ - protected $filterString; - - /** - * Initializes filter. - * - * @param string $filterString Name filter string - */ - public function __construct($filterString) - { - $this->filterString = trim($filterString); - } - - /** - * Checks if Feature matches specified filter. - * - * @param FeatureNode $feature Feature instance - * - * @return Boolean - */ - public function isFeatureMatch(FeatureNode $feature) - { - return $this->matchesCondition($feature); - } - - /** - * Checks if scenario or outline matches specified filter. - * - * @param ScenarioNode $scenario Scenario or Outline node instance - * - * @return Boolean - */ - public function isScenarioMatch(ScenarioNode $scenario) - { - return $this->matchesCondition($scenario); - } - - /** - * Checks that node matches condition. - * - * @param AbstractNode $node Node to check - * - * @return Boolean - */ - protected function matchesCondition(AbstractNode $node) - { - $satisfies = true; - - foreach (explode('&&', $this->filterString) as $andTags) { - $satisfiesComma = false; - - foreach (explode(',', $andTags) as $tag) { - $tag = str_replace('@', '', trim($tag)); - - if ('~' === $tag[0]) { - $tag = mb_substr($tag, 1); - $satisfiesComma = !$node->hasTag($tag) || $satisfiesComma; - } else { - $satisfiesComma = $node->hasTag($tag) || $satisfiesComma; - } - } - - $satisfies = (false !== $satisfiesComma && $satisfies && $satisfiesComma) || false; - } - - return $satisfies; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php b/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php deleted file mode 100644 index f364b09..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin manager. - * - * @author Konstantin Kudryashov - */ -class Gherkin -{ - protected $freeze = true; - protected $loaders = array(); - protected $filters = array(); - - /** - * Either to freeze features after loading or not. - * - * @param Boolean $freeze To freeze? - */ - public function setFreeze($freeze = true) - { - $this->freeze = (bool) $freeze; - } - - /** - * Adds loader to manager. - * - * @param LoaderInterface $loader Feature loader - */ - public function addLoader(LoaderInterface $loader) - { - $this->loaders[] = $loader; - } - - /** - * Adds filter to manager. - * - * @param FilterInterface $filter Feature/Scenario filter - */ - public function addFilter(FilterInterface $filter) - { - $this->filters[] = $filter; - } - - /** - * Sets base features path. - * - * @param string $path Loaders base path - */ - public function setBasePath($path) - { - foreach ($this->loaders as $loader) { - $loader->setBasePath($path); - } - } - - /** - * Loads & filters resource with added loaders. - * - * @param mixed $resource Resource to load - * @param array $filters Additional filters - * - * @return array - * - * @throws \InvalidArgumentException - */ - public function load($resource, array $filters = array()) - { - $filters = array_merge($this->filters, $filters); - - $matches = array(); - if (preg_match('/^(.*)\:(\d+)-(\d+|\*)$/', $resource, $matches)) { - $resource = $matches[1]; - $filters[] = new LineRangeFilter($matches[2], $matches[3]); - } elseif (preg_match('/^(.*)\:(\d+)$/', $resource, $matches)) { - $resource = $matches[1]; - $filters[] = new LineFilter($matches[2]); - } - - $loader = $this->resolveLoader($resource); - - if (null === $loader) { - if ($resource) { - $message = sprintf('Can\'t find applicable feature loader for: "%s"', $resource); - } else { - $message = sprintf('Can\'t find applicable feature loader'); - } - - throw new \InvalidArgumentException( - $message."\n". - 'Maybe you\'ve forgot to create `features/` folder?' - ); - } - - $features = $loader->load($resource); - foreach ($features as $feature) { - foreach ($filters as $filter) { - $filter->filterFeature($feature); - } - - if ($this->freeze) { - $feature->freeze(); - } - } - - return $features; - } - - /** - * Resolves loader by resource. - * - * @param mixed $resoruce Resource to load - * - * @return LoaderInterface - */ - public function resolveLoader($resource) - { - foreach ($this->loaders as $loader) { - if ($loader->supports($resource)) { - return $loader; - } - } - - return null; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php b/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php deleted file mode 100644 index a048fb2..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Array initializable keywords holder. - * - * $keywords = new Behat\Gherkin\Keywords\ArrayKeywords(array( - * 'en' => array( - * 'feature' => 'Feature', - * 'background' => 'Background', - * 'scenario' => 'Scenario', - * 'scenario_outline' => 'Scenario Outline|Scenario Template', - * 'examples' => 'Examples|Scenarios', - * 'given' => 'Given', - * 'when' => 'When', - * 'then' => 'Then', - * 'and' => 'And', - * 'but' => 'But' - * ), - * 'ru' => array( - * 'feature' => 'Функционал', - * 'background' => 'Предыстория', - * 'scenario' => 'Сценарий', - * 'scenario_outline' => 'Структура сценария', - * 'examples' => 'Значения', - * 'given' => 'Допустим', - * 'when' => 'Если', - * 'then' => 'То', - * 'and' => 'И', - * 'but' => 'Но' - * ) - * )); - * - * @author Konstantin Kudryashov - */ -class ArrayKeywords implements KeywordsInterface -{ - private $keywords = array(); - private $language; - - /** - * Initializes holder with keywords. - * - * @param array $keywords Keywords array - */ - public function __construct(array $keywords) - { - $this->keywords = $keywords; - } - - /** - * Sets keywords holder language. - * - * @param string $language Language name - */ - public function setLanguage($language) - { - if (!isset($this->keywords[$language])) { - $this->language = 'en'; - } else { - $this->language = $language; - } - } - - /** - * Returns Feature keywords (splitted by "|"). - * - * @return string - */ - public function getFeatureKeywords() - { - return $this->keywords[$this->language]['feature']; - } - - /** - * Returns Background keywords (splitted by "|"). - * - * @return string - */ - public function getBackgroundKeywords() - { - return $this->keywords[$this->language]['background']; - } - - /** - * Returns Scenario keywords (splitted by "|"). - * - * @return string - */ - public function getScenarioKeywords() - { - return $this->keywords[$this->language]['scenario']; - } - - /** - * Returns Scenario Outline keywords (splitted by "|"). - * - * @return string - */ - public function getOutlineKeywords() - { - return $this->keywords[$this->language]['scenario_outline']; - } - - /** - * Returns Examples keywords (splitted by "|"). - * - * @return string - */ - public function getExamplesKeywords() - { - return $this->keywords[$this->language]['examples']; - } - - /** - * Returns Given keywords (splitted by "|"). - * - * @return string - */ - public function getGivenKeywords() - { - return $this->keywords[$this->language]['given']; - } - - /** - * Returns When keywords (splitted by "|"). - * - * @return string - */ - public function getWhenKeywords() - { - return $this->keywords[$this->language]['when']; - } - - /** - * Returns Then keywords (splitted by "|"). - * - * @return string - */ - public function getThenKeywords() - { - return $this->keywords[$this->language]['then']; - } - - /** - * Returns And keywords (splitted by "|"). - * - * @return string - */ - public function getAndKeywords() - { - return $this->keywords[$this->language]['and']; - } - - /** - * Returns But keywords (splitted by "|"). - * - * @return string - */ - public function getButKeywords() - { - return $this->keywords[$this->language]['but']; - } - - /** - * Returns all step keywords (Given, When, Then, And, But). - * - * @return string - */ - public function getStepKeywords() - { - return implode('|', array( - $this->getGivenKeywords(), - $this->getWhenKeywords(), - $this->getThenKeywords(), - $this->getAndKeywords(), - $this->getButKeywords() - )); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/CachedArrayKeywords.php b/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/CachedArrayKeywords.php deleted file mode 100644 index cc37475..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/CachedArrayKeywords.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * File initializable keywords holder. - * - * $keywords = new Behat\Gherkin\Keywords\CachedArrayKeywords($file); - * - * @author Konstantin Kudryashov - */ -class CachedArrayKeywords extends ArrayKeywords -{ - /** - * Initializes holder with file. - * - * @param string $file Cached array path - */ - public function __construct($file) - { - parent::__construct(include($file)); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/CucumberKeywords.php b/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/CucumberKeywords.php deleted file mode 100644 index 23d398b..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/CucumberKeywords.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Cucumber-translations reader. - * - * $keywords = new Behat\Gherkin\Keywords\CucumberKeywords($i18nYmlPath); - * - * @author Konstantin Kudryashov - */ -class CucumberKeywords extends ArrayKeywords -{ - /** - * Initializes holder with yaml string OR file. - * - * @param string $yaml Yaml string - */ - public function __construct($yaml) - { - parent::__construct(Yaml::parse($yaml)); - } - - /** - * Returns Feature keywords (splitted by "|"). - * - * @return string - */ - public function getGivenKeywords() - { - return $this->prepareStepString(parent::getGivenKeywords()); - } - - /** - * Returns When keywords (splitted by "|"). - * - * @return string - */ - public function getWhenKeywords() - { - return $this->prepareStepString(parent::getWhenKeywords()); - } - - /** - * Returns Then keywords (splitted by "|"). - * - * @return string - */ - public function getThenKeywords() - { - return $this->prepareStepString(parent::getThenKeywords()); - } - - /** - * Returns And keywords (splitted by "|"). - * - * @return string - */ - public function getAndKeywords() - { - return $this->prepareStepString(parent::getAndKeywords()); - } - - /** - * Returns But keywords (splitted by "|"). - * - * @return string - */ - public function getButKeywords() - { - return $this->prepareStepString(parent::getButKeywords()); - } - - /** - * Trim *| from the begining of the list. - * - * @param string $keywordsString Keywords string - * - * @return string - */ - private function prepareStepString($keywordsString) - { - if (0 === mb_strpos($keywordsString, '*|')) { - $keywordsString = mb_substr($keywordsString, 2); - } - - return $keywordsString; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php b/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php deleted file mode 100644 index a386f09..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php +++ /dev/null @@ -1,323 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin keywords dumper. - * - * @author Konstantin Kudryashov - */ -class KeywordsDumper -{ - private $keywords; - private $keywordsDumper; - - /** - * Initializes dumper. - * - * @param KeywordsInterface $keywords Keywords instance - */ - public function __construct(KeywordsInterface $keywords) - { - $this->keywords = $keywords; - $this->keywordsDumper = array($this, 'dumpKeywords'); - } - - /** - * Sets keywords mapper function. - * - * Callable should accept 2 arguments (array $keywords and Boolean $isShort) - * - * @param callable $mapper Mapper function - */ - public function setKeywordsDumperFunction($mapper) - { - $this->keywordsDumper = $mapper; - } - - /** - * Defaults keywords dumper. - * - * @param array $keywords Keywords list - * @param Boolean $isShort Is short version - * - * @return string - */ - public function dumpKeywords(array $keywords, $isShort) - { - if ($isShort) { - return 1 < count($keywords) ? '('.implode('|', $keywords).')' : $keywords[0]; - } - - return $keywords[0]; - } - - /** - * Dumps keyworded feature into string. - * - * @param string $language Keywords language - * @param Boolean $short Dump short version - * - * @return string|array String for short version and array of features for extended - */ - public function dump($language, $short = true) - { - $this->keywords->setLanguage($language); - $languageComment = ''; - if ('en' !== $language) { - $languageComment = "# language: $language\n"; - } - - $keywords = explode('|', $this->keywords->getFeatureKeywords()); - - if ($short) { - $keywords = call_user_func($this->keywordsDumper, $keywords, $short); - - return trim($languageComment.$this->dumpFeature($keywords, $short)); - } - - $features = array(); - foreach ($keywords as $keyword) { - $keyword = call_user_func($this->keywordsDumper, array($keyword), $short); - $features[] = trim($languageComment.$this->dumpFeature($keyword, $short)); - } - - return $features; - } - - /** - * Dumps feature example. - * - * @param string $keyword Item keyword - * @param Boolean $short Dump short version? - * - * @return string - */ - protected function dumpFeature($keyword, $short = true) - { - $dump = <<keywords->getBackgroundKeywords()); - if ($short) { - $keywords = call_user_func($this->keywordsDumper, $keywords, $short); - $dump .= $this->dumpBackground($keywords, $short); - } else { - $keyword = call_user_func($this->keywordsDumper, array($keywords[0]), $short); - $dump .= $this->dumpBackground($keyword, $short); - } - - // Scenario - $keywords = explode('|', $this->keywords->getScenarioKeywords()); - if ($short) { - $keywords = call_user_func($this->keywordsDumper, $keywords, $short); - $dump .= $this->dumpScenario($keywords, $short); - } else { - foreach ($keywords as $keyword) { - $keyword = call_user_func($this->keywordsDumper, array($keyword), $short); - $dump .= $this->dumpScenario($keyword, $short); - } - } - - // Outline - $keywords = explode('|', $this->keywords->getOutlineKeywords()); - if ($short) { - $keywords = call_user_func($this->keywordsDumper, $keywords, $short); - $dump .= $this->dumpOutline($keywords, $short); - } else { - foreach ($keywords as $keyword) { - $keyword = call_user_func($this->keywordsDumper, array($keyword), $short); - $dump .= $this->dumpOutline($keyword, $short); - } - } - - return $dump; - } - - /** - * Dumps background example. - * - * @param string $keyword Item keyword - * @param Boolean $short Dump short version? - * - * @return string - */ - protected function dumpBackground($keyword, $short = true) - { - $dump = <<dumpStep( - $this->keywords->getGivenKeywords(), 'there is agent A', $short - ); - - // And - $dump .= $this->dumpStep( - $this->keywords->getAndKeywords(), 'there is agent B', $short - ); - - return $dump."\n"; - } - - /** - * Dumps scenario example. - * - * @param string $keyword Item keyword - * @param Boolean $short Dump short version? - * - * @return string - */ - protected function dumpScenario($keyword, $short = true) - { - $dump = <<dumpStep( - $this->keywords->getGivenKeywords(), 'there is agent J', $short - ); - - // And - $dump .= $this->dumpStep( - $this->keywords->getAndKeywords(), 'there is agent K', $short - ); - - // When - $dump .= $this->dumpStep( - $this->keywords->getWhenKeywords(), 'I erase agent K\'s memory', $short - ); - - // Then - $dump .= $this->dumpStep( - $this->keywords->getThenKeywords(), 'there should be agent J', $short - ); - - // But - $dump .= $this->dumpStep( - $this->keywords->getButKeywords(), 'there should not be agent K', $short - ); - - return $dump."\n"; - } - - /** - * Dumps outline example. - * - * @param string $keyword Item keyword - * @param Boolean $short Dump short version? - * - * @return string - */ - protected function dumpOutline($keyword, $short = true) - { - $dump = <<dumpStep( - $this->keywords->getGivenKeywords(), 'there is agent ', $short - ); - - // And - $dump .= $this->dumpStep( - $this->keywords->getAndKeywords(), 'there is agent ', $short - ); - - // When - $dump .= $this->dumpStep( - $this->keywords->getWhenKeywords(), 'I erase agent \'s memory', $short - ); - - // Then - $dump .= $this->dumpStep( - $this->keywords->getThenKeywords(), 'there should be agent ', $short - ); - - // But - $dump .= $this->dumpStep( - $this->keywords->getButKeywords(), 'there should not be agent ', $short - ); - - $keywords = explode('|', $this->keywords->getExamplesKeywords()); - if ($short) { - $keyword = call_user_func($this->keywordsDumper, $keywords, $short); - } else { - $keyword = call_user_func($this->keywordsDumper, array($keywords[0]), $short); - } - - $dump .= <<keywordsDumper, $keywords, $short); - $dump .= <<keywordsDumper, array($keyword), $short); - $dump .= << - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Keywords holder interface. - * - * @author Konstantin Kudryashov - */ -interface KeywordsInterface -{ - /** - * Sets keywords holder language. - * - * @param string $language Language name - */ - public function setLanguage($language); - - /** - * Returns Feature keywords (splitted by "|"). - * - * @return string - */ - public function getFeatureKeywords(); - - /** - * Returns Background keywords (splitted by "|"). - * - * @return string - */ - public function getBackgroundKeywords(); - - /** - * Returns Scenario keywords (splitted by "|"). - * - * @return string - */ - public function getScenarioKeywords(); - - /** - * Returns Scenario Outline keywords (splitted by "|"). - * - * @return string - */ - public function getOutlineKeywords(); - - /** - * Returns Examples keywords (splitted by "|"). - * - * @return string - */ - public function getExamplesKeywords(); - - /** - * Returns Given keywords (splitted by "|"). - * - * @return string - */ - public function getGivenKeywords(); - - /** - * Returns When keywords (splitted by "|"). - * - * @return string - */ - public function getWhenKeywords(); - - /** - * Returns Then keywords (splitted by "|"). - * - * @return string - */ - public function getThenKeywords(); - - /** - * Returns And keywords (splitted by "|"). - * - * @return string - */ - public function getAndKeywords(); - - /** - * Returns But keywords (splitted by "|"). - * - * @return string - */ - public function getButKeywords(); - - /** - * Returns all step keywords (splitted by "|"). - * - * @return string - */ - public function getStepKeywords(); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/SymfonyTranslationKeywords.php b/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/SymfonyTranslationKeywords.php deleted file mode 100644 index ea266d0..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/SymfonyTranslationKeywords.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Symfony Translation Component's keywords holder. - * - * $translator = new Symfony\Component\Translation\Translator('en', new Symfony\Component\Translation\MessageSelector()); - * $translator->addLoader(...); - * $translator->addResource(...); - * ... - * $translator->addResource(...); - * - * $keywords = new Behat\Gherkin\Keywords\SymfonyTranslationKeywords($translator); - * - * @author Konstantin Kudryashov - */ -class SymfonyTranslationKeywords implements KeywordsInterface -{ - private $translator; - private $locale = 'en'; - - /** - * Initializes keywords holder. - * - * @param Translator $translator Translator instance - */ - public function __construct(Translator $translator) - { - $this->translator = $translator; - } - - /** - * Sets keywords holder language. - * - * @param string $language Language name - */ - public function setLanguage($language) - { - $this->locale = $language; - } - - /** - * Returns Feature keywords (splitted by "|"). - * - * @return string - */ - public function getFeatureKeywords() - { - return $this->translator->trans('Feature', array(), 'gherkin', $this->locale); - } - - /** - * Returns Background keywords (splitted by "|"). - * - * @return string - */ - public function getBackgroundKeywords() - { - return $this->translator->trans('Background', array(), 'gherkin', $this->locale); - } - - /** - * Returns Scenario keywords (splitted by "|"). - * - * @return string - */ - public function getScenarioKeywords() - { - return $this->translator->trans('Scenario', array(), 'gherkin', $this->locale); - } - - /** - * Returns Scenario Outline keywords (splitted by "|"). - * - * @return string - */ - public function getOutlineKeywords() - { - return $this->translator->trans('Scenario Outline', array(), 'gherkin', $this->locale); - } - - /** - * Returns Examples keywords (splitted by "|"). - * - * @return string - */ - public function getExamplesKeywords() - { - return $this->translator->trans('Examples', array(), 'gherkin', $this->locale); - } - - /** - * Returns Given keywords (splitted by "|"). - * - * @return string - */ - public function getGivenKeywords() - { - } - - /** - * Returns When keywords (splitted by "|"). - * - * @return string - */ - public function getWhenKeywords() - { - } - - /** - * Returns Then keywords (splitted by "|"). - * - * @return string - */ - public function getThenKeywords() - { - } - - /** - * Returns And keywords (splitted by "|"). - * - * @return string - */ - public function getAndKeywords() - { - } - - /** - * Returns But keywords (splitted by "|"). - * - * @return string - */ - public function getButKeywords() - { - } - - /** - * Returns all step keywords (splitted by "|"). - * - * @return string - */ - public function getStepKeywords() - { - return $this->translator->trans('Given|When|Then|And|But', array(), 'gherkin', $this->locale); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php b/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php deleted file mode 100644 index 2e1d94d..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php +++ /dev/null @@ -1,539 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin lexer. - * - * @author Konstantin Kudryashov - */ -class Lexer -{ - private $lines; - private $line; - private $lineNumber; - private $eos; - private $keywords; - private $keywordsCache = array(); - private $deferredObjects = array(); - private $stash = array(); - private $inPyString = false; - private $pyStringSwallow = 0; - private $featureStarted = false; - private $allowMultilineArguments = false; - private $allowSteps = false; - - /** - * Initializes lexer. - * - * @param KeywordsInterface $keywords Keywords holder - */ - public function __construct(KeywordsInterface $keywords) - { - $this->keywords = $keywords; - } - - /** - * Sets lexer input. - * - * @param string $input Input string - */ - public function setInput($input) - { - // try to detect unsupported encoding - if ('UTF-8' !== mb_detect_encoding($input, 'UTF-8', true)) { - throw new LexerException('Feature file is not in UTF8 encoding'); - } - - $input = strtr($input, array("\r\n" => "\n", "\r" => "\n")); - - $this->lines = explode("\n", $input); - $this->line = array_shift($this->lines); - $this->lineNumber = 1; - $this->eos = false; - - $this->deferredObjects = array(); - $this->stash = array(); - $this->inPyString = false; - $this->pyStringSwallow = 0; - - $this->featureStarted = false; - $this->allowMultilineArguments = false; - $this->allowSteps = false; - } - - /** - * Sets keywords language. - * - * @param string $language Language name - */ - public function setLanguage($language) - { - $this->keywords->setLanguage($language); - $this->keywordsCache = array(); - } - - /** - * Returns next token or previously stashed one. - * - * @return stdClass - */ - public function getAdvancedToken() - { - return $this->getStashedToken() ?: $this->getNextToken(); - } - - /** - * Defers token. - * - * @param stdClass $token Token to defer - */ - public function deferToken(\stdClass $token) - { - $token->defered = true; - $this->deferredObjects[] = $token; - } - - /** - * Predicts for number of tokens. - * - * @param integer $number Number of tokens to predict - * - * @return stdClass - */ - public function predictToken($number = 1) - { - $fetch = $number - count($this->stash); - - while ($fetch-- > 0) { - $this->stash[] = $this->getNextToken(); - } - - return $this->stash[--$number]; - } - - /** - * Constructs token with specified parameters. - * - * @param string $type Token type - * @param string $value Token value - * - * @return stdClass - */ - public function takeToken($type, $value = null) - { - return (Object) array( - 'type' => $type, - 'line' => $this->lineNumber, - 'value' => $value ?: null, - 'defered' => false - ); - } - - /** - * Consumes line from input & increments line counter. - */ - protected function consumeLine() - { - ++$this->lineNumber; - - if (!count($this->lines)) { - $this->eos = true; - - return false; - } - - $this->line = array_shift($this->lines); - } - - /** - * Returns stashed token or false if hasn't. - * - * @return stdClass|Boolean - */ - protected function getStashedToken() - { - return count($this->stash) ? array_shift($this->stash) : null; - } - - /** - * Returns deferred token or false if hasn't. - * - * @return stdClass|Boolean - */ - protected function getDeferredToken() - { - return count($this->deferredObjects) ? array_shift($this->deferredObjects) : null; - } - - /** - * Returns next token from input. - * - * @return stdClass - */ - protected function getNextToken() - { - return $this->getDeferredToken() - ?: $this->scanEOS() - ?: $this->scanLanguage() - ?: $this->scanComment() - ?: $this->scanPyStringOperator() - ?: $this->scanPyStringContent() - ?: $this->scanStep() - ?: $this->scanScenario() - ?: $this->scanBackground() - ?: $this->scanOutline() - ?: $this->scanExamples() - ?: $this->scanFeature() - ?: $this->scanTags() - ?: $this->scanTableRow() - ?: $this->scanNewline() - ?: $this->scanText(); - } - - /** - * Scans for token with specified regex. - * - * @param string $regex Regular expression - * @param string $type Expected token type - * - * @return stdClass|null - */ - protected function scanInput($regex, $type) - { - $matches = array(); - - if (preg_match($regex, $this->line, $matches)) { - $token = $this->takeToken($type, $matches[1]); - - $this->consumeLine(); - - return $token; - } - } - - /** - * Scans for token with specified keywords. - * - * @param string $keywords Keywords (splitted with |) - * @param string $type Expected token type - * - * @return stdClass|null - */ - protected function scanInputForKeywords($keywords, $type) - { - $matches = array(); - - if (preg_match('/^(\s*)('.$keywords.'):\s*(.*)/u', $this->line, $matches)) { - $token = $this->takeToken($type, $matches[3]); - $token->keyword = $matches[2]; - $token->indent = mb_strlen($matches[1]); - - $this->consumeLine(); - - // turn off language searching - if ('Feature' === $type) { - $this->featureStarted = true; - } - - // turn off PyString and Table searching - if (in_array($type, array('Feature', 'Scenario', 'Outline'))) { - $this->allowMultilineArguments = false; - } elseif ('Examples' === $type) { - $this->allowMultilineArguments = true; - } - - // turn on steps searching - if (in_array($type, array('Scenario', 'Background', 'Outline'))) { - $this->allowSteps = true; - } - - return $token; - } - } - - /** - * Scans EOS from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanEOS() - { - if (!$this->eos) { - return; - } - - return $this->takeToken('EOS'); - } - - /** - * Returns keywords for provided type. - * - * @param string $type Keyword type - * - * @return string - */ - protected function getKeywords($type) - { - if (!isset($this->keywordsCache[$type])) { - $getter = 'get' . $type . 'Keywords'; - $keywords = $this->keywords->$getter(); - - if ('Step' === $type) { - $paded = array(); - foreach (explode('|', $keywords) as $keyword) { - $paded[] = false !== mb_strpos($keyword, '<') - ? mb_substr($keyword, 0, -1).'\s*' - : $keyword.'\s+'; - } - - $keywords = implode('|', $paded); - } - - $this->keywordsCache[$type] = $keywords; - } - - return $this->keywordsCache[$type]; - } - - /** - * Scans Feature from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanFeature() - { - return $this->scanInputForKeywords($this->getKeywords('Feature'), 'Feature'); - } - - /** - * Scans Background from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanBackground() - { - return $this->scanInputForKeywords($this->getKeywords('Background'), 'Background'); - } - - /** - * Scans Scenario from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanScenario() - { - return $this->scanInputForKeywords($this->getKeywords('Scenario'), 'Scenario'); - } - - /** - * Scans Scenario Outline from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanOutline() - { - return $this->scanInputForKeywords($this->getKeywords('Outline'), 'Outline'); - } - - /** - * Scans Scenario Outline Examples from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanExamples() - { - return $this->scanInputForKeywords($this->getKeywords('Examples'), 'Examples'); - } - - /** - * Scans Step from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanStep() - { - if (!$this->allowSteps) { - return; - } - - $matches = array(); - - $keywords = $this->getKeywords('Step'); - if (preg_match('/^\s*('.$keywords.')([^\s].+)/u', $this->line, $matches)) { - $token = $this->takeToken('Step', trim($matches[1])); - $token->text = $matches[2]; - - $this->consumeLine(); - $this->allowMultilineArguments = true; - - return $token; - } - } - - /** - * Scans PyString from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanPyStringOperator() - { - if (!$this->allowMultilineArguments) { - return; - } - - $matches = array(); - - if (false !== ($pos = mb_strpos($this->line, '"""'))) { - $this->inPyString =! $this->inPyString; - $token = $this->takeToken('PyStringOperator'); - $this->pyStringSwallow = $pos; - - $this->consumeLine(); - - return $token; - } - } - - /** - * Scans PyString content. - * - * @return stdClass|null - */ - protected function scanPyStringContent() - { - if ($this->inPyString) { - $token = $this->scanText(); - - // swallow trailing spaces - $token->value = preg_replace('/^\s{0,'.$this->pyStringSwallow.'}/', '', $token->value); - - return $token; - } - } - - /** - * Scans Table Row from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanTableRow() - { - if (!$this->allowMultilineArguments) { - return; - } - - $line = trim($this->line); - - if (isset($line[0]) && '|' === $line[0]) { - $token = $this->takeToken('TableRow'); - - $line = mb_substr($line, 1, mb_strlen($line) - 2); - $columns = array_map(function($column) { - return trim(str_replace('\\|', '|', $column)); - }, preg_split('/(?columns = $columns; - - $this->consumeLine(); - - return $token; - } - } - - /** - * Scans Tags from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanTags() - { - $line = trim($this->line); - - if (isset($line[0]) && '@' === $line[0]) { - $token = $this->takeToken('Tag'); - $tags = explode('@', mb_substr($line, 1)); - $tags = array_map('trim', $tags); - $token->tags = $tags; - - $this->consumeLine(); - - return $token; - } - } - - /** - * Scans Language specifier from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanLanguage() - { - if ($this->featureStarted) { - return; - } - - if (!$this->inPyString) { - if (0 === mb_strpos(ltrim($this->line), '#') && false !== mb_strpos($this->line, 'language')) { - return $this->scanInput('/^\s*\#\s*language:\s*([\w_\-]+)\s*$/', 'Language'); - } - } - } - - /** - * Scans Comment from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanComment() - { - if (!$this->inPyString) { - if (0 === mb_strpos(ltrim($this->line), '#')) { - $token = $this->takeToken('Comment', $this->line); - - $this->consumeLine(); - - return $token; - } - } - } - - /** - * Scans Newline from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanNewline() - { - if ('' === trim($this->line)) { - $token = $this->takeToken('Newline', mb_strlen($this->line)); - - $this->consumeLine(); - - return $token; - } - } - - /** - * Scans text from input & returns it if found. - * - * @return stdClass|null - */ - protected function scanText() - { - $token = $this->takeToken('Text', $this->line); - $this->consumeLine(); - - return $token; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/AbstractFileLoader.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/AbstractFileLoader.php deleted file mode 100644 index 06c303c..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/AbstractFileLoader.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract filesystem loader. - * - * @author Konstantin Kudryashov - */ -abstract class AbstractFileLoader implements FileLoaderInterface -{ - protected $basePath; - - /** - * Sets base features path. - * - * @param string $path Base loader path - */ - public function setBasePath($path) - { - $this->basePath = realpath($path); - } - - /** - * Finds relative path for provided absolute (relative to base features path). - * - * @param string $path Absolute path - * - * @return string - */ - protected function findRelativePath($path) - { - if (null !== $this->basePath) { - return strtr($path, array($this->basePath . DIRECTORY_SEPARATOR => '')); - } - - return $path; - } - - /** - * Finds absolute path for provided relative (relative to base features path). - * - * @param string $path Relative path - * - * @return string - */ - protected function findAbsolutePath($path) - { - if (is_file($path) || is_dir($path)) { - return realpath($path); - } - - if (null === $this->basePath) { - return false; - } - - if (is_file($this->basePath . DIRECTORY_SEPARATOR . $path) - || is_dir($this->basePath . DIRECTORY_SEPARATOR . $path)) { - return realpath($this->basePath . DIRECTORY_SEPARATOR . $path); - } - - return false; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php deleted file mode 100644 index 134b760..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php +++ /dev/null @@ -1,252 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * From-array loader. - * - * @author Konstantin Kudryashov - */ -class ArrayLoader implements LoaderInterface -{ - /** - * Checks if current loader supports provided resource. - * - * @param mixed $resource Resource to load - * - * @return Boolean - */ - public function supports($resource) - { - return is_array($resource) && (isset($resource['features']) || isset($resource['feature'])); - } - - /** - * Loads features from provided resource. - * - * @param mixed $resource Resource to load - * - * @return array - */ - public function load($resource) - { - $features = array(); - - if (isset($resource['features'])) { - foreach ($resource['features'] as $iterator => $hash) { - $feature = $this->loadFeatureHash($hash, $iterator); - $features[] = $feature; - } - } elseif (isset($resource['feature'])) { - $feature = $this->loadFeatureHash($resource['feature'], 0); - $features[] = $feature; - } - - return $features; - } - - /** - * Loads feature from provided feature hash. - * - * @param array $hash Feature hash - * @param integer $line Feature definition line - * - * @return FeatureNode - */ - protected function loadFeatureHash(array $hash, $line = 0) - { - $feature = new Node\FeatureNode(null, null, null, isset($hash['line']) ? $hash['line'] : $line); - - $feature->setKeyword(isset($hash['keyword']) ? $hash['keyword'] : 'Feature'); - - if (isset($hash['title'])) { - $feature->setTitle($hash['title']); - } - if (isset($hash['description'])) { - $feature->setDescription($hash['description']); - } - if (isset($hash['tags'])) { - $feature->setTags($hash['tags']); - } - if (isset($hash['language'])) { - $feature->setLanguage($hash['language']); - } - if (isset($hash['background'])) { - $feature->setBackground($this->loadBackgroundHash($hash['background'])); - } - if (isset($hash['scenarios'])) { - foreach ($hash['scenarios'] as $scenarioIterator => $scenarioHash) { - if (isset($scenarioHash['type']) && 'outline' === $scenarioHash['type']) { - $feature->addScenario($this->loadOutlineHash($scenarioHash, $scenarioIterator)); - } else { - $feature->addScenario($this->loadScenarioHash($scenarioHash, $scenarioIterator)); - } - } - } - - return $feature; - } - - /** - * Loads background from provided hash. - * - * @param array $hash Background hash - * - * @return BackgroundNode - */ - protected function loadBackgroundHash(array $hash) - { - $background = new Node\BackgroundNode(null, isset($hash['line']) ? $hash['line'] : 0); - - $background->setKeyword(isset($hash['keyword']) ? $hash['keyword'] : 'Background'); - - if (isset($hash['title'])) { - $background->setTitle($hash['title']); - } - if (isset($hash['steps'])) { - foreach ($hash['steps'] as $stepIterator => $stepHash) { - $background->addStep($this->loadStepHash($stepHash, $stepIterator)); - } - } - - return $background; - } - - /** - * Loads scenario from provided scenario hash. - * - * @param array $hash Scenario hash - * @param integer $line Scenario definition line - * - * @return ScenarioNode - */ - protected function loadScenarioHash(array $hash, $line = 0) - { - $scenario = new Node\ScenarioNode(null, isset($hash['line']) ? $hash['line'] : $line); - - $scenario->setKeyword(isset($hash['keyword']) ? $hash['keyword'] : 'Scenario'); - - if (isset($hash['title'])) { - $scenario->setTitle($hash['title']); - } - if (isset($hash['tags'])) { - $scenario->setTags($hash['tags']); - } - if (isset($hash['steps'])) { - foreach ($hash['steps'] as $stepIterator => $stepHash) { - $scenario->addStep($this->loadStepHash($stepHash, $stepIterator)); - } - } - - return $scenario; - } - - /** - * Loads outline from provided outline hash. - * - * @param array $hash Outline hash - * @param integer $line Outline definition line - * - * @return OutlineNode - */ - protected function loadOutlineHash(array $hash, $line = 0) - { - $outline = new Node\OutlineNode(null, isset($hash['line']) ? $hash['line'] : $line); - - $outline->setKeyword(isset($hash['keyword']) ? $hash['keyword'] : 'Scenario Outline'); - - if (isset($hash['title'])) { - $outline->setTitle($hash['title']); - } - if (isset($hash['tags'])) { - $outline->setTags($hash['tags']); - } - if (isset($hash['examples'])) { - if (isset($hash['examples']['keyword'])) { - $keyword = $hash['examples']['keyword']; - unset($hash['examples']['keyword']); - } else { - $keyword = 'Examples'; - } - $table = $this->loadTableHash($hash['examples']); - $table->setKeyword($keyword); - $outline->setExamples($table); - } - if (isset($hash['steps'])) { - foreach ($hash['steps'] as $stepIterator => $stepHash) { - $outline->addStep($this->loadStepHash($stepHash, $stepIterator)); - } - } - - return $outline; - } - - /** - * Loads step from provided hash. - * - * @param array $hash Step hash - * @param integer $line Step definition line - * - * @return StepNode - */ - protected function loadStepHash(array $hash, $line = 0) - { - $step = new Node\StepNode( - $hash['type'], isset($hash['text']) ? $hash['text'] : null, isset($hash['line']) ? $hash['line'] : $line - ); - - if (isset($hash['arguments'])) { - foreach ($hash['arguments'] as $argumentHash) { - if ('table' === $argumentHash['type']) { - $step->addArgument($this->loadTableHash($argumentHash['rows'])); - } elseif ('pystring' === $argumentHash['type']) { - $step->addArgument($this->loadPyStringHash($argumentHash)); - } - } - } - - return $step; - } - - /** - * Loads table from provided hash. - * - * @param array $hash Table hash - * - * @return TableNode - */ - protected function loadTableHash(array $hash) - { - $table = new Node\TableNode(); - - foreach ($hash as $line => $row) { - $table->addRow($row, $line); - } - - return $table; - } - - /** - * Loads PyString from provided hash. - * - * @param array $hash PyString hash - * - * @return PyStringNode - */ - protected function loadPyStringHash(array $hash) - { - $string = new Node\PyStringNode($hash['text']); - - return $string; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/DirectoryLoader.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/DirectoryLoader.php deleted file mode 100644 index fd10b03..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/DirectoryLoader.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Directory contents loader. - * - * @author Konstantin Kudryashov - */ -class DirectoryLoader extends AbstractFileLoader -{ - protected $gherkin; - - /** - * Initializes loader. - * - * @param Gherkin $gherkin Gherkin manager - */ - public function __construct(Gherkin $gherkin) - { - $this->gherkin = $gherkin; - } - - /** - * Checks if current loader supports provided resource. - * - * @param mixed $resource Resource to load - * - * @return Boolean - */ - public function supports($path) - { - return is_string($path) - && is_dir($this->findAbsolutePath($path)); - } - - /** - * Loads features from provided resource. - * - * @param mixed $resource Resource to load - * - * @return array - */ - public function load($path) - { - $path = $this->findAbsolutePath($path); - - $finder = new Finder(); - $iterator = $finder->files()->sortByName()->in($path); - $features = array(); - - foreach ($iterator as $path) { - $path = (string) $path; - $loader = $this->gherkin->resolveLoader($path); - - if (null !== $loader) { - $features = array_merge($features, $loader->load($path)); - } - } - - return $features; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/FileLoaderInterface.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/FileLoaderInterface.php deleted file mode 100644 index 0dd4176..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/FileLoaderInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * File Loader interface. - * - * @author Konstantin Kudryashov - */ -interface FileLoaderInterface extends LoaderInterface -{ - /** - * Sets base features path. - * - * @param string $path Base loader path - */ - public function setBasePath($path); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/GherkinFileLoader.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/GherkinFileLoader.php deleted file mode 100644 index 2c62c0b..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/GherkinFileLoader.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin *.feature files loader. - * - * @author Konstantin Kudryashov - */ -class GherkinFileLoader extends AbstractFileLoader -{ - protected $parser; - protected $cache; - - /** - * Initializes loader. - * - * @param Parser $parser Parser - * @param CacheInterface $cache Cache layer - */ - public function __construct(Parser $parser, CacheInterface $cache = null) - { - $this->parser = $parser; - $this->cache = $cache; - } - - /** - * Sets cache layer. - * - * @param CacheInterface $cache Cache layer - */ - public function setCache(CacheInterface $cache) - { - $this->cache = $cache; - } - - /** - * Checks if current loader supports provided resource. - * - * @param mixed $resource Resource to load - * - * @return Boolean - */ - public function supports($path) - { - return is_string($path) - && is_file($absolute = $this->findAbsolutePath($path)) - && 'feature' === pathinfo($absolute, PATHINFO_EXTENSION); - } - - /** - * Loads features from provided resource. - * - * @param mixed $resource Resource to load - * - * @return array - */ - public function load($path) - { - $path = $this->findAbsolutePath($path); - - if ($this->cache) { - if ($this->cache->isFresh($path, filemtime($path))) { - $feature = $this->cache->read($path); - } elseif (null !== $feature = $this->parseFeature($path)) { - $this->cache->write($path, $feature); - } - } else { - $feature = $this->parseFeature($path); - } - - return null !== $feature ? array($feature) : array(); - } - - /** - * Parses feature at provided absolute path. - * - * @param string $path Feature path - * - * @return FeatureNode - */ - protected function parseFeature($path) - { - $filename = $this->findRelativePath($path); - $content = file_get_contents($path); - $feature = $this->parser->parse($content, $filename); - - return $feature; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php deleted file mode 100644 index a07e822..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Loader interface. - * - * @author Konstantin Kudryashov - */ -interface LoaderInterface -{ - /** - * Checks if current loader supports provided resource. - * - * @param mixed $resource Resource to load - * - * @return Boolean - */ - public function supports($resource); - - /** - * Loads features from provided resource. - * - * @param mixed $resource Resource to load - * - * @return array - */ - public function load($resource); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php b/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php deleted file mode 100644 index 50af5a9..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Yaml files loader. - * - * @author Konstantin Kudryashov - */ -class YamlFileLoader extends ArrayLoader implements FileLoaderInterface -{ - protected $basePath; - - /** - * Checks if current loader supports provided resource. - * - * @param mixed $resource Resource to load - * - * @return Boolean - */ - public function supports($path) - { - return is_string($path) - && is_file($absolute = $this->findAbsolutePath($path)) - && 'yml' === pathinfo($absolute, PATHINFO_EXTENSION); - } - - /** - * Loads features from provided resource. - * - * @param mixed $resource Resource to load - * - * @return array - */ - public function load($path) - { - $path = $this->findAbsolutePath($path); - $hash = Yaml::parse($path); - - $features = parent::load($hash); - $filename = $this->findRelativePath($path); - - foreach ($features as $feature) { - $feature->setFile($filename); - } - - return $features; - } - - /** - * Sets base features path. - * - * @param string $path Base loader path - */ - public function setBasePath($path) - { - $this->basePath = realpath($path); - } - - /** - * Finds relative path for provided absolute (relative to base features path). - * - * @param string $path Absolute path - * - * @return string - */ - protected function findRelativePath($path) - { - if (null !== $this->basePath) { - return strtr($path, array($this->basePath . DIRECTORY_SEPARATOR => '')); - } - - return $path; - } - - /** - * Finds absolute path for provided relative (relative to base features path). - * - * @param string $path Relative path - * - * @return string - */ - protected function findAbsolutePath($path) - { - if (is_file($path) || is_dir($path)) { - return realpath($path); - } elseif (is_file($this->basePath . DIRECTORY_SEPARATOR . $path) - || is_dir($this->basePath . DIRECTORY_SEPARATOR . $path)) { - return realpath($this->basePath . DIRECTORY_SEPARATOR . $path); - } - - return false; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php deleted file mode 100644 index 876ef67..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -abstract class AbstractNode -{ - private $line; - private $keyword; - - /** - * Initializes node. - * - * @param integer $line Line number - */ - public function __construct($line = 0) - { - $this->line = $line; - } - - /** - * Accepts specific visitor & visits current node. - * - * @param NodeVisitorInterface $visitor Node visitor - * - * @return mixed - */ - public function accept(NodeVisitorInterface $visitor) - { - return $visitor->visit($this); - } - - /** - * Returns node line number. - * - * @return integer - */ - public function getLine() - { - return $this->line; - } - - /** - * Sets current node definition keyword. - * - * @param string $keyword Keyword - * - * @throws \LogicException if feature is frozen - */ - public function setKeyword($keyword) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen node keyword.'); - } - - $this->keyword = $keyword; - } - - /** - * Returns current node definition keyword. - * - * @return string - */ - public function getKeyword() - { - return $this->keyword; - } - - /** - * Checks whether node has been frozen. - * - * @return Boolean - */ - abstract public function isFrozen(); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractScenarioNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractScenarioNode.php deleted file mode 100644 index 4c374f3..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractScenarioNode.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -abstract class AbstractScenarioNode extends AbstractNode -{ - protected $title; - protected $steps = array(); - protected $feature; - - /** - * Initializes scenario. - * - * @param string $title Scenario title - * @param integer $line Definition line - */ - public function __construct($title = null, $line = 0) - { - parent::__construct($line); - - $this->title = $title; - } - - /** - * Sets scenario title. - * - * @param string $title Scenario title - * - * @throws \LogicException if feature is frozen - */ - public function setTitle($title) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change scenario/background title in frozen feature.'); - } - - $this->title = $title; - } - - /** - * Returns scenario title. - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Adds step to the node. - * - * @param StepNode $step Step - * - * @throws \LogicException if feature is frozen - */ - public function addStep(StepNode $step) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change scenario/background steps in frozen feature.'); - } - - $step->setParent($this); - $this->steps[] = $step; - } - - /** - * Sets scenario steps. - * - * @param array $steps Array of StepNode - * - * @throws \LogicException if feature is frozen - */ - public function setSteps(array $steps) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change scenario/background steps in frozen feature.'); - } - - $this->steps = array(); - - foreach ($steps as $step) { - $this->addStep($step); - } - } - - /** - * Checks if node has steps. - * - * @return Boolean - */ - public function hasSteps() - { - return count($this->steps) > 0; - } - - /** - * Returns scenario steps. - * - * @return array - */ - public function getSteps() - { - return $this->steps; - } - - /** - * Sets parent feature of the node. - * - * @param FeatureNode $feature Feature instance - * - * @throws \LogicException if feature is frozen - */ - public function setFeature(FeatureNode $feature) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to reassign scenario/background in frozen feature.'); - } - - $this->feature = $feature; - } - - /** - * Returns parent feature of the node. - * - * @return FeatureNode - */ - public function getFeature() - { - return $this->feature; - } - - /** - * Returns definition file. - * - * @return string - */ - public function getFile() - { - return null !== $this->feature - ? $this->feature->getFile() - : null; - } - - /** - * Returns language of the feature. - * - * @return string - */ - public function getLanguage() - { - return null !== $this->feature - ? $this->feature->getLanguage() - : null; - } - - /** - * Checks whether scenario has been frozen. - * - * @return Boolean - */ - public function isFrozen() - { - return null !== $this->feature - ? $this->feature->isFrozen() - : false; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php deleted file mode 100644 index c9577cd..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Background Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class BackgroundNode extends AbstractScenarioNode -{ -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExamplePyStringNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExamplePyStringNode.php deleted file mode 100644 index c845653..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExamplePyStringNode.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * PyString Argument for outline examples row Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class ExamplePyStringNode extends PyStringNode -{ - private $cleanLines = array(); - - /** - * Initializes PyString. - * - * @param PyStringNode $simpleString String from which this example string should be created - * @param array $tokens Replacement tokens values - */ - public function __construct(PyStringNode $simpleString, array $tokens) - { - $this->cleanLines = $lines = $simpleString->getLines(); - foreach ($tokens as $key => $value) { - foreach (array_keys($lines) as $line) { - $lines[$line] = str_replace('<'.$key.'>', $value, $lines[$line]); - } - } - - $this->setLines($lines); - } - - /** - * Returns not replaced with tokens string lines. - * - * @return array - */ - public function getCleanLines() - { - return $this->cleanLines; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleStepNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleStepNode.php deleted file mode 100644 index 8d4516a..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleStepNode.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Outline example step Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class ExampleStepNode extends StepNode -{ - private $cleanText; - - /** - * Initizalizes step. - * - * @param StepNode $simpleStep Initial step - * @param array $tokens Example table row tokens - */ - public function __construct(StepNode $simpleStep, array $tokens) - { - $text = $this->cleanText = $simpleStep->getText(); - foreach ($tokens as $key => $value) { - $text = str_replace('<' . $key . '>', $value, $text); - } - - parent::__construct( - $simpleStep->getType(), - $text, - $simpleStep->getLine() - ); - - foreach ($simpleStep->getArguments() as $argument) { - if ($argument instanceof TableNode || $argument instanceof PyStringNode) { - $this->addArgument($argument->createExampleRowStepArgument($tokens)); - } - } - - $this->setParent($simpleStep->getParent()); - } - - /** - * Returns untokenized step text. - * - * @return string - */ - public function getCleanText() - { - return $this->cleanText; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php deleted file mode 100644 index 40e1bc4..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Table Argument Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class ExampleTableNode extends TableNode -{ - private $cleanRows = array(); - - /** - * Initializes table. - * - * @param TableNode $cleanTable - * @param array $tokens - * - * @internal param string $table Initial table string - */ - public function __construct(TableNode $cleanTable, array $tokens) - { - $this->cleanRows = $rows = $cleanTable->getRows(); - - foreach ($tokens as $key => $value) { - foreach (array_keys($rows) as $row) { - foreach (array_keys($rows[$row]) as $col) { - $rows[$row][$col] = str_replace('<'.$key.'>', $value, $rows[$row][$col]); - } - } - } - - $this->setKeyword($cleanTable->getKeyword()); - $this->setRows($rows); - } - - /** - * Returns rows without tokens being replaced. - * - * @return array - */ - public function getCleanRows() - { - return $this->cleanRows(); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php deleted file mode 100644 index 54937e9..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php +++ /dev/null @@ -1,336 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Feature Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class FeatureNode extends AbstractNode -{ - private $title; - private $description; - private $file; - private $background; - private $language = 'en'; - private $scenarios = array(); - private $tags = array(); - private $frozen = false; - - /** - * Initializes feature. - * - * @param string $title Feature title - * @param string $description Feature description (3-liner) - * @param string $file Feature filename - * @param integer $line Definition line - */ - public function __construct($title = null, $description = null, $file = null, $line = 0) - { - parent::__construct($line); - - $this->title = $title; - $this->description = $description; - $this->file = $file; - } - - /** - * Sets feature title. - * - * @param string $title Feature title - * - * @throws \LogicException if feature is frozen - */ - public function setTitle($title) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature title.'); - } - - $this->title = $title; - } - - /** - * Returns feature title. - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Sets feature description (narrative). - * - * @param string $description Feature description - * - * @throws \LogicException if feature is frozen - */ - public function setDescription($description) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature description.'); - } - - $this->description = $description; - } - - /** - * Returns feature description (narrative). - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets language of the feature. - * - * @param string $language Langauge name - * - * @throws \LogicException if feature is frozen - */ - public function setLanguage($language) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature language.'); - } - - $this->language = $language; - } - - /** - * Returns language of the feature. - * - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * Sets feature background. - * - * @param BackgroundNode $background Background instance - * - * @throws \LogicException if feature is frozen - */ - public function setBackground(BackgroundNode $background) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature background.'); - } - - $background->setFeature($this); - $this->background = $background; - } - - /** - * Checks if feature has background. - * - * @return Boolean - */ - public function hasBackground() - { - return null !== $this->background; - } - - /** - * Returns feature background. - * - * @return BackgroundNode - */ - public function getBackground() - { - return $this->background; - } - - /** - * Adds scenario or outline to the feature. - * - * @param ScenarioNode $scenario Scenario instance - * - * @throws \LogicException if feature is frozen - */ - public function addScenario(ScenarioNode $scenario) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature scenarios.'); - } - - $scenario->setFeature($this); - $this->scenarios[] = $scenario; - } - - /** - * Sets scenarios & outlines to the feature. - * - * @param array $scenarios Array of ScenariosNode's or OutlineNode's - * - * @throws \LogicException if feature is frozen - */ - public function setScenarios(array $scenarios) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature scenarios.'); - } - - $this->scenarios = array(); - - foreach ($scenarios as $scenario) { - $this->addScenario($scenario); - } - } - - /** - * Checks that feature has scenarios. - * - * @return Boolean - */ - public function hasScenarios() - { - return count($this->scenarios) > 0; - } - - /** - * Returns feature scenarios & outlines. - * - * @return array - */ - public function getScenarios() - { - return $this->scenarios; - } - - /** - * Sets feature tags. - * - * @param array $tags Array of tags - * - * @throws \LogicException if feature is frozen - */ - public function setTags(array $tags) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature tags.'); - } - - $this->tags = $tags; - } - - /** - * Adds tag to the feature. - * - * @param string $tag Tag name - * - * @throws \LogicException if feature is frozen - */ - public function addTag($tag) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature tags.'); - } - - $this->tags[] = $tag; - } - - /** - * Checks if the feature has tags. - * - * @return Boolean - */ - public function hasTags() - { - return count($this->getTags()) > 0; - } - - /** - * Checks if the feature has tag. - * - * @param string $tag Tag name - * - * @return Boolean - */ - public function hasTag($tag) - { - return in_array($tag, $this->getTags()); - } - - /** - * Returns feature tags. - * - * @return array - */ - public function getTags() - { - return $this->tags; - } - - /** - * Returns only own tags (without inherited ones). - * - * @return array - */ - public function getOwnTags() - { - return $this->tags; - } - - /** - * Sets feature filename. - * - * @param string $path Sets feature file - * - * @throws \LogicException if feature is frozen - */ - public function setFile($path) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change frozen feature.'); - } - - $this->file = $path; - } - - /** - * Returns feature filename. - * - * @return string - */ - public function getFile() - { - return $this->file; - } - - /** - * Freeze feature to changes. - * Prevents feature modification in future - */ - public function freeze() - { - $this->frozen = true; - } - - /** - * Checks whether feature has been frozen. - * - * @return Boolean - */ - public function isFrozen() - { - return $this->frozen; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/NodeVisitorInterface.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/NodeVisitorInterface.php deleted file mode 100644 index dd717c9..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/NodeVisitorInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Node Visitor Interface. - * - * @author Konstantin Kudryashov - */ -interface NodeVisitorInterface -{ - /** - * Visits specific node. - * - * @param AbstractNode $visitee Visitee object - * - * @return mixed - */ - public function visit(AbstractNode $visitee); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php deleted file mode 100644 index 17348d0..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Scenario Outline Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class OutlineNode extends ScenarioNode -{ - private $examples; - - /** - * Sets outline examples table. - * - * @param TableNode $examples Examples table - * - * @throws \LogicException if feature is frozen - */ - public function setExamples(TableNode $examples) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change outline examples in frozen feature.'); - } - - $this->examples = $examples; - } - - /** - * Checks if outline has examples. - * - * @return Boolean - */ - public function hasExamples() - { - return null !== $this->examples; - } - - /** - * Returns examples table. - * - * @return TableNode - */ - public function getExamples() - { - return $this->examples; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/PyStringNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/PyStringNode.php deleted file mode 100644 index eec9550..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/PyStringNode.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * PyString Argument Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class PyStringNode implements StepArgumentNodeInterface -{ - private $lines = array(); - - /** - * Initializes PyString. - * - * @param string $string Initial string - */ - public function __construct($string = null) - { - if (null !== $string) { - $string = preg_replace("/\r\n|\r/", "\n", $string); - $this->lines = explode("\n", $string); - } - } - - /** - * Returns new PyString node with replaced outline example row tokens. - * - * @param array $tokens - * - * @return ExamplePyStringNode - */ - public function createExampleRowStepArgument(array $tokens) - { - return new ExamplePyStringNode($this, $tokens); - } - - /** - * Adds a line to the PyString. - * - * @param string $line Line of text - */ - public function addLine($line) - { - $this->lines[] = $line; - } - - /** - * Sets PyString lines. - * - * @param array $lines Array of text lines - */ - public function setLines(array $lines) - { - $this->lines = $lines; - } - - /** - * Returns PyString lines. - * - * @return array - */ - public function getLines() - { - return $this->lines; - } - - /** - * Returns raw string. - * - * @return string - */ - public function getRaw() - { - return implode("\n", $this->lines); - } - - /** - * Converts PyString into string. - * - * @return string - */ - public function __toString() - { - return $this->getRaw(); - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php deleted file mode 100644 index ba0eb8b..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Scenario Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class ScenarioNode extends AbstractScenarioNode -{ - private $tags = array(); - - /** - * Sets scenario tags. - * - * @param array $tags Array of tag names - * - * @throws \LogicException if feature is frozen - */ - public function setTags(array $tags) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change scenario tags in frozen feature.'); - } - - $this->tags = $tags; - } - - /** - * Adds tag to scenario. - * - * @param string $tag Tag name - * - * @throws \LogicException if feature is frozen - */ - public function addTag($tag) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change scenario tags in frozen feature.'); - } - - $this->tags[] = $tag; - } - - /** - * Checks if scenario has tags. - * - * @return Boolean - */ - public function hasTags() - { - return count($this->getTags()) > 0; - } - - /** - * Checks if scenario has tag. - * - * @param string $tag - * - * @return Boolean - */ - public function hasTag($tag) - { - return in_array($tag, $this->getTags()); - } - - /** - * Returns scenario tags. - * - * @return array - */ - public function getTags() - { - $tags = $this->tags; - - if ($feature = $this->getFeature()) { - $tags = array_merge($tags, $feature->getTags()); - } - - return $tags; - } - - /** - * Returns only own tags (without inherited ones). - * - * @return array - */ - public function getOwnTags() - { - return $this->tags; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepArgumentNodeInterface.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepArgumentNodeInterface.php deleted file mode 100644 index f0e5945..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepArgumentNodeInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Node Visitor Interface. - * - * @author Konstantin Kudryashov - */ -interface StepArgumentNodeInterface -{ - /** - * Returns new node with replaced outline example row tokens. - * - * @param array $tokens - * - * @return ExamplePyStringNode - */ - public function createExampleRowStepArgument(array $tokens); -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php deleted file mode 100644 index f8453dd..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php +++ /dev/null @@ -1,223 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Step Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class StepNode extends AbstractNode -{ - private $type; - private $text; - private $parent; - private $arguments = array(); - - /** - * Initizalizes step. - * - * @param string $type Step type - * @param string $text Step text - * @param integer $line Definition line - */ - public function __construct($type, $text = null, $line = 0) - { - parent::__construct($line); - - $this->type = $type; - $this->text = $text; - } - - /** - * Returns new example step, initialized with values from specific row. - * - * @return ExampleStepNode - * - * @throws \LogicException if feature is frozen - */ - public function createExampleRowStep(array $tokens) - { - if (!$this->isFrozen()) { - throw new \LogicException('Impossible to get example step from non-frozen one.'); - } - - return new ExampleStepNode($this, $tokens); - } - - /** - * Sets step type. - * - * @param string $type Step type (Given|When|Then|And etc) - * - * @throws \LogicException if feature is frozen - */ - public function setType($type) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change step type in frozen feature.'); - } - - $this->type = $type; - } - - /** - * Returns step type. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Sets step text. - * - * @param string $text Step text - * - * @throws \LogicException if feature is frozen - */ - public function setText($text) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change step text in frozen feature.'); - } - - $this->text = $text; - } - - /** - * Returns step text. - * - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Adds argument to step. - * - * @param StepArgumentNodeInterface $argument Step argument - * - * @throws \LogicException if feature is frozen - */ - public function addArgument(StepArgumentNodeInterface $argument) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change step arguments in frozen feature.'); - } - - $this->arguments[] = $argument; - } - - /** - * Sets step arguments. - * - * @param array $arguments Array of arguments - * - * @throws \LogicException if feature is frozen - */ - public function setArguments(array $arguments) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to change step arguments in frozen feature.'); - } - - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - - /** - * Checks if step has arguments. - * - * @return Boolean - */ - public function hasArguments() - { - return count($this->arguments) > 0; - } - - /** - * Returns step arguments. - * - * @return array - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Sets parent node of the step. - * - * @param AbstractScenarioNode $node Parent scenario - * - * @throws \LogicException if feature is frozen - */ - public function setParent(AbstractScenarioNode $node) - { - if ($this->isFrozen()) { - throw new \LogicException('Impossible to reassign step from frozen feature.'); - } - - $this->parent = $node; - } - - /** - * Returns parent node of the step. - * - * @return AbstractScenarioNode - */ - public function getParent() - { - return $this->parent; - } - - /** - * Returns definition file. - * - * @return string - */ - public function getFile() - { - return null !== $this->parent - ? $this->parent->getFile() - : null; - } - - /** - * Returns language of the feature. - * - * @return string - */ - public function getLanguage() - { - return null !== $this->parent - ? $this->parent->getLanguage() - : null; - } - - /** - * Checks whether step has been frozen. - * - * @return Boolean - */ - public function isFrozen() - { - return null !== $this->parent - ? $this->parent->isFrozen() - : false; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php b/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php deleted file mode 100644 index 3e50798..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php +++ /dev/null @@ -1,261 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Table Argument Gherkin AST node. - * - * @author Konstantin Kudryashov - */ -class TableNode implements StepArgumentNodeInterface -{ - private $rows = array(); - private $rowLines = array(); - private $keyword; - - /** - * Initializes table. - * - * @param string $table Initial table string - */ - public function __construct($table = null) - { - if (null !== $table) { - $table = preg_replace("/\r\n|\r/", "\n", $table); - - foreach (explode("\n", $table) as $row) { - $this->addRow($row); - } - } - } - - /** - * Returns new node with replaced outline example row tokens. - * - * @returns ExampleTableNode - */ - public function createExampleRowStepArgument(array $tokens) - { - return new ExampleTableNode($this, $tokens); - } - - /** - * Adds a row to the string. - * - * @param string|array $row Columns hash (column1 => value, column2 => value) or row string - * @param null|integer $line Row line number - */ - public function addRow($row, $line = null) - { - if (is_array($row)) { - $this->rows[] = $row; - } else { - $row = preg_replace("/^\s*\||\|\s*$/", '', $row); - - $this->rows[] = array_map(function($item) { - return preg_replace("/^\s*|\s*$/", '', $item); - }, explode('|', $row)); - } - - $this->rowLines[count($this->rows) - 1] = $line; - } - - /** - * Returns table rows. - * - * @return array - */ - public function getRows() - { - return $this->rows; - } - - /** - * Sets table rows. - * - * @param array $rows - */ - public function setRows(array $rows) - { - $this->rows = $rows; - $this->rowLines = array(); - } - - /** - * Returns specific row in a table. - * - * @param integer $rowNum Row number - * - * @return array - */ - public function getRow($rowNum) - { - return $this->rows[$rowNum]; - } - - /** - * Converts row into delimited string. - * - * @param integer $rowNum Row number - * - * @return string - */ - public function getRowAsString($rowNum) - { - $values = array(); - foreach ($this->getRow($rowNum) as $col => $value) { - $values[] = $this->padRight(' '.$value.' ', $this->getMaxLengthForColumn($col) + 2); - } - - return sprintf('|%s|', implode('|', $values)); - } - - /** - * Returns table hash, formed by columns (ColumnHash). - * - * @return array - */ - public function getHash() - { - $rows = $this->getRows(); - $keys = array_shift($rows); - - $hash = array(); - foreach ($rows as $row) { - $hash[] = array_combine($keys, $row); - } - - return $hash; - } - - /** - * Returns table hash, formed by rows (RowsHash). - * - * @return array - */ - public function getRowsHash() - { - $hash = array(); - - foreach ($this->getRows() as $row) { - $hash[$row[0]] = $row[1]; - } - - return $hash; - } - - /** - * Sets current node definition keyword. - * - * @param string $keyword Sets table keyword - */ - public function setKeyword($keyword) - { - $this->keyword = $keyword; - } - - /** - * Returns current node definition keyword. - * - * @return string - */ - public function getKeyword() - { - return $this->keyword; - } - - /** - * Returns numerated table lines. - * Line numbers are keys, lines are values. - * - * @return array - */ - public function getNumeratedRows() - { - return array_combine($this->rowLines, $this->rows); - } - - /** - * Returns line numbers for rows. - * - * @return array - */ - public function getRowLines() - { - return $this->rowLines; - } - - /** - * Returns table start line number. - * - * @return integer - */ - public function getLine() - { - return count($this->rowLines) ? $this->rowLines[0] : 0; - } - - /** - * Converts table into string - * - * @return string - */ - public function __toString() - { - $string = ''; - - for ($i = 0; $i < count($this->getRows()); $i++) { - if ('' !== $string) { - $string .= "\n"; - } - $string .= $this->getRowAsString($i); - } - - return $string; - } - - /** - * Returns max length of specific column. - * - * @param integer $columnNum Column number - * - * @return integer - */ - protected function getMaxLengthForColumn($columnNum) - { - $max = 0; - - foreach ($this->getRows() as $row) { - if (($tmp = mb_strlen($row[$columnNum])) > $max) { - $max = $tmp; - } - } - - return $max; - } - - /** - * Pads string right. - * - * @param string $text Text to pad - * @param integer $length Lenght - * - * @return string - */ - protected function padRight($text, $length) - { - while ($length > mb_strlen($text)) { - $text = $text . ' '; - } - - return $text; - } -} diff --git a/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php b/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php deleted file mode 100644 index 962304b..0000000 --- a/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php +++ /dev/null @@ -1,472 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Gherkin parser. - * - * $lexer = new Behat\Gherkin\Lexer($keywords); - * $parser = new Behat\Gherkin\Parser($lexer); - * $featuresArray = $parser->parse('/path/to/feature.feature'); - * - * @author Konstantin Kudryashov - */ -class Parser -{ - private $file; - private $lexer; - - /** - * Initializes parser. - * - * @param Lexer $lexer Lexer instance - */ - public function __construct(Lexer $lexer) - { - $this->lexer = $lexer; - } - - /** - * Parses input & returns features array. - * - * @param string $input Gherkin string document - * - * @return array - * - * @throws ParserException - */ - public function parse($input, $file = null) - { - $this->file = $file; - - try { - $this->lexer->setInput($input); - } catch (LexerException $e) { - throw new ParserException( - sprintf('Lexer exception "%s" throwed for file %s', $e->getMessage(), $file) - ); - } - - $this->lexer->setLanguage($language = 'en'); - $languageSpecifierLine = null; - - $feature = null; - while ('EOS' !== ($predicted = $this->predictTokenType())) { - if ('Newline' === $predicted || 'Comment' === $predicted) { - $this->lexer->getAdvancedToken(); - } elseif ('Language' === $predicted) { - $token = $this->expectTokenType('Language'); - $language = $token->value; - - if (null === $languageSpecifierLine) { - // Reparse input with new language - $languageSpecifierLine = $token->line; - $this->lexer->setInput($input); - $this->lexer->setLanguage($language); - } elseif ($languageSpecifierLine !== $token->line) { - // Language already specified - throw new ParserException(sprintf( - 'Ambigious language specifiers on lines: %d and %d%s', - $languageSpecifierLine, - $token->line, - $this->file ? ' in file: ' . $this->file : '' - )); - } - } elseif (null === $feature && - ('Feature' === $predicted || ( - 'Tag' === $predicted && 'Feature' === $this->predictTokenType(2)) - )) { - $feature = $this->parseExpression(); - $feature->setLanguage($language); - } else { - $this->expectTokenType(array('Comment', 'Scenario', 'Outline', 'Step')); - } - } - - return $feature; - } - - /** - * Returns next token if it's type equals to expected. - * - * @param string $types Token type - * - * @return stdClass - * - * @throws ParserException if token type is differ from expected one - */ - protected function expectTokenType($type) - { - $types = (array) $type; - if (in_array($this->predictTokenType(), $types)) { - return $this->lexer->getAdvancedToken(); - } - - throw new ParserException(sprintf('Expected %s token, but got %s on line: %d%s', - implode(' or ', $types), $this->predictTokenType(), $this->lexer->predictToken()->line, - $this->file ? ' in file: ' . $this->file : '' - )); - } - - /** - * Returns next token if it's type equals to expected. - * - * @param string $type Token type - * - * @return stdClass - */ - protected function acceptTokenType($type) - { - if ($type === $this->predictTokenType()) { - return $this->lexer->getAdvancedToken(); - } - } - - /** - * Returns next token type without real input reading (prediction). - * - * @param integer $number Number of tokens to predict - * - * @return string - */ - protected function predictTokenType($number = 1) - { - return $this->lexer->predictToken($number)->type; - } - - /** - * Parses current expression & returns Node. - * - * @return string|AbstractNode - */ - protected function parseExpression() - { - switch ($this->predictTokenType()) { - case 'Feature': - return $this->parseFeature(); - case 'Background': - return $this->parseBackground(); - case 'Scenario': - return $this->parseScenario(); - case 'Outline': - return $this->parseOutline(); - case 'TableRow': - return $this->parseTable(); - case 'PyStringOperator': - return $this->parsePyString(); - case 'Step': - return $this->parseStep(); - case 'Comment': - return $this->parseComment(); - case 'Text': - return $this->parseText(); - case 'Tag': - $token = $this->lexer->getAdvancedToken(); - $this->skipExtraChars(); - $this->lexer->deferToken($this->lexer->getAdvancedToken()); - $this->lexer->deferToken($token); - - return $this->parseExpression(); - } - } - - /** - * Parses feature token & returns it's node. - * - * @return FeatureNode - */ - protected function parseFeature() - { - $token = $this->expectTokenType('Feature'); - $node = new Node\FeatureNode(trim($token->value) ?: null, null, $this->file, $token->line); - - $node->setKeyword($token->keyword); - - // Parse tags - $this->parseNodeTags($node); - - // Parse description - $this->parseNodeDescription($node, $token->indent+2); - - // Parse background - if ('Background' === $this->predictTokenType()) { - $node->setBackground($this->parseExpression()); - } - - // Parse scenarios & outlines - while ('Scenario' === ($predicted = $this->predictTokenType()) - || ('Tag' === $predicted && 'Scenario' === ($predicted2 = $this->predictTokenType(2))) - || 'Outline' === $predicted - || ('Tag' === $predicted && 'Outline' === $predicted2)) { - $node->addScenario($this->parseExpression()); - } - - return $node; - } - - /** - * Parses background token & returns it's node. - * - * @return BackgroundNode - */ - protected function parseBackground() - { - $token = $this->expectTokenType('Background'); - $node = new Node\BackgroundNode(trim($token->value) ?: null, $token->line); - - $node->setKeyword($token->keyword); - $this->skipComments(); - - // Parse title - $this->parseNodeDescription($node, $token->indent+2); - - // Parse steps - while ('Step' === $this->predictTokenType()) { - $node->addStep($this->parseExpression()); - } - - return $node; - } - - /** - * Parses scenario outline token & returns it's node. - * - * @return OutlineNode - */ - protected function parseOutline() - { - $token = $this->expectTokenType('Outline'); - $node = new Node\OutlineNode(trim($token->value) ?: null, $token->line); - - $node->setKeyword($token->keyword); - - // Parse tags - $this->parseNodeTags($node); - - // Parse title - $this->parseNodeDescription($node, $token->indent+2); - - // Parse steps - while ('Step' === $this->predictTokenType()) { - $node->addStep($this->parseExpression()); - } - - // Examples block - $examplesToken = $this->expectTokenType('Examples'); - $this->skipExtraChars(); - - // Parse examples table - $table = $this->parseTable(); - $table->setKeyword($examplesToken->keyword); - $node->setExamples($table); - - return $node; - } - - /** - * Parses scenario token & returns it's node. - * - * @return ScenarioNode - */ - protected function parseScenario() - { - $token = $this->expectTokenType('Scenario'); - $node = new Node\ScenarioNode(trim($token->value) ?: null, $token->line); - - $node->setKeyword($token->keyword); - - // Parse tags - $this->parseNodeTags($node); - - // Parse title - $this->parseNodeDescription($node, $token->indent+2); - - // Parse scenario steps - while ('Step' === $this->predictTokenType()) { - $node->addStep($this->parseExpression()); - } - - return $node; - } - - /** - * Parses step token & returns it's node. - * - * @return StepNode - */ - protected function parseStep() - { - $token = $this->expectTokenType('Step'); - $node = new Node\StepNode($token->value, trim($token->text) ?: null, $token->line); - - $this->skipExtraChars(); - - // Parse PyString argument - if ('PyStringOperator' === $this->predictTokenType()) { - $node->addArgument($this->parseExpression()); - } - - // Parse Table argument - if ('TableRow' === $this->predictTokenType()) { - $node->addArgument($this->parseExpression()); - } - - return $node; - } - - /** - * Parses table token & returns it's node. - * - * @return TableNode - */ - protected function parseTable() - { - $token = $this->expectTokenType('TableRow'); - $node = new Node\TableNode(); - $node->addRow($token->columns, $token->line); - $this->skipExtraChars(); - - while ('TableRow' === $this->predictTokenType()) { - $token = $this->expectTokenType('TableRow'); - $node->addRow($token->columns, $token->line); - $this->skipExtraChars(); - } - - return $node; - } - - /** - * Parses PyString token & returns it's node. - * - * @return PyStringNode - */ - protected function parsePyString() - { - $token = $this->expectTokenType('PyStringOperator'); - $node = new Node\PyStringNode(); - - while ('PyStringOperator' !== ($predicted = $this->predictTokenType()) && 'Text' === $predicted) { - $node->addLine($this->parseText(false)); - } - - $this->expectTokenType('PyStringOperator'); - $this->skipExtraChars(); - - return $node; - } - - /** - * Parses next text token & returns it's string content. - * - * @param Boolean $skipExtraChars Do we need to skip newlines & spaces - * - * @return string - */ - protected function parseText($skipExtraChars = true) - { - $token = $this->expectTokenType('Text'); - - if ($skipExtraChars) { - $this->skipExtraChars(); - } - - return $token->value; - } - - /** - * Parses next comment token & returns it's string content. - * - * @return string - */ - protected function parseComment() - { - $token = $this->expectTokenType('Comment'); - - return $token->value; - } - - /** - * Parse tags for the feature/scenario/outline node. - * - * @param AbstractNode $node Node with tags - */ - private function parseNodeTags(Node\AbstractNode $node) - { - $this->skipComments(); - - while ('Tag' === $this->predictTokenType()) { - $node->setTags($this->lexer->getAdvancedToken()->tags); - $this->skipComments(); - } - } - - /** - * Parse description/title for feature/background/scenario/outline node. - * - * @param AbstractNode $node Node with description - * @param integer $indentation Indentation - */ - private function parseNodeDescription(Node\AbstractNode $node, $indentation) - { - $setter = 'setTitle'; - $getter = 'getTitle'; - if ($node instanceof Node\FeatureNode) { - $setter = 'setDescription'; - $getter = 'getDescription'; - } - - // Parse description/title - while (in_array($predicted = $this->predictTokenType(), array('Text', 'Newline'))) { - if ('Text' === $predicted) { - $text = $this->parseText(false); - $text = preg_replace('/^\s{0,'.$indentation.'}|\s*$/', '', $text); - } else { - $this->acceptTokenType('Newline'); - $text = ''; - } - - if ($node instanceof Node\FeatureNode && null === $node->$getter()) { - $node->$setter($text); - } else { - $node->$setter($node->$getter() . "\n" . $text); - } - - $this->skipComments(); - } - - // Trim title/description - if (null !== $node->$getter()) { - $node->$setter(rtrim($node->$getter()) ?: null); - } - } - - /** - * Skips newlines & comments in input. - * - * @param Boolean $skipNL Skip newline? - */ - private function skipExtraChars() - { - while ($this->acceptTokenType('Newline') || $this->acceptTokenType('Comment')); - } - - /** - * Skips newlines & comments in input. - */ - private function skipComments() - { - while ($this->acceptTokenType('Comment')); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/FileCacheTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/FileCacheTest.php deleted file mode 100644 index e71e366..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/FileCacheTest.php +++ /dev/null @@ -1,59 +0,0 @@ -cache = new FileCache($this->path = sys_get_temp_dir().'/gherkin-test'); - } - - protected function tearDown() - { - foreach (glob($this->path.'/*.feature.cache') as $file) { - unlink((string) $file); - } - } - - public function testIsFreshWhenThereIsNoFile() - { - $this->assertFalse($this->cache->isFresh('unexisting', time() + 100)); - } - - public function testIsFreshOnFreshFile() - { - $feature = new FeatureNode(); - - $this->cache->write('some_path', $feature); - - $this->assertFalse($this->cache->isFresh('some_path', time() + 100)); - } - - public function testIsFreshOnOutdated() - { - $feature = new FeatureNode(); - - $this->cache->write('some_path', $feature); - - $this->assertTrue($this->cache->isFresh('some_path', time() - 100)); - } - - public function testCacheAndRead() - { - $feature = new FeatureNode('Some feature', 'some description'); - $feature->addScenario(new ScenarioNode('Some scenario')); - - $this->cache->write('some_feature', $feature); - $featureRead = $this->cache->read('some_feature'); - - $this->assertEquals($feature, $featureRead); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Dumper/GherkinDumperTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Dumper/GherkinDumperTest.php deleted file mode 100644 index b6ea570..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Dumper/GherkinDumperTest.php +++ /dev/null @@ -1,287 +0,0 @@ -keywords = new ArrayKeywords( - array( - 'en' => array( - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline|Scenario Template', - 'examples' => 'Examples|Scenarios', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But' - ) - ) - ); - $this->keywords->setLanguage('en'); - } - - public function testDumpSimpleTextReturnsWellFormatedContent() - { - $dumper = new Dumper($this->keywords); - $this->assertEquals('abc', $dumper->dumpText('abc')); - } - - /** - * @dataProvider providerMultilinesText - */ - public function testDumpMultilinesTextReturnWellIndentedContent($given, $expected, $indent) - { - $dumper = new Dumper($this->keywords); - $this->assertEquals($expected, $dumper->dumpText($given, $indent)); - } - - public function testDumpCommentReturnsWellFormatedContent() - { - $dumper = new Dumper($this->keywords); - $this->assertEquals('# abc', $dumper->dumpComment('abc')); - } - - public function testDumpTagsReturnsWellFormatedContent() - { - $dumper = new Dumper($this->keywords); - $this->assertEquals('@tag1 @tag2', $dumper->dumpTags(array('tag1', 'tag2'))); - } - - public function testDumpTagsWithEmptyValueReturnsNothing() - { - $dumper = new Dumper($this->keywords); - $this->assertEmpty($dumper->dumpTags(array())); - } - - public function testDumpKeywordWithTextReturnsWellFormatedContent() - { - $dumper = new Dumper($this->keywords); - $this->assertEquals('key: value', $dumper->dumpKeyword('key', 'value')); - } - - /** - * @dataProvider providerTableNode - */ - public function testDumpTableNodeReturnsTableNodeInText(TableNode $tableNode, $expected) - { - $dumper = new Dumper($this->keywords); - $this->assertEquals($expected, $dumper->dumpTableNode($tableNode)); - } - - /** - * @dataProvider providerStep - */ - public function testDumpStepReturnsValidContentWhenSimpleStepIsGiven(StepNode $step, $expected) - { - $dumper = new Dumper($this->keywords); - $this->assertEquals($expected, $dumper->dumpStep($step)); - } - - /** - * @expectedException \Behat\Gherkin\Exception\Exception - */ - public function testDumpStepThrowsExceptionWhenInvalidStepIsGiven() - { - $dumper = new Dumper($this->keywords); - $step = new StepNode('NothingAndDoesNotExist', 'some text'); - $dumper->dumpStep($step); - } - - /** - * @dataProvider providerStepOutline - */ - public function testDumpStepReturnsValidContentWhenOutlineStepIsGiven(StepNode $step, $expected) - { - $dumper = new Dumper($this->keywords); - $this->assertEquals($expected, $dumper->dumpStep($step)); - } - - public function testDumpBackgroundReturnsWellFormatedContent() - { - $dumper = new Dumper($this->keywords); - $background = new BackgroundNode('my title'); - $background->addStep(new StepNode('Given', 'I use behat')); - - $expected = 'Background: my title - Given I use behat'; - - $this->assertEquals($expected, $dumper->dumpBackground($background)); - } - - public function testDumpSimpleScenarioReturnsWellFormatedContent() - { - $dumper = new Dumper($this->keywords); - $scenario = new ScenarioNode('my scenario'); - $scenario->addStep(new StepNode('Given', 'my example1')); - $scenario->addStep(new StepNode('When', 'I do anything')); - - $expected = ' - Scenario: my scenario - Given my example1 - When I do anything'; - $this->assertEquals($expected, $dumper->dumpScenario($scenario)); - } - - public function testDumpScenarioWithTagsAddTagsToTheContent() - { - $dumper = new Dumper($this->keywords); - $scenario = new ScenarioNode('my scenario'); - $scenario->addStep(new StepNode('Given', 'my example1')); - $scenario->addTag('tag1'); - $scenario->addTag('tag2'); - - $expected = ' - @tag1 @tag2 - Scenario: my scenario - Given my example1'; - $this->assertEquals($expected, $dumper->dumpScenario($scenario)); - } - - public function testDumpOutlineScenarioReturnsContentAndTableNode() - { - $dumper = new Dumper($this->keywords); - $scenario = new OutlineNode('my scenario'); - $scenario->addStep(new StepNode('Given', 'my example1')); - - // complete table - $examples = new TableNode(); - $examples->addRow(array('lib1', 'lib2', 'lib3')); - $examples->addRow(array(1, 2, 3)); - $examples->addRow(array(4, 5, 6)); - $scenario->setExamples($examples); - - $expected = ' - Scenario Outline: my scenario - Given my example1 - - Examples: - | lib1 | lib2 | lib3 | - | 1 | 2 | 3 | - | 4 | 5 | 6 |'; - - $this->assertEquals($expected, $dumper->dumpScenario($scenario)); - } - - /** - * @dataProvider providerFeatureInText - */ - public function testDumpFeature($initialContent) - { - $lexer = new \Behat\Gherkin\Lexer($this->keywords); - $parser = new \Behat\Gherkin\Parser($lexer); - $feature = $parser->parse($initialContent); - - $dumper = new Dumper($this->keywords); - $this->assertEquals($initialContent, $dumper->dumpFeature($feature)); - } - - public function providerStep() - { - return array( - array(new StepNode('Given', 'my example1'), 'Given my example1') - , array(new StepNode('When', 'I do anything'), 'When I do anything') - , array(new StepNode('And', 'I do anything yet'), 'And I do anything yet') - , array(new StepNode('Then', 'The result is expected'), 'Then The result is expected') - ); - } - - public function providerStepOutline() - { - return array( - array(new StepNode( - 'Given', 'there are days: - | day | number | - | monday | 1 | - | tuesday| 2 |') - , 'Given there are days: - | day | number | - | monday | 1 | - | tuesday| 2 |') - ); - } - - public function providerTableNode() - { - // complete table - $node1 = new TableNode(); - $node1->addRow(array('lib1', 'lib2', 'lib3')); - $node1->addRow(array(1, 2, 3)); - $node1->addRow(array(4, 5, 6)); - $expected1 = ' -| lib1 | lib2 | lib3 | -| 1 | 2 | 3 | -| 4 | 5 | 6 |'; - - // empty table - $node2 = new TableNode(); - $expected2 = ''; - - return array( - array($node1, $expected1) - , array($node2, $expected2) - ); - } - - public function providerMultilinesText() - { - return array( - array( - "some text\nand the text on the new line with indent" - , ' some text - and the text on the new line with indent' - , 1 - ) - , array( - "test1\n test2" - , ' test1 - test2' - , 16 - ) - ); - } - - public function providerFeatureInText() - { - return array( - array( - '# language: en -Feature: Addition - In order to avoid silly mistakes - As a math idiot - I want to be told the sum of two numbers - - Scenario: Add two numbers - Given I have entered 11 into the calculator - And I have entered 12 into the calculator - When I press add - Then the result should be 23 on the screen - - Scenario: Div two numbers - Given I have entered 10 into the calculator - And I have entered 2 into the calculator - When I press div - Then the result should be 5 on the screen' - ) - ); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/FilterTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/FilterTest.php deleted file mode 100644 index 9992f19..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/FilterTest.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline|Scenario Template', - 'examples' => 'Examples|Scenarios', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But' - ) - )) - ) - ); - } - - protected function getGherkinFeature() - { - return << occurs - Then should be visible - - Examples: - | action | outcome | - | act#1 | out#1 | - | act#2 | out#2 | - | act#3 | out#3 | -GHERKIN; - } - - protected function getParsedFeature() - { - return $this->getParser()->parse($this->getGherkinFeature()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineFilterTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineFilterTest.php deleted file mode 100644 index 8b97fe3..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineFilterTest.php +++ /dev/null @@ -1,100 +0,0 @@ -assertTrue($filter->isFeatureMatch($feature)); - - $filter = new LineFilter(2); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $filter = new LineFilter(3); - $this->assertTrue($filter->isFeatureMatch($feature)); - } - - public function testIsScenarioMatchFilter() - { - $scenario = new Node\ScenarioNode(null, 2); - - $filter = new LineFilter(2); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new LineFilter(1); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $filter = new LineFilter(5); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $outline = new Node\OutlineNode(null, 20); - - $filter = new LineFilter(5); - $this->assertFalse($filter->isScenarioMatch($outline)); - - $filter = new LineFilter(20); - $this->assertTrue($filter->isScenarioMatch($outline)); - } - - public function testFilterFeatureScenario() - { - $filter = new LineFilter(2); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#1', $scenarios[0]->getTitle()); - - $filter = new LineFilter(7); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#2', $scenarios[0]->getTitle()); - - $filter = new LineFilter(5); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(0, $scenarios = $feature->getScenarios()); - } - - public function testFilterFeatureOutline() - { - $filter = new LineFilter(13); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#3', $scenarios[0]->getTitle()); - $this->assertCount(4, $scenarios[0]->getExamples()->getRows()); - - $filter = new LineFilter(19); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#3', $scenarios[0]->getTitle()); - $this->assertCount(2, $scenarios[0]->getExamples()->getRows()); - $this->assertSame(array( - array('action', 'outcome'), - array('act#1', 'out#1'), - ), $scenarios[0]->getExamples()->getRows()); - - $filter = new LineFilter(21); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#3', $scenarios[0]->getTitle()); - $this->assertCount(2, $scenarios[0]->getExamples()->getRows()); - $this->assertSame(array( - array('action', 'outcome'), - array('act#3', 'out#3'), - ), $scenarios[0]->getExamples()->getRows()); - - $filter = new LineFilter(18); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#3', $scenarios[0]->getTitle()); - $this->assertCount(1, $scenarios[0]->getExamples()->getRows()); - $this->assertSame(array( - array('action', 'outcome'), - ), $scenarios[0]->getExamples()->getRows()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php deleted file mode 100644 index 25398e9..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php +++ /dev/null @@ -1,96 +0,0 @@ -assertTrue($filter->isFeatureMatch($feature)); - } - - public function scenarioLineRangeProvider() - { - return array( - array('1', '2', 1), - array('1', '*', 2), - array('2', '2', 1), - array('2', '*', 2), - array('3', '3', 1), - array('3', '*', 1), - array('1', '1', 0), - array('4', '4', 0), - array('4', '*', 0) - ); - } - - /** - * @dataProvider scenarioLineRangeProvider - */ - public function testIsScenarioMatchFilter($filterMinLine, $filterMaxLine, $expectedNumberOfMatches) - { - $scenario = new Node\ScenarioNode(null, 2); - $outline = new Node\OutlineNode(null, 3); - - $filter = new LineRangeFilter($filterMinLine, $filterMaxLine); - $this->assertEquals($expectedNumberOfMatches, intval($filter->isScenarioMatch($scenario)) - + intval($filter->isScenarioMatch($outline))); - } - - public function testFilterFeatureScenario() - { - $filter = new LineRangeFilter(1, 3); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#1', $scenarios[0]->getTitle()); - - $filter = new LineRangeFilter(5, 9); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#2', $scenarios[0]->getTitle()); - - $filter = new LineRangeFilter(5, 6); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(0, $scenarios = $feature->getScenarios()); - } - - public function testFilterFeatureOutline() - { - $filter = new LineRangeFilter(12, 14); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#3', $scenarios[0]->getTitle()); - $this->assertCount(1, $scenarios[0]->getExamples()->getRows()); - - $filter = new LineRangeFilter(15, 20); - $filter->filterFeature($feature = $this->getParsedFeature()); - $this->assertCount(1, $scenarios = $feature->getScenarios()); - $this->assertSame('Scenario#3', $scenarios[0]->getTitle()); - $this->assertCount(3, $scenarios[0]->getExamples()->getRows()); - $this->assertSame(array( - array('action', 'outcome'), - array('act#1', 'out#1'), - array('act#2', 'out#2'), - ), $scenarios[0]->getExamples()->getRows()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NameFilterTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NameFilterTest.php deleted file mode 100644 index 53daaf7..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NameFilterTest.php +++ /dev/null @@ -1,90 +0,0 @@ -setTitle('random feature title'); - - $filter = new NameFilter('feature1'); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $feature->setTitle('feature1'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->setTitle('feature1 title'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->setTitle('some feature1 title'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->setTitle('some feature title'); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $filter = new NameFilter('/fea.ure/'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->setTitle('some feaSure title'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->setTitle('some feture title'); - $this->assertFalse($filter->isFeatureMatch($feature)); - } - - public function testIsScenarioMatchFilter() - { - $feature = new Node\FeatureNode(); - $scenario = new Node\ScenarioNode(); - $feature->addScenario($scenario); - - $feature->setTitle('random feature title'); - $scenario->setTitle('UNKNOWN'); - - $filter = new NameFilter('feature1'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->setTitle('feature1'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTitle('feature1 title'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTitle('some feature1 title'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTitle('some feature title'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $filter = new NameFilter('/fea.ure/'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTitle('some feaSure title'); - $scenario->setTitle('some feature title'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTitle('some feture title'); - $scenario->setTitle('unk'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->setTitle('unknown'); - $scenario->setTitle('simple scenario title'); - $filter = new NameFilter('scenario'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $scenario->setTitle('simple feature title'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $scenario->setTitle('simple scenerio title'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $filter = new NameFilter('/scen.rio/'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/TagFilterTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/TagFilterTest.php deleted file mode 100644 index dd9c136..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/TagFilterTest.php +++ /dev/null @@ -1,154 +0,0 @@ -assertFalse($filter->isFeatureMatch($feature)); - - $feature->addTag('wip'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $filter = new TagFilter('~@done'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->addTag('done'); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $feature->setTags(array('tag1', 'tag2', 'tag3')); - $filter = new TagFilter('@tag5,@tag4,@tag6'); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $feature->addTag('tag5'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $filter = new TagFilter('@wip&&@vip'); - $feature->setTags(array('wip', 'not-done')); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $feature->addTag('vip'); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $filter = new TagFilter('@wip,@vip&&@user'); - $feature->setTags(array('wip')); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $feature->setTags(array('vip')); - $this->assertFalse($filter->isFeatureMatch($feature)); - - $feature->setTags(array('wip', 'user')); - $this->assertTrue($filter->isFeatureMatch($feature)); - - $feature->setTags(array('vip', 'user')); - $this->assertTrue($filter->isFeatureMatch($feature)); - } - - public function testIsScenarioMatchFilter() - { - $feature = new Node\FeatureNode(); - $scenario = new Node\ScenarioNode(); - $feature->addScenario($scenario); - - $filter = new TagFilter('@wip'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->addTag('wip'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('~@done'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->addTag('done'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->setTags(array('tag1', 'tag2', 'tag3')); - $filter = new TagFilter('@tag5,@tag4,@tag6'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->addTag('tag5'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('@wip&&@vip'); - $feature->setTags(array('wip', 'not-done')); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->addTag('vip'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('@wip,@vip&&@user'); - $feature->setTags(array('wip')); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->setTags(array('vip')); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->setTags(array('wip', 'user')); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTags(array('vip', 'user')); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTags(array()); - - $filter = new TagFilter('@wip'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->addTag('wip'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('~@done'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->addTag('done'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $scenario->setTags(array('tag1', 'tag2', 'tag3')); - $filter = new TagFilter('@tag5,@tag4,@tag6'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->addTag('tag5'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('@wip&&@vip'); - $scenario->setTags(array('wip', 'not-done')); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $feature->addTag('vip'); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('@wip,@vip&&@user'); - $scenario->setTags(array('wip')); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $scenario->setTags(array('vip')); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $scenario->setTags(array('wip', 'user')); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $scenario->setTags(array('vip', 'user')); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTags(array('wip')); - $scenario->setTags(array('user')); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $feature->setTags(array()); - $this->assertFalse($filter->isScenarioMatch($scenario)); - - $filter = new TagFilter('@wip,@vip&&~@group'); - $feature->setTags(array('vip')); - $this->assertTrue($filter->isScenarioMatch($scenario)); - - $scenario->addTag('group'); - $this->assertFalse($filter->isScenarioMatch($scenario)); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/directories/phps/some_file.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/directories/phps/some_file.php deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/addition.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/addition.yml deleted file mode 100644 index 25575c5..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/addition.yml +++ /dev/null @@ -1,29 +0,0 @@ -feature: - title: Addition - language: en - line: 2 - description: |- - In order to avoid silly mistakes - As a math idiot - I want to be told the sum of two numbers - - scenarios: - - - type: scenario - title: Add two numbers - line: 7 - steps: - - { type: 'Given', text: 'I have entered 11 into the calculator', line: 8 } - - { type: 'And', text: 'I have entered 12 into the calculator', line: 9 } - - { type: 'When', text: 'I press add', line: 10 } - - { type: 'Then', text: 'the result should be 23 on the screen', line: 11 } - - - - type: scenario - title: Div two numbers - line: 13 - steps: - - { type: 'Given', text: 'I have entered 10 into the calculator', line: 14 } - - { type: 'And', text: 'I have entered 2 into the calculator', line: 15 } - - { type: 'When', text: 'I press div', line: 16 } - - { type: 'Then', text: 'the result should be 5 on the screen', line: 17 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background.yml deleted file mode 100644 index 7ab0a08..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background.yml +++ /dev/null @@ -1,18 +0,0 @@ -feature: - title: Feature with background - language: en - line: 1 - description: ~ - - background: - line: 3 - steps: - - { type: Given, text: a passing step, line: 4 } - - scenarios: - - - type: scenario - title: ~ - line: 6 - steps: - - { type: Given, text: a failing step, line: 7 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background_title.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background_title.yml deleted file mode 100644 index 479f899..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background_title.yml +++ /dev/null @@ -1,26 +0,0 @@ -feature: - title: Feature with titled background - language: en - line: 1 - description: ~ - - background: - line: 3 - title: |- - Some Background - title with - couple - of - | continuous | - """ - strings - steps: - - { type: Given, text: a passing step, line: 10 } - - scenarios: - - - type: scenario - title: ~ - line: 12 - steps: - - { type: Given, text: a failing step, line: 13 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/big_pystring.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/big_pystring.yml deleted file mode 100644 index 3d4dc6e..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/big_pystring.yml +++ /dev/null @@ -1,17 +0,0 @@ -feature: - line: 1 - title: Big PyString - - scenarios: - - - type: scenario - line: 2 - steps: - - - type: Then - text: it should fail with: - line: 3 - arguments: - - - type: pystring - text: "\n# language: ru\n\nUUUUUU\n\n2 scenarios (2 undefined)\n6 steps (6 undefined)\n\nYou can implement step definitions for undefined steps with these snippets:\n\n$steps->Given('/^I have entered (\d+)$/', function($world, $arg1) {\n throw new \Everzet\Behat\Exception\\Pending();\n});\n\n$steps->Then('/^I must have (\d+)$/', function($world, $arg1) {\n throw new \Everzet\Behat\Exception\\Pending();\n});\n\n$steps->Then('/^String must be \'([^\']*)\'$/', function($world, $arg1) {\n throw new \Everzet\Behat\Exception\\Pending();\n});" diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/clean_tags.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/clean_tags.yml deleted file mode 100644 index 30484e7..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/clean_tags.yml +++ /dev/null @@ -1,20 +0,0 @@ -feature: - title: Feature N4 - line: 1 - description: ~ - - scenarios: - - - type: scenario - tags: [normal] - line: 4 - steps: - - { type: 'Given', text: 'Some normal step N41', line: 5 } - - { type: 'And', text: 'Some fast step N42', line: 6 } - - - - type: scenario - tags: [fast] - line: 9 - steps: - - { type: 'Given', text: 'Some slow step N43', line: 10 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/commented_out.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/commented_out.yml deleted file mode 100644 index 174134f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/commented_out.yml +++ /dev/null @@ -1,11 +0,0 @@ -feature: - title: Fibonacci - language: en - line: 1 - description: |- - In order to calculate super fast fibonacci series - As a pythonista - I want to use Python for that - - scenarios: ~ - diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/comments.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/comments.yml deleted file mode 100644 index 25a5cc6..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/comments.yml +++ /dev/null @@ -1,21 +0,0 @@ -feature: - title: Using the Console Formatter - language: en - line: 3 - description: |- - In order to verify this error # comment - - - - I want to run this feature using the progress format#comment - So that it can be fixed - - scenarios: - - - type: scenario - title: "A normal feature #comment in scenario title" - line: 19 - steps: - - { type: 'Given', text: 'I have a pending step #comment', line: 21 } - - { type: 'When', text: 'I run this feature with the progress format #comment', line: 24 } - - { type: 'Then', text: "I should get a no method error for 'backtrace_line'", line: 31 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/complex_descriptions.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/complex_descriptions.yml deleted file mode 100644 index 8d9f83a..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/complex_descriptions.yml +++ /dev/null @@ -1,26 +0,0 @@ -feature: - title: Complex descriptions - language: en - line: 7 - description: |- - Some description with - | table | row| - - and - - """ - """ - - scenarios: - - - type: scenario - title: |- - Some - | complex | description | - - """ - hell yeah - """ - line: 16 - steps: - - { type: 'Given', text: 'one two three', line: 22 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario.yml deleted file mode 100644 index 43e7201..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario.yml +++ /dev/null @@ -1,13 +0,0 @@ -feature: - title: Cucumber command line - language: en - line: 1 - description: |- - In order to write better software - Developers should be able to execute requirements as tests - - scenarios: - - - type: scenario - title: Pending Scenario at the end of a file with whitespace after it - line: 6 diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/fibonacci.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/fibonacci.yml deleted file mode 100644 index 7f277cd..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/fibonacci.yml +++ /dev/null @@ -1,27 +0,0 @@ -feature: - title: Fibonacci - language: en - line: 1 - description: |- - In order to calculate super fast fibonacci series - As a pythonista - I want to use Python for that - - scenarios: - - - type: outline - title: Series - line: 6 - steps: - - { type: 'When', text: 'I ask python to calculate fibonacci up to ', line: 7 } - - { type: 'Then', text: 'it should give me ', line: 8 } - - examples: - 11: [ n , series ] - 12: [ 1 , '[]' ] - 13: [ 2 , '[1, 1]' ] - 14: [ 3 , '[1, 1, 2]' ] - 15: [ 4 , '[1, 1, 2, 3]' ] - 16: [ 6 , '[1, 1, 2, 3, 5]' ] - 17: [ 9 , '[1, 1, 2, 3, 5, 8]' ] - 18: [ 100 , '[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]' ] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/hashes_in_quotes.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/hashes_in_quotes.yml deleted file mode 100644 index 4419209..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/hashes_in_quotes.yml +++ /dev/null @@ -1,29 +0,0 @@ -feature: - title: "Some '#quoted' string" - language: en - line: 2 - description: |- - In order to avoid silly mistakes - As a "#math" idiot - I want to be told the sum of two numbers - - scenarios: - - - type: scenario - title: Add two numbers - line: 7 - steps: - - { type: 'Given', text: 'I have entered 11 into the calculator', line: 8 } - - { type: 'And', text: 'I have entered 12 into the calculator', line: 9 } - - { type: 'When', text: 'I press "#add"', line: 10 } - - { type: 'Then', text: 'the result should be 23 on the screen', line: 11 } - - - - type: scenario - title: 'Div "#two" numbers # as' - line: 13 - steps: - - { type: 'Given', text: 'I have entered 10 into the calculator', line: 14 } - - { type: 'And', text: 'I have entered # 2 into the calculator', line: 15 } - - { type: 'When', text: 'I press div', line: 16 } - - { type: 'Then', text: 'the result should be 5 on the screen', line: 17 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/issue_13.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/issue_13.yml deleted file mode 100644 index 902edd8..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/issue_13.yml +++ /dev/null @@ -1,47 +0,0 @@ -feature: - title: test pystring - description: second line - language: en - line: 1 - - scenarios: - - - type: scenario - title: |- - testing py string in scenario - second line - line: 4 - steps: - - - type: Given - text: the pystring is - line: 7 - arguments: - - - type: pystring - text: |- - Test store name - Denmark, Kolding - 6000 - - - - type: outline - title: |- - testing py string in scenario outline - second line - line: 14 - steps: - - - type: Given - text: the pystring is - line: 17 - arguments: - arguments: - - - type: pystring - text: |- - Test store name - Denmark, Kolding - 6000 - examples: - 24: [''] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ja_addition.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ja_addition.yml deleted file mode 100644 index 0c48d79..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ja_addition.yml +++ /dev/null @@ -1,21 +0,0 @@ -feature: - title: '加算' - keyword: 'フィーチャ' - language: ja - line: 2 - description: |- - バカな間違いを避けるために - 数学オンチとして - 2つの数の合計を知りたい - - scenarios: - - - type: scenario - keyword: 'シナリオ' - title: '2つの数の加算について' - line: 7 - steps: - - { type: '前提', text: '50 を入力', line: 8 } - - { type: 'かつ', text: '70 を入力', line: 9 } - - { type: 'もし', text: 'add ボタンを押した', line: 10 } - - { type: 'ならば', text: '結果は 120 を表示', line: 11 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/long_title_feature.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/long_title_feature.yml deleted file mode 100644 index dac23f5..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/long_title_feature.yml +++ /dev/null @@ -1,13 +0,0 @@ -feature: - title: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match - language: en - line: 1 - description: ~ - - scenarios: - - - type: scenario - title: See "No Record(s) Found" for Zero Existing - line: 3 - steps: - - { type: Given, text: no public holiday exists in the system, line: 4 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name.yml deleted file mode 100644 index 81c606b..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name.yml +++ /dev/null @@ -1,44 +0,0 @@ -feature: - title: multiline - language: en - line: 1 - description: ~ - - background: - line: 3 - steps: - - { type: Given, text: passing without a table, line: 4 } - - scenarios: - - - type: scenario - title: |- - I'm a multiline name - which goes on and on and on for three lines - yawn - line: 6 - steps: - - { type: Given, text: passing without a table, line: 9 } - - - - type: outline - title: |- - I'm a multiline name - which goes on and on and on for three lines - yawn - line: 11 - steps: - - { type: 'Given', text: ' without a table', line: 14 } - examples: - 16: [state] - 17: [passing] - - - - type: outline - title: name - line: 19 - steps: - - { type: 'Given', text: ' without a table', line: 20 } - examples: - 22: [state] - 23: [passing] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name_with_newlines.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name_with_newlines.yml deleted file mode 100644 index dd858c7..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name_with_newlines.yml +++ /dev/null @@ -1,65 +0,0 @@ -feature: - title: multiline - language: en - line: 1 - description: |- - - Feature description - - With etc. - - background: - line: 8 - steps: - - { type: Given, text: passing without a table, line: 11 } - - scenarios: - - - type: scenario - title: |- - - I'm a multiline name - which goes on and on and on for three lines - yawn - line: 13 - steps: - - { type: Given, text: passing without a table, line: 19 } - - - - type: outline - title: |- - I'm a multiline name - - which goes on and on and on for three lines - - yawn - line: 21 - steps: - - { type: 'Given', text: ' without a table', line: 28 } - examples: - 34: [state] - 35: [passing] - - - - type: outline - title: name - line: 37 - steps: - - { type: 'Given', text: ' without a table', line: 40 } - examples: - 45: [state] - 46: [passing] - - - type: outline - title: |- - - - I'm a multiline name - which goes on and on and on for three lines - yawn - line: 48 - steps: - - { type: 'Given', text: ' without a table', line: 55 } - examples: - 60: [state] - 61: [passing] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiplepystrings.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiplepystrings.yml deleted file mode 100644 index 0180aea..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiplepystrings.yml +++ /dev/null @@ -1,45 +0,0 @@ -feature: - title: A multiple py string feature - line: 1 - language: en - description: ~ - - scenarios: - - - type: scenario - title: ~ - line: 3 - steps: - - - type: When - text: I enter a string - line: 4 - arguments: - - - type: pystring - text: |- - - - a string - with something - be - a - u - ti - ful - - - - type: Then - text: String must be - line: 15 - arguments: - - - type: pystring - text: |- - - - a string - with something - be - a - u - ti - ful diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_spaces.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_spaces.yml deleted file mode 100644 index beaaabe..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_spaces.yml +++ /dev/null @@ -1,33 +0,0 @@ -feature: - title: Login - language: en - line: 1 - description: |- - To ensure the safety of the application - A regular user of the system - Must authenticate before using the app - - scenarios: - - - type: outline - title: Failed Login - line: 7 - steps: - - { type: 'Given', text: 'the user "known_user"', line: 8 } - - { type: 'When', text: 'I go to the main page', line: 10 } - - { type: 'Then', text: 'I should see the login form', line: 11 } - - { type: 'When', text: 'I fill in "login" with ""', line: 13 } - - { type: 'And', text: 'I fill in "password" with ""', line: 14 } - - { type: 'And', text: 'I press "Log In"', line: 15 } - - { type: 'Then', text: 'the login request should fail', line: 16 } - - { type: 'And', text: 'I should see the error message "Login or Password incorrect"', line: 17 } - examples: - 20: [login, password] - 21: ['', ''] - 22: [unknown_user, ''] - 23: [known_user, ''] - 24: ['', wrong_password] - 25: ['', known_userpass] - 26: [unknown_user, wrong_password] - 27: [unknown_user, known_userpass] - 28: [known_user, wrong_password] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_step_table.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_step_table.yml deleted file mode 100644 index aaf6cb6..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_step_table.yml +++ /dev/null @@ -1,28 +0,0 @@ -feature: - title: Unsubstituted argument placeholder - language: en - line: 1 - description: ~ - - scenarios: - - - type: outline - title: 'See Annual Leave Details (as Management & Human Resource)' - line: 3 - steps: - - - type: Given - text: the following users exist in the system - line: 4 - arguments: - - - type: table - rows: - 5: [ name, email, role_assignments, group_memberships ] - 6: [ Jane, jane@fmail.com, , Sales (manager) ] - 7: [ Max, max@fmail.com, '', Sales (member) ] - 8: [ Carol, carol@fmail.com, '', Sales (member) ] - 9: [ Cat, cat@fmail.com, '', '' ] - examples: - 12: [ role ] - 13: [ HUMAN RESOURCE ] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/pystring.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/pystring.yml deleted file mode 100644 index 8af699b..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/pystring.yml +++ /dev/null @@ -1,21 +0,0 @@ -feature: - title: A py string feature - language: en - line: 1 - description: ~ - - scenarios: - - - type: scenario - title: ~ - line: 3 - steps: - - - type: Then - text: I should see - line: 4 - arguments: - - - type: pystring - swallow: 6 - text: "a string with #something" diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_addition.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_addition.yml deleted file mode 100644 index 5f5d0b9..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_addition.yml +++ /dev/null @@ -1,21 +0,0 @@ -feature: - title: Сложение чисел - keyword: Функционал - language: ru - line: 2 - description: |- - Чтобы не складывать в уме - Все, у кого с этим туго - Хотят автоматическое сложение целых чисел - - scenarios: - - - type: scenario - keyword: Сценарий - title: Сложение двух целых чисел - line: 7 - steps: - - { type: 'Допустим', text: 'я ввожу число 50', line: 8 } - - { type: 'И', text: 'затем ввожу число 70', line: 9 } - - { type: 'Если', text: 'я нажимаю "+"', line: 10 } - - { type: 'То', text: 'результатом должно быть число 120', line: 11 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_commented.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_commented.yml deleted file mode 100644 index 1097d5d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_commented.yml +++ /dev/null @@ -1,11 +0,0 @@ -feature: - title: Тест комментов - keyword: Функционал - language: ru - line: 7 - description: |- - i18n должен правильно считываться - Даже если в начале файла 1000 - комментов! - - scenarios: ~ diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_consecutive_calculations.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_consecutive_calculations.yml deleted file mode 100644 index 17f6b08..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_consecutive_calculations.yml +++ /dev/null @@ -1,34 +0,0 @@ -feature: - title: Последовательные вычисления - keyword: Функционал - language: ru - line: 2 - description: |- - Чтобы вычислять сложные выражения - Пользователи хотят проводить вычисления над результатом предыдущей операций - - background: - keyword: Предыстория - line: 6 - steps: - - { type: Допустим, text: я сложил 3 и 5, line: 7 } - - scenarios: - - - type: scenario - keyword: Сценарий - title: сложение с результатом последней операций - line: 9 - steps: - - { type: Если, text: 'я ввожу число 4', line: 10 } - - { type: И, text: 'нажимаю "+"', line: 11 } - - { type: То, text: 'результатом должно быть число 12', line: 12 } - - - type: scenario - keyword: Сценарий - title: деление результата последней операции - line: 14 - steps: - - { type: Если, text: 'я ввожу число 2', line: 15 } - - { type: И, text: 'нажимаю "/"', line: 16 } - - { type: То, text: 'результатом должно быть число 4', line: 17 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_division.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_division.yml deleted file mode 100644 index 0fbb90d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_division.yml +++ /dev/null @@ -1,27 +0,0 @@ -feature: - title: Деление чисел - keyword: Функционал - language: ru - line: 2 - description: |- - Поскольку деление сложный процесс и люди часто допускают ошибки - Нужно дать им возможность делить на калькуляторе - - scenarios: - - - type: outline - keyword: Структура сценария - title: Целочисленное деление - line: 6 - steps: - - { type: 'Допустим', text: 'я ввожу число <делимое>', line: 7 } - - { type: 'И', text: 'затем ввожу число <делитель>', line: 8 } - - { type: 'Если', text: 'я нажимаю "/"', line: 9 } - - { type: 'То', text: 'результатом должно быть число <частное>', line: 10 } - - examples: - keyword: Значения - 13: [делимое, делитель, частное] - 14: [100, 2, 50] - 15: [28, 7, 4] - 16: [0, 5, 0] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/start_comments.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/start_comments.yml deleted file mode 100644 index 8a03473..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/start_comments.yml +++ /dev/null @@ -1,18 +0,0 @@ -feature: - title: Using the Console Formatter - language: en - line: 3 - description: |- - In order to verify this error - I want to run this feature using the progress format - So that it can be fixed - - scenarios: - - - type: scenario - title: A normal feature - line: 8 - steps: - - { type: 'Given', text: 'I have a pending step', line: 9 } - - { type: 'When', text: 'I run this feature with the progress format', line: 10 } - - { type: 'Then', text: "I should get a no method error for 'backtrace_line'", line: 11 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tables.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tables.yml deleted file mode 100644 index 9fb4a31..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tables.yml +++ /dev/null @@ -1,40 +0,0 @@ -feature: - title: A scenario outline - language: en - line: 1 - description: ~ - - scenarios: - - - type: outline - title: ~ - line: 3 - steps: - - { type: Given, text: I add and , line: 4 } - - - type: When - text: I pass a table argument - line: 6 - arguments: - - - type: table - rows: - 7: [foo, bar] - 8: [bar, baz] - - { type: Then, text: I the result should be , line: 10 } - - - type: And - text: the table should be properly escaped: - line: 12 - arguments: - - - type: table - rows: - 13: [|a, b, c] - 14: [1, |2, 3] - 15: [2, 3, |4] - - examples: - 18: [ a, b, c ] - 19: [ 1, |2, 3 ] - 20: [ 2, 3, 4 ] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tags_sample.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tags_sample.yml deleted file mode 100644 index 3a333c1..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tags_sample.yml +++ /dev/null @@ -1,35 +0,0 @@ -feature: - title: Tag samples - language: en - tags: [sample_one] - line: 2 - description: ~ - - scenarios: - - - type: scenario - title: Passing - tags: [sample_two, sample_four] - line: 5 - steps: - - { type: 'Given', text: 'missing', line: 6 } - - - - type: outline - title: ~ - tags: [sample_three] - line: 9 - steps: - - { type: 'Given', text: '', line: 10 } - - examples: - 12: [state] - 13: [missing] - - - - type: scenario - title: Skipped - tags: [sample_three, sample_four] - line: 16 - steps: - - { type: 'Given', text: 'missing', line: 17 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/test_unit.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/test_unit.yml deleted file mode 100644 index fb09190..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/test_unit.yml +++ /dev/null @@ -1,18 +0,0 @@ -feature: - title: Test::Unit - language: en - line: 1 - description: |- - In order to please people who like Test::Unit - As a Cucumber user - I want to be able to use assert* in my step definitions - - scenarios: - - - type: scenario - title: assert_equal - line: 6 - steps: - - { type: 'Given', text: 'x = 5', line: 7 } - - { type: 'And', text: 'y = 5', line: 8 } - - { type: 'Then', text: 'I can assert that x == y', line: 9 } diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/trimpystring.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/trimpystring.yml deleted file mode 100644 index 91ef49e..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/trimpystring.yml +++ /dev/null @@ -1,28 +0,0 @@ -feature: - title: A py string feature - language: en - line: 1 - description: ~ - - scenarios: - - - type: scenario - title: ~ - line: 3 - steps: - - - type: Then - text: String must be - line: 4 - arguments: - - - type: pystring - text: |- - - - a string - with something - be - a - u - ti - ful diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/undefined_multiline_args.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/undefined_multiline_args.yml deleted file mode 100644 index 5e5528f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/undefined_multiline_args.yml +++ /dev/null @@ -1,36 +0,0 @@ -feature: - title: undefined multiline args - language: en - line: 1 - description: ~ - - scenarios: - - - type: scenario - title: pystring - line: 3 - steps: - - - type: Given - text: a pystring - line: 4 - arguments: - - - type: pystring - text: ' example' - - - - type: scenario - title: table - line: 9 - steps: - - - type: Given - text: a table - line: 10 - arguments: - - - type: table - rows: - 11: [table] - 12: [example] diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/addition.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/addition.feature deleted file mode 100644 index 744184f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/addition.feature +++ /dev/null @@ -1,17 +0,0 @@ -# language: en -Feature: Addition - In order to avoid silly mistakes - As a math idiot - I want to be told the sum of two numbers - - Scenario: Add two numbers - Given I have entered 11 into the calculator - And I have entered 12 into the calculator - When I press add - Then the result should be 23 on the screen - - Scenario: Div two numbers - Given I have entered 10 into the calculator - And I have entered 2 into the calculator - When I press div - Then the result should be 5 on the screen diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background.feature deleted file mode 100644 index 9a3ffb8..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background.feature +++ /dev/null @@ -1,7 +0,0 @@ -Feature: Feature with background - - Background: - Given a passing step - - Scenario: - Given a failing step \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background_title.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background_title.feature deleted file mode 100644 index d8ed4d3..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background_title.feature +++ /dev/null @@ -1,13 +0,0 @@ -Feature: Feature with titled background - - Background: Some Background - title with - couple - of - | continuous | - """ - strings - Given a passing step - - Scenario: - Given a failing step diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/big_pystring.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/big_pystring.feature deleted file mode 100644 index 900d6c7..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/big_pystring.feature +++ /dev/null @@ -1,26 +0,0 @@ -Feature: Big PyString - Scenario: - Then it should fail with: - """ - - # language: ru - - UUUUUU - - 2 scenarios (2 undefined) - 6 steps (6 undefined) - - You can implement step definitions for undefined steps with these snippets: - - $steps->Given('/^I have entered (\d+)$/', function($world, $arg1) { - throw new \Everzet\Behat\Exception\Pending(); - }); - - $steps->Then('/^I must have (\d+)$/', function($world, $arg1) { - throw new \Everzet\Behat\Exception\Pending(); - }); - - $steps->Then('/^String must be \'([^\']*)\'$/', function($world, $arg1) { - throw new \Everzet\Behat\Exception\Pending(); - }); - """ diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/clean_tags.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/clean_tags.feature deleted file mode 100644 index e3e9cc7..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/clean_tags.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Feature N4 - - @normal - Scenario: - Given Some normal step N41 - And Some fast step N42 - - @fast - Scenario: - Given Some slow step N43 diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/commented_out.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/commented_out.feature deleted file mode 100644 index 61d7bef..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/commented_out.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: Fibonacci - In order to calculate super fast fibonacci series - As a pythonista - I want to use Python for that - -# -# Background: -# Given passing without a table -# -# Scenario: I'm a multiline name -# which goes on and on and on for three lines -# yawn -# Given passing without a table -# -# Scenario: -# Then I should see -# """ -# a string with #something -# """ -# -# Scenario Outline: Series -# When I ask python to calculate fibonacci up to -# Then it should give me -# -# Examples: -# | n | series | -# | 1 | [] | -# | 2 | [1, 1] | -# | 3 | [1, 1, 2] | -# | 4 | [1, 1, 2, 3] | -# | 6 | [1, 1, 2, 3, 5] | -# | 9 | [1, 1, 2, 3, 5, 8] | -# | 100 | [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | -# diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/comments.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/comments.feature deleted file mode 100644 index 02ca25c..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/comments.feature +++ /dev/null @@ -1,32 +0,0 @@ -# Users want to use cucumber, so tests are necessary to verify -# it is all working as expected -Feature: Using the Console Formatter -# com -# comment -#com - In order to verify this error # comment - - - - I want to run this feature using the progress format#comment - # COMMENT - # COMMENT - # COMMENT - # COMMENT - So that it can be fixed - - #comment - Scenario: A normal feature #comment in scenario title - #comment - Given I have a pending step #comment - #comment - #comment - When I run this feature with the progress format #comment - - -#comment - #comment - #comment - - Then I should get a no method error for 'backtrace_line' - diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/complex_descriptions.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/complex_descriptions.feature deleted file mode 100644 index 4db3b87..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/complex_descriptions.feature +++ /dev/null @@ -1,22 +0,0 @@ -# language: en - -# multiline -# comment -# YEAH - -Feature: Complex descriptions - Some description with - | table | row| - - and - - """ - """ - - Scenario: Some - | complex | description | - -""" -hell yeah -""" -Given one two three diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario.feature deleted file mode 100644 index 6c661c1..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario.feature +++ /dev/null @@ -1,7 +0,0 @@ -Feature: Cucumber command line - In order to write better software - Developers should be able to execute requirements as tests - - - Scenario: Pending Scenario at the end of a file with whitespace after it - diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/fibonacci.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/fibonacci.feature deleted file mode 100644 index 4a743ea..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/fibonacci.feature +++ /dev/null @@ -1,19 +0,0 @@ -Feature: Fibonacci - In order to calculate super fast fibonacci series - As a pythonista - I want to use Python for that - - Scenario Outline: Series - When I ask python to calculate fibonacci up to - Then it should give me - - Examples: - | n | series | - | 1 | [] | - | 2 | [1, 1] | - | 3 | [1, 1, 2] | - | 4 | [1, 1, 2, 3] | - | 6 | [1, 1, 2, 3, 5] | - | 9 | [1, 1, 2, 3, 5, 8] | - | 100 | [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | - diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/hashes_in_quotes.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/hashes_in_quotes.feature deleted file mode 100644 index e08fa70..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/hashes_in_quotes.feature +++ /dev/null @@ -1,17 +0,0 @@ -# language: en -Feature: Some '#quoted' string - In order to avoid silly mistakes - As a "#math" idiot - I want to be told the sum of two numbers - - Scenario: Add two numbers - Given I have entered 11 into the calculator - And I have entered 12 into the calculator - When I press "#add" - Then the result should be 23 on the screen - - Scenario: Div "#two" numbers # as - Given I have entered 10 into the calculator - And I have entered # 2 into the calculator - When I press div - Then the result should be 5 on the screen diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/issue_13.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/issue_13.feature deleted file mode 100644 index 4218a97..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/issue_13.feature +++ /dev/null @@ -1,24 +0,0 @@ -Feature: test pystring -second line - -Scenario: testing py string in scenario -second line - -Given the pystring is -""" -Test store name -Denmark, Kolding -6000 -""" - -Scenario Outline: testing py string in scenario outline -second line - -Given the pystring is -""" -Test store name -Denmark, Kolding -6000 -""" - Examples: - || diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ja_addition.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ja_addition.feature deleted file mode 100644 index b843852..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ja_addition.feature +++ /dev/null @@ -1,11 +0,0 @@ -# language: ja -フィーチャ: 加算 - バカな間違いを避けるために - 数学オンチとして - 2つの数の合計を知りたい - - シナリオ: 2つの数の加算について - 前提 50 を入力 - かつ 70 を入力 - もし add ボタンを押した - ならば結果は 120 を表示 \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/long_title_feature.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/long_title_feature.feature deleted file mode 100644 index a93cb4d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/long_title_feature.feature +++ /dev/null @@ -1,4 +0,0 @@ -Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match - -Scenario: See "No Record(s) Found" for Zero Existing - Given no public holiday exists in the system diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name.feature deleted file mode 100644 index 95b9d55..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name.feature +++ /dev/null @@ -1,23 +0,0 @@ -Feature: multiline - - Background: - Given passing without a table - - Scenario: I'm a multiline name - which goes on and on and on for three lines - yawn - Given passing without a table - - Scenario Outline: I'm a multiline name - which goes on and on and on for three lines - yawn - Given without a table - Examples: - | state | - |passing| - - Scenario Outline: name - Given without a table - Examples: - | state | - |passing| diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name_with_newlines.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name_with_newlines.feature deleted file mode 100644 index bfc3e06..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name_with_newlines.feature +++ /dev/null @@ -1,61 +0,0 @@ -Feature: multiline - - Feature description - - With etc. - - - Background: - - - Given passing without a table - - Scenario: - I'm a multiline name - which goes on and on and on for three lines - yawn - - - Given passing without a table - - Scenario Outline: I'm a multiline name - - which goes on and on and on for three lines - - yawn - - - Given without a table - - - Examples: - - - | state | - |passing| - - Scenario Outline: name - - - Given without a table - - - Examples: - - | state | - |passing| - - Scenario Outline: - - I'm a multiline name - which goes on and on and on for three lines - yawn - - - Given without a table - - - Examples: - - | state | - |passing| diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiplepystrings.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiplepystrings.feature deleted file mode 100644 index f5526af..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiplepystrings.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: A multiple py string feature - - Scenario: - When I enter a string - """ -- - a string - with something - be - a - u - ti - ful - """ - Then String must be - """ -- - a string - with something - be - a - u - ti - ful - """ diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_spaces.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_spaces.feature deleted file mode 100644 index e587faa..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_spaces.feature +++ /dev/null @@ -1,28 +0,0 @@ -Feature: Login - To ensure the safety of the application - A regular user of the system - Must authenticate before using the app - - - Scenario Outline: Failed Login - Given the user "known_user" - - When I go to the main page - Then I should see the login form - - When I fill in "login" with "" - And I fill in "password" with "" - And I press "Log In" - Then the login request should fail - And I should see the error message "Login or Password incorrect" - - Examples: - | login | password | - | | | - | unknown_user | | - | known_user | | - | | wrong_password | - | | known_userpass | - | unknown_user | wrong_password | - | unknown_user | known_userpass | - | known_user | wrong_password | diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_step_table.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_step_table.feature deleted file mode 100644 index 9d31771..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_step_table.feature +++ /dev/null @@ -1,13 +0,0 @@ -Feature: Unsubstituted argument placeholder - - Scenario Outline: See Annual Leave Details (as Management & Human Resource) - Given the following users exist in the system - | name | email | role_assignments | group_memberships | - | Jane | jane@fmail.com | | Sales (manager) | - | Max | max@fmail.com | | Sales (member) | - | Carol | carol@fmail.com | | Sales (member) | - | Cat | cat@fmail.com | | | - - Examples: - | role | - | HUMAN RESOURCE | diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/pystring.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/pystring.feature deleted file mode 100644 index 601373f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/pystring.feature +++ /dev/null @@ -1,8 +0,0 @@ -Feature: A py string feature - - Scenario: - Then I should see - """ - a string with #something - """ - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_addition.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_addition.feature deleted file mode 100644 index eda5722..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_addition.feature +++ /dev/null @@ -1,11 +0,0 @@ -# language: ru -Функционал: Сложение чисел - Чтобы не складывать в уме - Все, у кого с этим туго - Хотят автоматическое сложение целых чисел - - Сценарий: Сложение двух целых чисел - Допустим я ввожу число 50 - И затем ввожу число 70 - Если я нажимаю "+" - То результатом должно быть число 120 \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_commented.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_commented.feature deleted file mode 100644 index 36cbd05..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_commented.feature +++ /dev/null @@ -1,10 +0,0 @@ -# Comments -# comments -# COOOOOMMEEEENTS -# -# language: ru - -Функционал: Тест комментов - i18n должен правильно считываться - Даже если в начале файла 1000 - комментов! diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_consecutive_calculations.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_consecutive_calculations.feature deleted file mode 100644 index 87cc7f2..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_consecutive_calculations.feature +++ /dev/null @@ -1,17 +0,0 @@ -# language: ru -Функционал: Последовательные вычисления - Чтобы вычислять сложные выражения - Пользователи хотят проводить вычисления над результатом предыдущей операций - - Предыстория: - Допустим я сложил 3 и 5 - - Сценарий: сложение с результатом последней операций - Если я ввожу число 4 - И нажимаю "+" - То результатом должно быть число 12 - - Сценарий: деление результата последней операции - Если я ввожу число 2 - И нажимаю "/" - То результатом должно быть число 4 \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_division.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_division.feature deleted file mode 100644 index 7f024f6..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_division.feature +++ /dev/null @@ -1,16 +0,0 @@ -# language: ru -Функционал: Деление чисел - Поскольку деление сложный процесс и люди часто допускают ошибки - Нужно дать им возможность делить на калькуляторе - - Структура сценария: Целочисленное деление - Допустим я ввожу число <делимое> - И затем ввожу число <делитель> - Если я нажимаю "/" - То результатом должно быть число <частное> - - Значения: - | делимое | делитель | частное | - | 100 | 2 | 50 | - | 28 | 7 | 4 | - | 0 | 5 | 0 | \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/start_comments.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/start_comments.feature deleted file mode 100644 index 45dd501..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/start_comments.feature +++ /dev/null @@ -1,12 +0,0 @@ -# Users want to use cucumber, so tests are necessary to verify -# it is all working as expected -Feature: Using the Console Formatter - In order to verify this error - I want to run this feature using the progress format - So that it can be fixed - - Scenario: A normal feature - Given I have a pending step - When I run this feature with the progress format - Then I should get a no method error for 'backtrace_line' - diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tables.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tables.feature deleted file mode 100644 index 85ab575..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tables.feature +++ /dev/null @@ -1,20 +0,0 @@ -Feature: A scenario outline - # COMMENT - Scenario Outline: - Given I add and - # comment - When I pass a table argument - | foo | bar | - | bar | baz | - #comment - Then I the result should be - # comment - And the table should be properly escaped: - | \|a | b | c | - | 1 | \|2 | 3 | - | 2 | 3 | \|4 | -#comment - Examples: - | a | b | c | - | 1 | \|2 | 3 | - | 2 | 3 | 4 | diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tags_sample.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tags_sample.feature deleted file mode 100644 index 21eaaab..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tags_sample.feature +++ /dev/null @@ -1,17 +0,0 @@ -@sample_one -Feature: Tag samples - - @sample_two @sample_four - Scenario: Passing - Given missing - - @sample_three - Scenario Outline: - Given - Examples: - |state| - |missing| - - @sample_three @sample_four - Scenario: Skipped - Given missing \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/test_unit.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/test_unit.feature deleted file mode 100644 index ed08ba4..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/test_unit.feature +++ /dev/null @@ -1,9 +0,0 @@ -Feature: Test::Unit - In order to please people who like Test::Unit - As a Cucumber user - I want to be able to use assert* in my step definitions - - Scenario: assert_equal - Given x = 5 - And y = 5 - Then I can assert that x == y diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/trimpystring.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/trimpystring.feature deleted file mode 100644 index 4e04950..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/trimpystring.feature +++ /dev/null @@ -1,14 +0,0 @@ -Feature: A py string feature - - Scenario: - Then String must be - """ - - - a string - with something - be - a - u - ti - ful - """ diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/undefined_multiline_args.feature b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/undefined_multiline_args.feature deleted file mode 100644 index ae3c732..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/undefined_multiline_args.feature +++ /dev/null @@ -1,12 +0,0 @@ -Feature: undefined multiline args - - Scenario: pystring - Given a pystring - """ - example - """ - - Scenario: table - Given a table - | table | - |example| \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml deleted file mode 100644 index 398c60c..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml +++ /dev/null @@ -1,606 +0,0 @@ - -# -# !!! DON'T TOUCH THIS FILE, IT WAS AUTODOWNLOADED FROM: -# https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.yml -# - -# encoding: UTF-8 -# -# We use ISO 639-1 (language) and ISO 3166 alpha-2 (region - if applicable): -# http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes -# http://en.wikipedia.org/wiki/ISO_3166-1 -# -# If you want several aliases for a keyword, just separate them -# with a | character. The * is a step keyword alias for all translations. -# -# If you do *not* want a trailing space after a keyword, end it with a < character. -# (See Chinese for examples). -# -"en": - name: English - native: English - feature: Feature - background: Background - scenario: Scenario - scenario_outline: Scenario Outline|Scenario Template - examples: Examples|Scenarios - given: "*|Given" - when: "*|When" - then: "*|Then" - and: "*|And" - but: "*|But" - -# Please keep the grammars in alphabetical order by name from here and down. - -"ar": - name: Arabic - native: العربية - feature: خاصية - background: الخلفية - scenario: سيناريو - scenario_outline: سيناريو مخطط - examples: امثلة - given: "*|بفرض" - when: "*|متى|عندما" - then: "*|اذاً|ثم" - and: "*|و" - but: "*|لكن" -"bg": - name: Bulgarian - native: български - feature: Функционалност - background: Предистория - scenario: Сценарий - scenario_outline: Рамка на сценарий - examples: Примери - given: "*|Дадено" - when: "*|Когато" - then: "*|То" - and: "*|И" - but: "*|Но" -"ca": - name: Catalan - native: català - background: Rerefons|Antecedents - feature: Característica|Funcionalitat - scenario: Escenari - scenario_outline: Esquema de l'escenari - examples: Exemples - given: "*|Donat|Donada|Atès|Atesa" - when: "*|Quan" - then: "*|Aleshores|Cal" - and: "*|I" - but: "*|Però" -"cy-GB": - name: Welsh - native: Cymraeg - background: Cefndir - feature: Arwedd - scenario: Scenario - scenario_outline: Scenario Amlinellol - examples: Enghreifftiau - given: "*|Anrhegedig a" - when: "*|Pryd" - then: "*|Yna" - and: "*|A" - but: "*|Ond" -"cs": - name: Czech - native: Česky - feature: Požadavek - background: Pozadí|Kontext - scenario: Scénář - scenario_outline: Náčrt Scénáře|Osnova scénáře - examples: Příklady - given: "*|Pokud" - when: "*|Když" - then: "*|Pak" - and: "*|A také|A" - but: "*|Ale" -"da": - name: Danish - native: dansk - feature: Egenskab - background: Baggrund - scenario: Scenarie - scenario_outline: Abstrakt Scenario - examples: Eksempler - given: "*|Givet" - when: "*|Når" - then: "*|Så" - and: "*|Og" - but: "*|Men" -"de": - name: German - native: Deutsch - feature: Funktionalität - background: Grundlage - scenario: Szenario - scenario_outline: Szenariogrundriss - examples: Beispiele - given: "*|Angenommen|Gegeben sei" - when: "*|Wenn" - then: "*|Dann" - and: "*|Und" - but: "*|Aber" -"en-au": - name: Australian - native: Australian - feature: Crikey - background: Background - scenario: Mate - scenario_outline: Blokes - examples: Cobber - given: "*|Ya know how" - when: "*|When" - then: "*|Ya gotta" - and: "*|N" - but: "*|Cept" -"en-lol": - name: LOLCAT - native: LOLCAT - feature: OH HAI - background: B4 - scenario: MISHUN - scenario_outline: MISHUN SRSLY - examples: EXAMPLZ - given: "*|I CAN HAZ" - when: "*|WEN" - then: "*|DEN" - and: "*|AN" - but: "*|BUT" -"en-pirate": - name: Pirate - native: Pirate - feature: Ahoy matey! - background: Yo-ho-ho - scenario: Heave to - scenario_outline: Shiver me timbers - examples: Dead men tell no tales - given: "*|Gangway!" - when: "*|Blimey!" - then: "*|Let go and haul" - and: "*|Aye" - but: "*|Avast!" -"en-Scouse": - name: Scouse - native: Scouse - feature: Feature - background: "Dis is what went down" - scenario: "The thing of it is" - scenario_outline: "Wharrimean is" - examples: Examples - given: "*|Givun|Youse know when youse got" - when: "*|Wun|Youse know like when" - then: "*|Dun|Den youse gotta" - and: "*|An" - but: "*|Buh" -"en-tx": - name: Texan - native: Texan - feature: Feature - background: Background - scenario: Scenario - scenario_outline: All y'all - examples: Examples - given: "*|Given y'all" - when: "*|When y'all" - then: "*|Then y'all" - and: "*|And y'all" - but: "*|But y'all" -"eo": - name: Esperanto - native: Esperanto - feature: Trajto - background: Fono - scenario: Scenaro - scenario_outline: Konturo de la scenaro - examples: Ekzemploj - given: "*|Donitaĵo" - when: "*|Se" - then: "*|Do" - and: "*|Kaj" - but: "*|Sed" -"es": - name: Spanish - native: español - background: Antecedentes - feature: Característica - scenario: Escenario - scenario_outline: Esquema del escenario - examples: Ejemplos - given: "*|Dado|Dada|Dados|Dadas" - when: "*|Cuando" - then: "*|Entonces" - and: "*|Y" - but: "*|Pero" -"et": - name: Estonian - native: eesti keel - feature: Omadus - background: Taust - scenario: Stsenaarium - scenario_outline: Raamstsenaarium - examples: Juhtumid - given: "*|Eeldades" - when: "*|Kui" - then: "*|Siis" - and: "*|Ja" - but: "*|Kuid" -"fi": - name: Finnish - native: suomi - feature: Ominaisuus - background: Tausta - scenario: Tapaus - scenario_outline: Tapausaihio - examples: Tapaukset - given: "*|Oletetaan" - when: "*|Kun" - then: "*|Niin" - and: "*|Ja" - but: "*|Mutta" -"fr": - name: French - native: français - feature: Fonctionnalité - background: Contexte - scenario: Scénario - scenario_outline: Plan du scénario|Plan du Scénario - examples: Exemples - given: "*|Soit|Etant donné|Etant donnée|Etant donnés|Etant données|Étant donné|Étant donnée|Étant donnés|Étant données" - when: "*|Quand|Lorsque|Lorsqu'<" - then: "*|Alors" - and: "*|Et" - but: "*|Mais" -"he": - name: Hebrew - native: עברית - feature: תכונה - background: רקע - scenario: תרחיש - scenario_outline: תבנית תרחיש - examples: דוגמאות - given: "*|בהינתן" - when: "*|כאשר" - then: "*|אז|אזי" - and: "*|וגם" - but: "*|אבל" -"hr": - name: Croatian - native: hrvatski - feature: Osobina|Mogućnost|Mogucnost - background: Pozadina - scenario: Scenarij - scenario_outline: Skica|Koncept - examples: Primjeri|Scenariji - given: "*|Zadan|Zadani|Zadano" - when: "*|Kada|Kad" - then: "*|Onda" - and: "*|I" - but: "*|Ali" -"hu": - name: Hungarian - native: magyar - feature: Jellemző - background: Háttér - scenario: Forgatókönyv - scenario_outline: Forgatókönyv vázlat - examples: Példák - given: "*|Amennyiben|Adott" - when: "*|Majd|Ha|Amikor" - then: "*|Akkor" - and: "*|És" - but: "*|De" -"id": - name: Indonesian - native: Bahasa Indonesia - feature: Fitur - background: Dasar - scenario: Skenario - scenario_outline: Skenario konsep - examples: Contoh - given: "*|Dengan" - when: "*|Ketika" - then: "*|Maka" - and: "*|Dan" - but: "*|Tapi" -"is": - name: Icelandic - native: Íslenska - feature: Eiginleiki - background: Bakgrunnur - scenario: Atburðarás - scenario_outline: Lýsing Atburðarásar|Lýsing Dæma - examples: Dæmi|Atburðarásir - given: "*|Ef" - when: "*|Þegar" - then: "*|Þá" - and: "*|Og" - but: "*|En" -"it": - name: Italian - native: italiano - feature: Funzionalità - background: Contesto - scenario: Scenario - scenario_outline: Schema dello scenario - examples: Esempi - given: "*|Dato|Data|Dati|Date" - when: "*|Quando" - then: "*|Allora" - and: "*|E" - but: "*|Ma" -"ja": - name: Japanese - native: 日本語 - feature: フィーチャ|機能 - background: 背景 - scenario: シナリオ - scenario_outline: シナリオアウトライン|シナリオテンプレート|テンプレ|シナリオテンプレ - examples: 例|サンプル - given: "*|前提<" - when: "*|もし<" - then: "*|ならば<" - and: "*|かつ<" - but: "*|しかし<|但し<|ただし<" -"ko": - name: Korean - native: 한국어 - background: 배경 - feature: 기능 - scenario: 시나리오 - scenario_outline: 시나리오 개요 - examples: 예 - given: "*|조건<|먼저<" - when: "*|만일<|만약<" - then: "*|그러면<" - and: "*|그리고<" - but: "*|하지만<|단<" -"lt": - name: Lithuanian - native: lietuvių kalba - feature: Savybė - background: Kontekstas - scenario: Scenarijus - scenario_outline: Scenarijaus šablonas - examples: Pavyzdžiai|Scenarijai|Variantai - given: "*|Duota" - when: "*|Kai" - then: "*|Tada" - and: "*|Ir" - but: "*|Bet" -"lu": - name: Luxemburgish - native: Lëtzebuergesch - feature: Funktionalitéit - background: Hannergrond - scenario: Szenario - scenario_outline: Plang vum Szenario - examples: Beispiller - given: "*|ugeholl" - when: "*|wann" - then: "*|dann" - and: "*|an|a" - but: "*|awer|mä" -"lv": - name: Latvian - native: latviešu - feature: Funkcionalitāte|Fīča - background: Konteksts|Situācija - scenario: Scenārijs - scenario_outline: Scenārijs pēc parauga - examples: Piemēri|Paraugs - given: "*|Kad" - when: "*|Ja" - then: "*|Tad" - and: "*|Un" - but: "*|Bet" -"nl": - name: Dutch - native: Nederlands - feature: Functionaliteit - background: Achtergrond - scenario: Scenario - scenario_outline: Abstract Scenario - examples: Voorbeelden - given: "*|Gegeven|Stel" - when: "*|Als" - then: "*|Dan" - and: "*|En" - but: "*|Maar" -"no": - name: Norwegian - native: norsk - feature: Egenskap - background: Bakgrunn - scenario: Scenario - scenario_outline: Scenariomal|Abstrakt Scenario - examples: Eksempler - given: "*|Gitt" - when: "*|Når" - then: "*|Så" - and: "*|Og" - but: "*|Men" -"pl": - name: Polish - native: polski - feature: Właściwość - background: Założenia - scenario: Scenariusz - scenario_outline: Szablon scenariusza - examples: Przykłady - given: "*|Zakładając|Mając" - when: "*|Jeżeli|Jeśli" - then: "*|Wtedy" - and: "*|Oraz|I" - but: "*|Ale" -"pt": - name: Portuguese - native: português - background: Contexto - feature: Funcionalidade - scenario: Cenário|Cenario - scenario_outline: Esquema do Cenário|Esquema do Cenario - examples: Exemplos - given: "*|Dado|Dada|Dados|Dadas" - when: "*|Quando" - then: "*|Então|Entao" - and: "*|E" - but: "*|Mas" -"ro": - name: Romanian - native: română - background: Context - feature: Functionalitate|Funcționalitate|Funcţionalitate - scenario: Scenariu - scenario_outline: Structura scenariu|Structură scenariu - examples: Exemple - given: "*|Date fiind|Dat fiind|Dati fiind|Dați fiind|Daţi fiind" - when: "*|Cand|Când" - then: "*|Atunci" - and: "*|Si|Și|Şi" - but: "*|Dar" -"ru": - name: Russian - native: русский - feature: Функция|Функционал|Свойство - background: Предыстория|Контекст - scenario: Сценарий - scenario_outline: Структура сценария - examples: Примеры - given: "*|Допустим|Дано|Пусть" - when: "*|Если|Когда" - then: "*|То|Тогда" - and: "*|И|К тому же" - but: "*|Но|А" -"sv": - name: Swedish - native: Svenska - feature: Egenskap - background: Bakgrund - scenario: Scenario - scenario_outline: Abstrakt Scenario|Scenariomall - examples: Exempel - given: "*|Givet" - when: "*|När" - then: "*|Så" - and: "*|Och" - but: "*|Men" -"sk": - name: Slovak - native: Slovensky - feature: Požiadavka - background: Pozadie - scenario: Scenár - scenario_outline: Náčrt Scenáru - examples: Príklady - given: "*|Pokiaľ" - when: "*|Keď" - then: "*|Tak" - and: "*|A" - but: "*|Ale" -"sr-Latn": - name: Serbian (Latin) - native: Srpski (Latinica) - feature: Funkcionalnost|Mogućnost|Mogucnost|Osobina - background: Kontekst|Osnova|Pozadina - scenario: Scenario|Primer - scenario_outline: Struktura scenarija|Skica|Koncept - examples: Primeri|Scenariji - given: "*|Zadato|Zadate|Zatati" - when: "*|Kada|Kad" - then: "*|Onda" - and: "*|I" - but: "*|Ali" -"sr-Cyrl": - name: Serbian - native: Српски - feature: Функционалност|Могућност|Особина - background: Контекст|Основа|Позадина - scenario: Сценарио|Пример - scenario_outline: Структура сценарија|Скица|Концепт - examples: Примери|Сценарији - given: "*|Задато|Задате|Задати" - when: "*|Када|Кад" - then: "*|Онда" - and: "*|И" - but: "*|Али" -"tr": - name: Turkish - native: Türkçe - feature: Özellik - background: Geçmiş - scenario: Senaryo - scenario_outline: Senaryo taslağı - examples: Örnekler - given: "*|Diyelim ki" - when: "*|Eğer ki" - then: "*|O zaman" - and: "*|Ve" - but: "*|Fakat|Ama" -"uk": - name: Ukrainian - native: Українська - feature: Функціонал - background: Передумова - scenario: Сценарій - scenario_outline: Структура сценарію - examples: Приклади - given: "*|Припустимо|Припустимо, що|Нехай|Дано" - when: "*|Якщо|Коли" - then: "*|То|Тоді" - and: "*|І|А також|Та" - but: "*|Але" -"uz": - name: Uzbek - native: Узбекча - feature: Функционал - background: Тарих - scenario: Сценарий - scenario_outline: Сценарий структураси - examples: Мисоллар - given: "*|Агар" - when: "*|Агар" - then: "*|Унда" - and: "*|Ва" - but: "*|Лекин|Бирок|Аммо" -"vi": - name: Vietnamese - native: Tiếng Việt - feature: Tính năng - background: Bối cảnh - scenario: Tình huống|Kịch bản - scenario_outline: Khung tình huống|Khung kịch bản - examples: Dữ liệu - given: "*|Biết|Cho" - when: "*|Khi" - then: "*|Thì" - and: "*|Và" - but: "*|Nhưng" -"zh-CN": - name: Chinese simplified - native: 简体中文 - feature: 功能 - background: 背景 - scenario: 场景 - scenario_outline: 场景大纲 - examples: 例子 - given: "*|假如<" - when: "*|当<" - then: "*|那么<" - and: "*|而且<" - but: "*|但是<" -"zh-TW": - name: Chinese traditional - native: 繁體中文 - feature: 功能 - background: 背景 - scenario: 場景|劇本 - scenario_outline: 場景大綱|劇本大綱 - examples: 例子 - given: "*|假設<" - when: "*|當<" - then: "*|那麼<" - and: "*|而且<|並且<" - but: "*|但是<" diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ar.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ar.xliff deleted file mode 100644 index 1ecea81..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ar.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - خاصية - - - Background - الخلفية - - - Scenario - سيناريو - - - Scenario Outline - سيناريو مخطط - - - Examples - امثلة - - - Given|When|Then|And|But - عندما|بفرض|اذاً|متى|لكن|ثم|و - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/bg.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/bg.xliff deleted file mode 100644 index bcbb91d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/bg.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Функционалност - - - Background - Предистория - - - Scenario - Сценарий - - - Scenario Outline - Рамка на сценарий - - - Examples - Примери - - - Given|When|Then|And|But - Дадено|Когато|Но|То|И - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ca.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ca.xliff deleted file mode 100644 index fa97487..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ca.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Característica|Funcionalitat - - - Background - Rerefons|Antecedents - - - Scenario - Escenari - - - Scenario Outline - Esquema de l'escenari - - - Examples - Exemples - - - Given|When|Then|And|But - Aleshores|Donada|Donat|Atès|Però|Atesa|Quan|Cal|I - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/cs.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/cs.xliff deleted file mode 100644 index 1719d26..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/cs.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Požadavek - - - Background - Pozadí|Kontext - - - Scenario - Scénář - - - Scenario Outline - Náčrt Scénáře|Osnova scénáře - - - Examples - Příklady - - - Given|When|Then|And|But - A také|Pokud|Když|Ale|Pak|A - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/cy-GB.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/cy-GB.xliff deleted file mode 100644 index 3dbd264..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/cy-GB.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Arwedd - - - Background - Cefndir - - - Scenario - Scenario - - - Scenario Outline - Scenario Amlinellol - - - Examples - Enghreifftiau - - - Given|When|Then|And|But - Anrhegedig a|Pryd|Ond|Yna|A - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/da.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/da.xliff deleted file mode 100644 index 2d92e1f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/da.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Egenskab - - - Background - Baggrund - - - Scenario - Scenarie - - - Scenario Outline - Abstrakt Scenario - - - Examples - Eksempler - - - Given|When|Then|And|But - Givet|Når|Men|Så|Og - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/de.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/de.xliff deleted file mode 100644 index 899734a..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/de.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Funktionalität - - - Background - Grundlage - - - Scenario - Szenario - - - Scenario Outline - Szenariogrundriss - - - Examples - Beispiele - - - Given|When|Then|And|But - Gegeben sei|Angenommen|Aber|Wenn|Dann|Und - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-Scouse.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-Scouse.xliff deleted file mode 100644 index 701b169..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-Scouse.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Feature - - - Background - Dis is what went down - - - Scenario - The thing of it is - - - Scenario Outline - Wharrimean is - - - Examples - Examples - - - Given|When|Then|And|But - Youse know when youse got|Youse know like when|Den youse gotta|Givun|Buh|Dun|Wun|An - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-au.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-au.xliff deleted file mode 100644 index 4c4671e..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-au.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Crikey - - - Background - Background - - - Scenario - Mate - - - Scenario Outline - Blokes - - - Examples - Cobber - - - Given|When|Then|And|But - Ya know how|Ya gotta|When|Cept|N - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-lol.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-lol.xliff deleted file mode 100644 index 224e77f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-lol.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - OH HAI - - - Background - B4 - - - Scenario - MISHUN - - - Scenario Outline - MISHUN SRSLY - - - Examples - EXAMPLZ - - - Given|When|Then|And|But - I CAN HAZ|BUT|DEN|WEN|AN - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-pirate.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-pirate.xliff deleted file mode 100644 index 31ce119..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-pirate.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Ahoy matey! - - - Background - Yo-ho-ho - - - Scenario - Heave to - - - Scenario Outline - Shiver me timbers - - - Examples - Dead men tell no tales - - - Given|When|Then|And|But - Let go and haul|Gangway!|Blimey!|Avast!|Aye - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-tx.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-tx.xliff deleted file mode 100644 index d466bcc..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en-tx.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Feature - - - Background - Background - - - Scenario - Scenario - - - Scenario Outline - All y'all - - - Examples - Examples - - - Given|When|Then|And|But - Given y'all|Then y'all|When y'all|But y'all|And y'all - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en.xliff deleted file mode 100644 index 0cfa009..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/en.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Feature - - - Background - Background - - - Scenario - Scenario - - - Scenario Outline - Scenario Outline|Scenario Template - - - Examples - Examples|Scenarios - - - Given|When|Then|And|But - Given|Then|When|But|And - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/eo.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/eo.xliff deleted file mode 100644 index dbdc819..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/eo.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Trajto - - - Background - Fono - - - Scenario - Scenaro - - - Scenario Outline - Konturo de la scenaro - - - Examples - Ekzemploj - - - Given|When|Then|And|But - Donitaĵo|Sed|Kaj|Do|Se - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/es.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/es.xliff deleted file mode 100644 index aaa89ac..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/es.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Característica - - - Background - Antecedentes - - - Scenario - Escenario - - - Scenario Outline - Esquema del escenario - - - Examples - Ejemplos - - - Given|When|Then|And|But - Dado que|Cuando|Entonces|Y|Pero - - - - diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/et.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/et.xliff deleted file mode 100644 index f519790..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/et.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Omadus - - - Background - Taust - - - Scenario - Stsenaarium - - - Scenario Outline - Raamstsenaarium - - - Examples - Juhtumid - - - Given|When|Then|And|But - Eeldades|Kuid|Siis|Kui|Ja - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/fi.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/fi.xliff deleted file mode 100644 index c4ed6c8..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/fi.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Ominaisuus - - - Background - Tausta - - - Scenario - Tapaus - - - Scenario Outline - Tapausaihio - - - Examples - Tapaukset - - - Given|When|Then|And|But - Oletetaan|Mutta|Niin|Kun|Ja - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/fr.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/fr.xliff deleted file mode 100644 index 6d601be..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/fr.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Fonctionnalité - - - Background - Contexte - - - Scenario - Scénario - - - Scenario Outline - Plan du scénario|Plan du Scénario - - - Examples - Exemples - - - Given|When|Then|And|But - Etant donné|Lorsqu'|Lorsque|Quand|Alors|Soit|Mais|Et - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/he.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/he.xliff deleted file mode 100644 index aadb671..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/he.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - תכונה - - - Background - רקע - - - Scenario - תרחיש - - - Scenario Outline - תבנית תרחיש - - - Examples - דוגמאות - - - Given|When|Then|And|But - בהינתן|כאשר|וגם|אבל|אזי|אז - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/hr.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/hr.xliff deleted file mode 100644 index feac19d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/hr.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Osobina|Mogućnost|Mogucnost - - - Background - Pozadina - - - Scenario - Scenarij - - - Scenario Outline - Skica|Koncept - - - Examples - Primjeri|Scenariji - - - Given|When|Then|And|But - Zadano|Zadani|Zadan|Onda|Kada|Kad|Ali|I - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/hu.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/hu.xliff deleted file mode 100644 index 256d134..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/hu.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Jellemző - - - Background - Háttér - - - Scenario - Forgatókönyv - - - Scenario Outline - Forgatókönyv vázlat - - - Examples - Példák - - - Given|When|Then|And|But - Amennyiben|Amikor|Akkor|Adott|Majd|És|De|Ha - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/id.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/id.xliff deleted file mode 100644 index 77921f5..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/id.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Fitur - - - Background - Dasar - - - Scenario - Skenario - - - Scenario Outline - Skenario konsep - - - Examples - Contoh - - - Given|When|Then|And|But - Dengan|Ketika|Tapi|Maka|Dan - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/it.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/it.xliff deleted file mode 100644 index c963105..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/it.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Funzionalità - - - Background - Contesto - - - Scenario - Scenario - - - Scenario Outline - Schema dello scenario - - - Examples - Esempi - - - Given|When|Then|And|But - Quando|Allora|Dato|Ma|E - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ja.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ja.xliff deleted file mode 100644 index 88134ed..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ja.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - フィーチャ|機能 - - - Background - 背景 - - - Scenario - シナリオ - - - Scenario Outline - シナリオアウトライン|シナリオテンプレート|テンプレ|シナリオテンプレ - - - Examples - 例|サンプル - - - Given|When|Then|And|But - ならば|ただし|しかし|但し|かつ|もし|前提 - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ko.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ko.xliff deleted file mode 100644 index 58e3778..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ko.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - 기능 - - - Background - 배경 - - - Scenario - 시나리오 - - - Scenario Outline - 시나리오 개요 - - - Examples - - - - Given|When|Then|And|But - 그리고|하지만|그러면|만약|먼저|만일|조건|단 - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lt.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lt.xliff deleted file mode 100644 index 0676a3a..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lt.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Savybė - - - Background - Kontekstas - - - Scenario - Scenarijus - - - Scenario Outline - Scenarijaus šablonas - - - Examples - Pavyzdžiai|Scenarijai|Variantai - - - Given|When|Then|And|But - Duota|Tada|Kai|Bet|Ir - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lu.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lu.xliff deleted file mode 100644 index 3406d7c..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lu.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Funktionalitéit - - - Background - Hannergrond - - - Scenario - Szenario - - - Scenario Outline - Plang vum Szenario - - - Examples - Beispiller - - - Given|When|Then|And|But - ugeholl|awer|dann|wann|mä|an|a - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lv.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lv.xliff deleted file mode 100644 index 1c41f2e..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/lv.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Funkcionalitāte|Fīča - - - Background - Konteksts|Situācija - - - Scenario - Scenārijs - - - Scenario Outline - Scenārijs pēc parauga - - - Examples - Piemēri|Paraugs - - - Given|When|Then|And|But - Bet|Kad|Tad|Ja|Un - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/nl.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/nl.xliff deleted file mode 100644 index 56ea8fc..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/nl.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Functionaliteit - - - Background - Achtergrond - - - Scenario - Scenario - - - Scenario Outline - Abstract Scenario - - - Examples - Voorbeelden - - - Given|When|Then|And|But - Gegeven|Stel|Maar|Als|Dan|En - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/no.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/no.xliff deleted file mode 100644 index 7f534dd..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/no.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Egenskap - - - Background - Bakgrunn - - - Scenario - Scenario - - - Scenario Outline - Scenariomal|Abstrakt Scenario - - - Examples - Eksempler - - - Given|When|Then|And|But - Gitt|Når|Men|Så|Og - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/pl.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/pl.xliff deleted file mode 100644 index c3803a2..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/pl.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Właściwość - - - Background - Założenia - - - Scenario - Scenariusz - - - Scenario Outline - Szablon scenariusza - - - Examples - Przykłady - - - Given|When|Then|And|But - Zakładając|Jeżeli|Jeśli|Mając|Wtedy|Oraz|Ale|I - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/pt.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/pt.xliff deleted file mode 100644 index d1f2666..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/pt.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Funcionalidade - - - Background - Contexto - - - Scenario - Cenário|Cenario - - - Scenario Outline - Esquema do Cenário|Esquema do Cenario - - - Examples - Exemplos - - - Given|When|Then|And|But - Quando|Então|Entao|Dado|Dada|Mas|E - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ro.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ro.xliff deleted file mode 100644 index b7ddb89..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ro.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Functionalitate|Funcționalitate|Funcţionalitate - - - Background - Context - - - Scenario - Scenariu - - - Scenario Outline - Structura scenariu|Structură scenariu - - - Examples - Exemple - - - Given|When|Then|And|But - Daţi fiind|Dați fiind|Date fiind|Dati fiind|Dat fiind|Atunci|Când|Cand|Dar|Şi|Și|Si - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ru.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ru.xliff deleted file mode 100644 index caa70bb..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/ru.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Функционал|Фича - - - Background - Предыстория - - - Scenario - Сценарий - - - Scenario Outline - Структура сценария - - - Examples - Значения - - - Given|When|Then|And|But - К тому же|Допустим|Когда|Пусть|Тогда|Если|Дано|Но|То|А|И - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sk.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sk.xliff deleted file mode 100644 index 8b1b51c..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sk.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Požiadavka - - - Background - Pozadie - - - Scenario - Scenár - - - Scenario Outline - Náčrt Scenáru - - - Examples - Príklady - - - Given|When|Then|And|But - Pokiaľ|Keď|Ale|Tak|A - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sr-Cyrl.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sr-Cyrl.xliff deleted file mode 100644 index 7b42f7d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sr-Cyrl.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Функционалност|Могућност|Особина - - - Background - Контекст|Основа|Позадина - - - Scenario - Сценарио|Пример - - - Scenario Outline - Структура сценарија|Скица|Концепт - - - Examples - Примери|Сценарији - - - Given|When|Then|And|But - Задато|Задати|Задате|Онда|Када|Кад|Али|И - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sr-Latn.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sr-Latn.xliff deleted file mode 100644 index 3bb418a..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sr-Latn.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Funkcionalnost|Mogućnost|Mogucnost|Osobina - - - Background - Kontekst|Osnova|Pozadina - - - Scenario - Scenario|Primer - - - Scenario Outline - Struktura scenarija|Skica|Koncept - - - Examples - Primeri|Scenariji - - - Given|When|Then|And|But - Zadato|Zatati|Zadate|Onda|Kada|Kad|Ali|I - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sv.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sv.xliff deleted file mode 100644 index 33fccd6..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/sv.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Egenskap - - - Background - Bakgrund - - - Scenario - Scenario - - - Scenario Outline - Abstrakt Scenario|Scenariomall - - - Examples - Exempel - - - Given|When|Then|And|But - Givet|När|Men|Så|Och - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/tr.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/tr.xliff deleted file mode 100644 index 91ee3c8..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/tr.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Özellik - - - Background - Geçmiş - - - Scenario - Senaryo - - - Scenario Outline - Senaryo taslağı - - - Examples - Örnekler - - - Given|When|Then|And|But - Diyelim ki|Eğer ki|O zaman|Fakat|Ama|Ve - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/uk.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/uk.xliff deleted file mode 100644 index effd55b..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/uk.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Функціонал - - - Background - Передумова - - - Scenario - Сценарій - - - Scenario Outline - Структура сценарію - - - Examples - Приклади - - - Given|When|Then|And|But - Припустимо, що|Припустимо|А також|Нехай|Тоді|Коли|Дано|Якщо|Але|Та|То|І - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/uz.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/uz.xliff deleted file mode 100644 index 62c19dc..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/uz.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Функционал - - - Background - Тарих - - - Scenario - Сценарий - - - Scenario Outline - Сценарий структураси - - - Examples - Мисоллар - - - Given|When|Then|And|But - Лекин|Бирок|Агар|Унда|Агар|Аммо|Ва - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/vi.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/vi.xliff deleted file mode 100644 index 0c77b23..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/vi.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - Tính năng - - - Background - Bối cảnh - - - Scenario - Tình huống|Kịch bản - - - Scenario Outline - Khung tình huống|Khung kịch bản - - - Examples - Dữ liệu - - - Given|When|Then|And|But - Biết|Nhưng|Thì|Và|Khi|Cho - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/zh-CN.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/zh-CN.xliff deleted file mode 100644 index 8a7e98f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/zh-CN.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - 功能 - - - Background - 背景 - - - Scenario - 场景 - - - Scenario Outline - 场景大纲 - - - Examples - 例子 - - - Given|When|Then|And|But - 但是|而且|那么|假如|当 - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/zh-TW.xliff b/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/zh-TW.xliff deleted file mode 100644 index 455aa29..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n/zh-TW.xliff +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - Feature - 功能 - - - Background - 背景 - - - Scenario - 場景|劇本 - - - Scenario Outline - 場景大綱|劇本大綱 - - - Examples - 例子 - - - Given|When|Then|And|But - 並且|但是|而且|那麼|假設|當 - - - - \ No newline at end of file diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/GherkinTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/GherkinTest.php deleted file mode 100644 index fd65746..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/GherkinTest.php +++ /dev/null @@ -1,110 +0,0 @@ -getCustomFilterMock(); - $customFilter2 = $this->getCustomFilterMock(); - - $gherkin = new Gherkin(); - $gherkin->addLoader($loader = $this->getLoaderMock()); - $gherkin->addFilter($nameFilter = $this->getNameFilterMock()); - $gherkin->addFilter($tagFilter = $this->getTagFilterMock()); - - $feature = new FeatureNode(); - $feature->addScenario($scenario = new ScenarioNode()); - - $loader - ->expects($this->once()) - ->method('supports') - ->with($resource = 'some/feature/resource') - ->will($this->returnValue(true)); - $loader - ->expects($this->once()) - ->method('load') - ->with($resource) - ->will($this->returnValue(array($feature))); - - $filterFeature = clone $feature; - $nameFilter - ->expects($this->once()) - ->method('filterFeature') - ->with($filterFeature); - $tagFilter - ->expects($this->once()) - ->method('filterFeature') - ->with($filterFeature); - $customFilter1 - ->expects($this->once()) - ->method('filterFeature') - ->with($filterFeature); - $customFilter2 - ->expects($this->once()) - ->method('filterFeature') - ->with($filterFeature); - - $features = $gherkin->load($resource, array($customFilter1, $customFilter2)); - $this->assertEquals(1, count($features)); - $this->assertTrue($feature->isFrozen()); - - $scenarios = $features[0]->getScenarios(); - $this->assertEquals(1, count($scenarios)); - $this->assertSame($scenario, $scenarios[0]); - } - - public function testSetBasePath() - { - $gherkin = new Gherkin(); - $gherkin->addLoader($loader1 = $this->getLoaderMock()); - $gherkin->addLoader($loader2 = $this->getLoaderMock()); - - $loader1 - ->expects($this->once()) - ->method('setBasePath') - ->with($basePath = '/base/path') - ->will($this->returnValue(null)); - - $loader2 - ->expects($this->once()) - ->method('setBasePath') - ->with($basePath = '/base/path') - ->will($this->returnValue(null)); - - $gherkin->setBasePath($basePath); - } - - protected function getLoaderMock() - { - return $this->getMockBuilder('Behat\Gherkin\Loader\GherkinFileLoader') - ->disableOriginalConstructor() - ->getMock(); - } - - protected function getCustomFilterMock() - { - return $this->getMockBuilder('Behat\Gherkin\Filter\FilterInterface') - ->disableOriginalConstructor() - ->getMock(); - } - - protected function getNameFilterMock() - { - return $this->getMockBuilder('Behat\Gherkin\Filter\NameFilter') - ->disableOriginalConstructor() - ->getMock(); - } - - protected function getTagFilterMock() - { - return $this->getMockBuilder('Behat\Gherkin\Filter\TagFilter') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php deleted file mode 100644 index 7f8aec4..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php +++ /dev/null @@ -1,34 +0,0 @@ -addStep(new Node\StepNode($keyword, $text, $line)); - $line += 1; - } - - return $line; - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php deleted file mode 100644 index 3f7878d..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php +++ /dev/null @@ -1,59 +0,0 @@ -addStep(new Node\StepNode($keyword, $text, $line)); - $line += 1; - } - - return $line; - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsDumperTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsDumperTest.php deleted file mode 100644 index 178cdcb..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsDumperTest.php +++ /dev/null @@ -1,270 +0,0 @@ -keywords = new ArrayKeywords(array( - 'en' => array( - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline|Scenario Template', - 'examples' => 'Examples|Scenarios', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But' - ), - 'ru' => array( - 'feature' => 'Функционал|Фича', - 'background' => 'Предыстория|Бэкграунд', - 'scenario' => 'Сценарий|История', - 'scenario_outline' => 'Структура сценария|Аутлайн', - 'examples' => 'Значения', - 'given' => 'Допустим', - 'when' => 'Если|@', - 'then' => 'То', - 'and' => 'И', - 'but' => 'Но' - ) - )); - } - - public function testEnKeywordsDumper() - { - $dumper = new KeywordsDumper($this->keywords); - - $dumped = $dumper->dump('en'); - $etalon = << - And there is agent - When I erase agent 's memory - Then there should be agent - But there should not be agent - - (Examples|Scenarios): - | agent1 | agent2 | - | D | M | -GHERKIN; - - $this->assertEquals($etalon, $dumped); - } - - public function testRuKeywordsDumper() - { - $dumper = new KeywordsDumper($this->keywords); - - $dumped = $dumper->dump('ru'); - $etalon = << - И there is agent - (Если|@) I erase agent 's memory - То there should be agent - Но there should not be agent - - Значения: - | agent1 | agent2 | - | D | M | -GHERKIN; - - $this->assertEquals($etalon, $dumped); - } - - public function testRuKeywordsCustomKeywordsDumper() - { - $dumper = new KeywordsDumper($this->keywords); - $dumper->setKeywordsDumperFunction(function($keywords, $short){ - return ''.implode(', ', $keywords).''; - }); - - $dumped = $dumper->dump('ru'); - $etalon = <<Функционал, Фича: Internal operations - In order to stay secret - As a secret organization - We need to be able to erase past agents' memory - - Предыстория, Бэкграунд: - Допустим there is agent A - И there is agent B - - Сценарий, История: Erasing agent memory - Допустим there is agent J - И there is agent K - Если, @ I erase agent K's memory - То there should be agent J - Но there should not be agent K - - Структура сценария, Аутлайн: Erasing other agents' memory - Допустим there is agent - И there is agent - Если, @ I erase agent 's memory - То there should be agent - Но there should not be agent - - Значения: - | agent1 | agent2 | - | D | M | -GHERKIN; - - $this->assertEquals($etalon, $dumped); - } - - public function testExtendedVersionDumper() - { - $dumper = new KeywordsDumper($this->keywords); - - $dumped = $dumper->dump('ru', false); - $etalon = array( -<< - И there is agent - Если I erase agent 's memory - @ I erase agent 's memory - То there should be agent - Но there should not be agent - - Значения: - | agent1 | agent2 | - | D | M | - - Аутлайн: Erasing other agents' memory - Допустим there is agent - И there is agent - Если I erase agent 's memory - @ I erase agent 's memory - То there should be agent - Но there should not be agent - - Значения: - | agent1 | agent2 | - | D | M | -GHERKIN -, << - И there is agent - Если I erase agent 's memory - @ I erase agent 's memory - То there should be agent - Но there should not be agent - - Значения: - | agent1 | agent2 | - | D | M | - - Аутлайн: Erasing other agents' memory - Допустим there is agent - И there is agent - Если I erase agent 's memory - @ I erase agent 's memory - То there should be agent - Но there should not be agent - - Значения: - | agent1 | agent2 | - | D | M | -GHERKIN - ); - - $this->assertEquals($etalon, $dumped); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php deleted file mode 100644 index 92abdd0..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php +++ /dev/null @@ -1,147 +0,0 @@ -getKeywords(); - $lexer = new Lexer($keywords); - $parser = new Parser($lexer); - $dumper = new KeywordsDumper($keywords); - - $data = array(); - foreach ($this->getKeywordsArray() as $lang => $i18nKeywords) { - $features = array(); - foreach (explode('|', $i18nKeywords['feature']) as $transNum => $featureKeyword) { - $line = 1; - if ('en' !== $lang) { - $line = 2; - } - - $feature = new Node\FeatureNode( - 'Internal operations', - <<setLanguage($lang); - $feature->setKeyword($featureKeyword); - $line += 5; - - $background = new Node\BackgroundNode(null, $line); - $keywords = explode('|', $i18nKeywords['background']); - $background->setKeyword($keywords[0]); - $line += 1; - - $line = $this->addSteps( - $background, $i18nKeywords['given'], 'there is agent A', $line - ); - $line = $this->addSteps( - $background, $i18nKeywords['and'], 'there is agent B', $line - ); - $feature->setBackground($background); - $line += 1; - - foreach (explode('|', $i18nKeywords['scenario']) as $scenarioKeyword) { - $scenario = new Node\ScenarioNode('Erasing agent memory', $line); - $scenario->setKeyword($scenarioKeyword); - $line += 1; - - $line = $this->addSteps( - $scenario, $i18nKeywords['given'], 'there is agent J', $line - ); - $line = $this->addSteps( - $scenario, $i18nKeywords['and'], 'there is agent K', $line - ); - $line = $this->addSteps( - $scenario, $i18nKeywords['when'], 'I erase agent K\'s memory', $line - ); - $line = $this->addSteps( - $scenario, $i18nKeywords['then'], 'there should be agent J', $line - ); - $line = $this->addSteps( - $scenario, $i18nKeywords['but'], 'there should not be agent K', $line - ); - $feature->addScenario($scenario); - $line += 1; - } - - foreach (explode('|', $i18nKeywords['scenario_outline']) as $outlineKeyword) { - $outline = new Node\OutlineNode('Erasing other agents\' memory', $line); - $outline->setKeyword($outlineKeyword); - $line += 1; - - $line = $this->addSteps( - $outline, $i18nKeywords['given'], 'there is agent ', $line - ); - $line = $this->addSteps( - $outline, $i18nKeywords['and'], 'there is agent ', $line - ); - $line = $this->addSteps( - $outline, $i18nKeywords['when'], 'I erase agent \'s memory', $line - ); - $line = $this->addSteps( - $outline, $i18nKeywords['then'], 'there should be agent ', $line - ); - $line = $this->addSteps( - $outline, $i18nKeywords['but'], 'there should not be agent ', $line - ); - $line += 1; - - $examples = new Node\TableNode(); - $examples->addRow(' | agent1 | agent2 |', ++$line); - $examples->addRow(' | D | M |', ++$line); - $outline->setExamples($examples); - $keywords = explode('|', $i18nKeywords['examples']); - $examples->setKeyword($keywords[0]); - $line += 1; - - $feature->addScenario($outline); - $line += 1; - } - - $features[] = $feature; - } - - $dumped = $dumper->dump($lang, false); - $parsed = array(); - try { - foreach ($dumped as $num => $dumpedFeature) { - $parsed[] = $parser->parse($dumpedFeature, $lang.'_'.($num+1).'.feature'); - } - } catch (\Exception $e) { - throw new \Exception( - $e->getMessage().":\n".$dumped, 0, $e - ); - } - - $data[] = array($lang, $features, $parsed); - } - - return $data; - } - - /** - * @dataProvider translationTestDataProvider - * - * @param string $language language name - * @param array $etalon etalon features (to test against) - * @param array $features array of parsed feature(s) - */ - public function testTranslation($language, array $etalon, array $features) - { - $this->assertEquals($etalon, $features); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/SymfonyTranslationKeywordsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/SymfonyTranslationKeywordsTest.php deleted file mode 100644 index fb005a0..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/SymfonyTranslationKeywordsTest.php +++ /dev/null @@ -1,165 +0,0 @@ -getTranslator(); - $parser = $this->getParser(); - - $finder = new Finder(); - $i18ns = $finder->files()->name('*.xliff')->in(__DIR__ . '/../Fixtures/i18n'); - - foreach ($i18ns as $i18n) { - $language = basename($i18n, '.xliff'); - $translator->addResource('xliff', $i18n, $language, 'gherkin'); - - $etalon = array(); - $features = array(); - foreach ($this->getTranslatedKeywords('Feature', $language) as $featureNum => $featureKeyword) { - $gherkin = "# language: $language"; - $lineNum = 1; - - $feature = new Node\FeatureNode(null, null, null, ++$lineNum); - $feature->setLanguage($language); - $feature->setKeyword($featureKeyword); - $feature->setTitle($title = "title of the feature N$featureNum"); - $feature->setDescription($description = "some\nfeature\ndescription"); - - $gherkin .= "\n$featureKeyword: $title"; - $gherkin .= "\n$description"; - $lineNum += 3; - - $stepKeywords = $this->getTranslatedKeywords('Given|When|Then|And|But', $language); - $backgroundKeywords = $this->getTranslatedKeywords('Background', $language); - $examplesKeywords = $this->getTranslatedKeywords('Examples', $language); - - // Background - $backgroundKeyword = $backgroundKeywords[0]; - $background = new Node\BackgroundNode(null, ++$lineNum); - $background->setKeyword($backgroundKeyword); - $feature->setBackground($background); - - $gherkin .= "\n$backgroundKeyword:"; - - foreach ($stepKeywords as $stepNum => $stepKeyword) { - $step = new Node\StepNode($stepKeyword, $text = "text of the step N$stepNum", ++$lineNum); - $background->addStep($step); - - $gherkin .= "\n$stepKeyword $text"; - } - - // Scenarios - foreach ($this->getTranslatedKeywords('Scenario', $language) as $scenarioNum => $scenarioKeyword) { - $scenario = new Node\ScenarioNode($title = "title of the scenario N$scenarioNum", ++$lineNum); - $scenario->setKeyword($scenarioKeyword); - $feature->addScenario($scenario); - - $gherkin .= "\n$scenarioKeyword: $title"; - - foreach ($stepKeywords as $stepNum => $stepKeyword) { - $step = new Node\StepNode($stepKeyword, $text = "text of the step N$stepNum", ++$lineNum); - $scenario->addStep($step); - - $gherkin .= "\n$stepKeyword $text"; - } - } - - // Scenario Outlines - foreach ($this->getTranslatedKeywords('Scenario Outline', $language) as $outlineNum => $outlineKeyword) { - $outline = new Node\OutlineNode($title = "title of the outline N$outlineNum", ++$lineNum); - $outline->setKeyword($outlineKeyword); - $feature->addScenario($outline); - - $gherkin .= "\n$outlineKeyword: $title"; - - $stepKeyword = $stepKeywords[0]; - $step = new Node\StepNode($stepKeyword, $text = "text of the step ", ++$lineNum); - $outline->addStep($step); - - $gherkin .= "\n$stepKeyword $text"; - - $examplesKeyword = $examplesKeywords[0]; - $examples = new Node\TableNode(); - $examples->setKeyword($examplesKeyword); - $lineNum += 1; - - $examples->addRow(array('num'), ++$lineNum); - $examples->addRow(array(2), ++$lineNum); - $outline->setExamples($examples); - - $gherkin .= "\n$examplesKeyword:"; - $gherkin .= "\n | num |"; - $gherkin .= "\n | 2 |"; - } - - $etalon[] = $feature; - $features[] = $this->getParser()->parse($gherkin); - } - - $data[] = array($language, $etalon, $features); - } - - return $data; - } - - /** - * @dataProvider translationTestDataProvider - * - * @param string $language language name - * @param array $etalon etalon features (to test against) - * @param array $features array of parsed feature(s) - */ - public function testTranslation($language, array $etalon, array $features) - { - $this->assertEquals($etalon, $features); - } - - protected function getParser() - { - if (null === $this->parser) { - $keywords = new SymfonyTranslationKeywords($this->getTranslator()); - $lexer = new Lexer($keywords); - $this->parser = new Parser($lexer); - } - - return $this->parser; - } - - protected function getTranslator() - { - if (null === $this->translator) { - $this->translator = new Translator(null, new MessageSelector()); - $this->translator->addLoader('xliff', new XliffFileLoader()); - } - - return $this->translator; - } - - protected function getTranslatedKeywords($keyword, $language) - { - return explode('|', $this->translate($keyword, $language)); - } - - protected function translate($keyword, $language) - { - return $this->getTranslator()->trans($keyword, array(), 'gherkin', $language); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/ArrayLoaderTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/ArrayLoaderTest.php deleted file mode 100644 index 92da6dd..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/ArrayLoaderTest.php +++ /dev/null @@ -1,361 +0,0 @@ -loader = new ArrayLoader(); - } - - public function testSupports() - { - $this->assertFalse($this->loader->supports(__DIR__)); - $this->assertFalse($this->loader->supports(__FILE__)); - $this->assertFalse($this->loader->supports('string')); - $this->assertFalse($this->loader->supports(array('wrong_root'))); - $this->assertFalse($this->loader->supports(array('features'))); - $this->assertTrue($this->loader->supports(array('features' => array()))); - $this->assertTrue($this->loader->supports(array('feature' => array()))); - } - - public function testLoadEmpty() - { - $this->assertEquals(array(), $this->loader->load(array('features' => array()))); - } - - public function testLoadFeatures() - { - $features = $this->loader->load(array( - 'features' => array( - array( - 'title' => 'First feature', - 'line' => 3, - ), - array( - 'description' => 'Second feature description', - 'language' => 'ru', - 'tags' => array('some', 'tags') - ) - ), - )); - - $this->assertEquals(2, count($features)); - - $this->assertEquals(3, $features[0]->getLine()); - $this->assertEquals('First feature', $features[0]->getTitle()); - $this->assertNull($features[0]->getDescription()); - $this->assertNull($features[0]->getFile()); - $this->assertEquals('en', $features[0]->getLanguage()); - $this->assertFalse($features[0]->hasTags()); - - $this->assertEquals(1, $features[1]->getLine()); - $this->assertNull($features[1]->getTitle()); - $this->assertEquals('Second feature description', $features[1]->getDescription()); - $this->assertNull($features[1]->getFile()); - $this->assertEquals('ru', $features[1]->getLanguage()); - $this->assertEquals(array('some', 'tags'), $features[1]->getTags()); - } - - public function testLoadScenarios() - { - $features = $this->loader->load(array( - 'features' => array( - array( - 'title' => 'Feature', - 'scenarios' => array( - array( - 'title' => 'First scenario', - 'line' => 2 - ), - array( - 'tags' => array('second', 'scenario', 'tags') - ), - array( - 'tags' => array('third', 'scenario'), - 'line' => 3 - ) - ) - ) - ), - )); - - $this->assertEquals(1, count($features)); - - $scenarios = $features[0]->getScenarios(); - - $this->assertEquals(3, count($scenarios)); - - $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[0]); - $this->assertEquals('First scenario', $scenarios[0]->getTitle()); - $this->assertFalse($scenarios[0]->hasTags()); - $this->assertEquals(2, $scenarios[0]->getLine()); - - $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[1]); - $this->assertNull($scenarios[1]->getTitle()); - $this->assertEquals(array('second', 'scenario', 'tags'), $scenarios[1]->getTags()); - $this->assertEquals(1, $scenarios[1]->getLine()); - - $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[2]); - $this->assertNull($scenarios[2]->getTitle()); - $this->assertEquals(array('third', 'scenario'), $scenarios[2]->getTags()); - $this->assertEquals(3, $scenarios[2]->getLine()); - } - - public function testLoadOutline() - { - $features = $this->loader->load(array( - 'features' => array( - array( - 'title' => 'Feature', - 'scenarios' => array( - array( - 'type' => 'outline', - 'title' => 'First outline', - 'line' => 2 - ), - array( - 'type' => 'outline', - 'tags' => array('second', 'outline', 'tags') - ) - ) - ) - ), - )); - - $this->assertEquals(1, count($features)); - - $outlines = $features[0]->getScenarios(); - - $this->assertEquals(2, count($outlines)); - - $this->assertInstanceOf('Behat\Gherkin\Node\OutlineNode', $outlines[0]); - $this->assertEquals('First outline', $outlines[0]->getTitle()); - $this->assertFalse($outlines[0]->hasTags()); - $this->assertEquals(2, $outlines[0]->getLine()); - - $this->assertInstanceOf('Behat\Gherkin\Node\OutlineNode', $outlines[1]); - $this->assertNull($outlines[1]->getTitle()); - $this->assertEquals(array('second', 'outline', 'tags'), $outlines[1]->getTags()); - $this->assertEquals(1, $outlines[1]->getLine()); - } - - public function testOutlineExamples() - { - $features = $this->loader->load(array( - 'features' => array( - array( - 'title' => 'Feature', - 'scenarios' => array( - array( - 'type' => 'outline', - 'title' => 'First outline', - 'line' => 2, - 'examples' => array( - array('user', 'pass'), - array('ever', 'sdsd'), - array('anto', 'fdfd') - ) - ), - array( - 'type' => 'outline', - 'tags' => array('second', 'outline', 'tags') - ) - ) - ) - ), - )); - - $this->assertEquals(1, count($features)); - - $scenarios = $features[0]->getScenarios(); - $scenario = $scenarios[0]; - - $this->assertEquals( - array(array('user' => 'ever', 'pass' => 'sdsd'), array('user' => 'anto', 'pass' => 'fdfd')), - $scenario->getExamples()->getHash() - ); - } - - public function testLoadBackground() - { - $features = $this->loader->load(array( - 'features' => array( - array( - ), - array( - 'background' => array() - ), - array( - 'background' => array( - 'line' => 2 - ) - ), - ) - )); - - $this->assertEquals(3, count($features)); - - $this->assertFalse($features[0]->hasBackground()); - $this->assertTrue($features[1]->hasBackground()); - $this->assertEquals(0, $features[1]->getBackground()->getLine()); - $this->assertTrue($features[2]->hasBackground()); - $this->assertEquals(2, $features[2]->getBackground()->getLine()); - } - - public function testLoadSteps() - { - $features = $this->loader->load(array( - 'features' => array( - array( - 'background' => array( - 'steps' => array( - array('type' => 'Given', 'text' => 'bg step 1', 'line' => 3), - array('type' => 'When', 'text' => 'bg step 2') - ) - ), - 'scenarios' => array( - array( - 'title' => 'Scenario', - 'steps' => array( - array('type' => 'Given', 'text' => 'sc step 1'), - array('type' => 'When', 'text' => 'sc step 2') - ) - ), - array( - 'title' => 'Outline', - 'type' => 'outline', - 'steps' => array( - array('type' => 'Given', 'text' => 'out step 1'), - array('type' => 'When', 'text' => 'out step 2') - ) - ) - ) - ) - ) - )); - - $background = $features[0]->getBackground(); - $this->assertTrue($background->hasSteps()); - $this->assertEquals(2, count($background->getSteps())); - $steps = $background->getSteps(); - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('bg step 1', $steps[0]->getText()); - $this->assertEquals(3, $steps[0]->getLine()); - $this->assertEquals('When', $steps[1]->getType()); - $this->assertEquals('bg step 2', $steps[1]->getText()); - $this->assertEquals(1, $steps[1]->getLine()); - - $scenarios = $features[0]->getScenarios(); - - $scenario = $scenarios[0]; - $this->assertTrue($scenario->hasSteps()); - $this->assertEquals(2, count($scenario->getSteps())); - $steps = $scenario->getSteps(); - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('sc step 1', $steps[0]->getText()); - $this->assertEquals(0, $steps[0]->getLine()); - $this->assertEquals('When', $steps[1]->getType()); - $this->assertEquals('sc step 2', $steps[1]->getText()); - $this->assertEquals(1, $steps[1]->getLine()); - - $outline = $scenarios[1]; - $this->assertTrue($outline->hasSteps()); - $this->assertEquals(2, count($outline->getSteps())); - $steps = $outline->getSteps(); - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('out step 1', $steps[0]->getText()); - $this->assertEquals(0, $steps[0]->getLine()); - $this->assertEquals('When', $steps[1]->getType()); - $this->assertEquals('out step 2', $steps[1]->getText()); - $this->assertEquals(1, $steps[1]->getLine()); - } - - public function testLoadStepArguments() - { - $features = $this->loader->load(array( - 'features' => array( - array( - 'background' => array( - 'steps' => array( - array( - 'type' => 'Given', 'text' => 'step with table argument', - 'arguments' => array( - array( - 'type' => 'table', - 'rows' => array( - array('key', 'val'), - array(1, 2), - array(3, 4) - ) - ) - ) - ), - array( - 'type' => 'When', 'text' => 'step with pystring argument', - 'arguments' => array( - array( - 'type' => 'pystring', - 'text' => ' some text', - ) - ) - ), - array( - 'type' => 'Then', 'text' => '2nd step with pystring argument', - 'arguments' => array( - array( - 'type' => 'pystring', - 'text' => 'some text', - ) - ) - ) - ) - ) - ) - ) - )); - - $background = $features[0]->getBackground(); - - $this->assertTrue($background->hasSteps()); - - $steps = $background->getSteps(); - - $this->assertEquals(3, count($steps)); - - $arguments = $steps[0]->getArguments(); - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('step with table argument', $steps[0]->getText()); - $this->assertInstanceOf('Behat\Gherkin\Node\TableNode', $arguments[0]); - $this->assertEquals(array(array('key'=>1, 'val'=>2), array('key'=>3,'val'=>4)), $arguments[0]->getHash()); - - $arguments = $steps[1]->getArguments(); - $this->assertEquals('When', $steps[1]->getType()); - $this->assertEquals('step with pystring argument', $steps[1]->getText()); - $this->assertInstanceOf('Behat\Gherkin\Node\PyStringNode', $arguments[0]); - $this->assertEquals(' some text', (string) $arguments[0]); - - $arguments = $steps[2]->getArguments(); - $this->assertEquals('Then', $steps[2]->getType()); - $this->assertEquals('2nd step with pystring argument', $steps[2]->getText()); - $this->assertInstanceOf('Behat\Gherkin\Node\PyStringNode', $arguments[0]); - $this->assertEquals('some text', (string) $arguments[0]); - } - - public function testSingleFeatureArray() - { - $features = $this->loader->load(array( - 'feature' => array( - 'title' => 'Some feature' - ) - )); - - $this->assertEquals(1, count($features)); - $this->assertEquals('Some feature', $features[0]->getTitle()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php deleted file mode 100644 index de32708..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php +++ /dev/null @@ -1,92 +0,0 @@ -gherkin = $this->createGherkinMock(); - $this->loader = new DirectoryLoader($this->gherkin); - - $this->featuresPath = realpath(__DIR__ . '/../Fixtures/directories'); - } - - protected function createGherkinMock() - { - $gherkin = $this->getMockBuilder('Behat\Gherkin\Gherkin') - ->disableOriginalConstructor() - ->getMock(); - - return $gherkin; - } - - protected function createGherkinFileLoaderMock() - { - $loader = $this->getMockBuilder('Behat\Gherkin\Loader\GherkinFileLoader') - ->disableOriginalConstructor() - ->getMock(); - - return $loader; - } - - public function testSupports() - { - $this->assertFalse($this->loader->supports('non-existent path')); - $this->assertFalse($this->loader->supports('non-existent path:2')); - - $this->assertFalse($this->loader->supports(__DIR__ . ':d')); - $this->assertFalse($this->loader->supports(__DIR__ . '/../Fixtures/features/pystring.feature')); - $this->assertTrue($this->loader->supports(__DIR__)); - $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/features')); - } - - public function testUndefinedFileLoad() - { - $this->gherkin - ->expects($this->once()) - ->method('resolveLoader') - ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') - ->will($this->returnValue(null)); - - $this->assertEquals(array(), $this->loader->load($this->featuresPath . '/phps')); - } - - public function testBasePath() - { - $this->gherkin - ->expects($this->once()) - ->method('resolveLoader') - ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') - ->will($this->returnValue(null)); - - $this->loader->setBasePath($this->featuresPath); - - $this->assertEquals(array(), $this->loader->load('phps')); - } - - public function testDefinedFileLoad() - { - $loaderMock = $this->createGherkinFileLoaderMock(); - - $this->gherkin - ->expects($this->once()) - ->method('resolveLoader') - ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') - ->will($this->returnValue($loaderMock)); - - $loaderMock - ->expects($this->once()) - ->method('load') - ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') - ->will($this->returnValue(array('feature1', 'feature2'))); - - $this->assertEquals(array('feature1', 'feature2'), $this->loader->load($this->featuresPath . '/phps')); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/GherkinFileLoaderTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/GherkinFileLoaderTest.php deleted file mode 100644 index a11fa02..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/GherkinFileLoaderTest.php +++ /dev/null @@ -1,119 +0,0 @@ -loader = new GherkinFileLoader($parser); - - $translator->addLoader('xliff', new XliffFileLoader()); - $translator->addResource('xliff', __DIR__ . '/../../../../i18n/en.xliff', 'gherkin'); - $translator->addResource('xliff', __DIR__ . '/../../../../i18n/ru.xliff', 'gherkin'); - - $this->featuresPath = realpath(__DIR__ . '/../Fixtures/features'); - } - - public function testSupports() - { - $this->assertFalse($this->loader->supports('non-existent path')); - $this->assertFalse($this->loader->supports('non-existent path:2')); - - $this->assertFalse($this->loader->supports(__DIR__)); - $this->assertFalse($this->loader->supports(__DIR__ . ':d')); - $this->assertFalse($this->loader->supports(__FILE__)); - $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/features/pystring.feature')); - } - - public function testLoad() - { - $features = $this->loader->load($this->featuresPath . '/pystring.feature'); - $this->assertEquals(1, count($features)); - $this->assertEquals('A py string feature', $features[0]->getTitle()); - $this->assertEquals($this->featuresPath.DIRECTORY_SEPARATOR.'pystring.feature', $features[0]->getFile()); - - $features = $this->loader->load($this->featuresPath . '/multiline_name.feature'); - $this->assertEquals(1, count($features)); - $this->assertEquals('multiline', $features[0]->getTitle()); - $this->assertEquals($this->featuresPath.DIRECTORY_SEPARATOR.'multiline_name.feature', $features[0]->getFile()); - } - - public function testParsingUncachedFeature() - { - $cache = $this->getMockBuilder('Behat\Gherkin\Cache\CacheInterface')->getMock(); - $this->loader->setCache($cache); - - $cache->expects($this->once()) - ->method('isFresh') - ->with($path = $this->featuresPath.'/pystring.feature', filemtime($path)) - ->will($this->returnValue(false)); - - $cache->expects($this->once()) - ->method('write'); - - $features = $this->loader->load($this->featuresPath . '/pystring.feature'); - $this->assertEquals(1, count($features)); - } - - public function testParsingCachedFeature() - { - $cache = $this->getMockBuilder('Behat\Gherkin\Cache\CacheInterface')->getMock(); - $this->loader->setCache($cache); - - $cache->expects($this->once()) - ->method('isFresh') - ->with($path = $this->featuresPath.'/pystring.feature', filemtime($path)) - ->will($this->returnValue(true)); - - $cache->expects($this->once()) - ->method('read') - ->with($path) - ->will($this->returnValue('cache')); - - $cache->expects($this->never()) - ->method('write'); - - $features = $this->loader->load($this->featuresPath . '/pystring.feature'); - $this->assertEquals('cache', $features[0]); - } - - public function testBasePath() - { - $this->assertFalse($this->loader->supports('features')); - $this->assertFalse($this->loader->supports('tables.feature')); - - $this->loader->setBasePath($this->featuresPath . '/../'); - $this->assertFalse($this->loader->supports('features')); - $this->assertFalse($this->loader->supports('tables.feature')); - $this->assertTrue($this->loader->supports('features/tables.feature')); - - $features = $this->loader->load('features/pystring.feature'); - $this->assertEquals(1, count($features)); - $this->assertEquals('A py string feature', $features[0]->getTitle()); - $this->assertEquals('features'.DIRECTORY_SEPARATOR.'pystring.feature', $features[0]->getFile()); - - $this->loader->setBasePath($this->featuresPath); - $features = $this->loader->load('multiline_name.feature'); - $this->assertEquals(1, count($features)); - $this->assertEquals('multiline', $features[0]->getTitle()); - $this->assertEquals('multiline_name.feature', $features[0]->getFile()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/YamlFileLoaderTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/YamlFileLoaderTest.php deleted file mode 100644 index 9d2fded..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/YamlFileLoaderTest.php +++ /dev/null @@ -1,63 +0,0 @@ -loader = new YamlFileLoader(); - } - - public function testSupports() - { - $this->assertFalse($this->loader->supports(__DIR__)); - $this->assertFalse($this->loader->supports(__FILE__)); - $this->assertFalse($this->loader->supports('string')); - $this->assertFalse($this->loader->supports(__DIR__ . '/file.yml')); - $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/etalons/addition.yml')); - } - - public function testLoadAddition() - { - $this->loader->setBasePath(__DIR__ . '/../Fixtures'); - $features = $this->loader->load('etalons/addition.yml'); - - $this->assertEquals(1, count($features)); - $this->assertEquals('etalons'.DIRECTORY_SEPARATOR.'addition.yml', $features[0]->getFile()); - $this->assertEquals('Addition', $features[0]->getTitle()); - $this->assertEquals(2, $features[0]->getLine()); - $this->assertEquals('en', $features[0]->getLanguage()); - $this->assertEquals(<<getDescription()); - - $scenarios = $features[0]->getScenarios(); - - $this->assertEquals(2, count($scenarios)); - $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[0]); - $this->assertEquals(7, $scenarios[0]->getLine()); - $this->assertEquals('Add two numbers', $scenarios[0]->getTitle()); - $steps = $scenarios[0]->getSteps(); - $this->assertEquals(4, count($steps)); - $this->assertEquals(9, $steps[1]->getLine()); - $this->assertEquals('And', $steps[1]->getType()); - $this->assertEquals('I have entered 12 into the calculator', $steps[1]->getText()); - - $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[1]); - $this->assertEquals(13, $scenarios[1]->getLine()); - $this->assertEquals('Div two numbers', $scenarios[1]->getTitle()); - $steps = $scenarios[1]->getSteps(); - $this->assertEquals(4, count($steps)); - $this->assertEquals(16, $steps[2]->getLine()); - $this->assertEquals('When', $steps[2]->getType()); - $this->assertEquals('I press div', $steps[2]->getText()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/BackgroundNodeTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Node/BackgroundNodeTest.php deleted file mode 100644 index 7daa26e..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/BackgroundNodeTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertEquals(0, $background->getLine()); - - $background = new BackgroundNode(null, 23); - $this->assertEquals(23, $background->getLine()); - } - - public function testSteps() - { - $background = new BackgroundNode(); - $this->assertEquals(0, count($background->getSteps())); - $this->assertFalse($background->hasSteps()); - - $background->addStep(new StepNode('Given', 'Something')); - $this->assertEquals(1, count($background->getSteps())); - $this->assertTrue($background->hasSteps()); - - $background->addStep(new StepNode('Then', 'Do')); - $this->assertEquals(2, count($background->getSteps())); - $this->assertTrue($background->hasSteps()); - - $steps = $background->getSteps(); - $this->assertInstanceOf('Behat\Gherkin\Node\StepNode', $steps[0]); - - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('Something', $steps[0]->getText()); - $this->assertSame($background, $steps[0]->getParent()); - - $this->assertEquals('Then', $steps[1]->getType()); - $this->assertEquals('Do', $steps[1]->getText()); - $this->assertSame($background, $steps[1]->getParent()); - } - - public function testFeature() - { - $background = new BackgroundNode(); - $this->assertNull($background->getFeature()); - - $background->setFeature($feature = new FeatureNode()); - $this->assertSame($feature, $background->getFeature()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/FeatureNodeTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Node/FeatureNodeTest.php deleted file mode 100644 index 2102573..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/FeatureNodeTest.php +++ /dev/null @@ -1,113 +0,0 @@ -assertNull($feature->getTitle()); - - $feature->setTitle('test title 1'); - $this->assertEquals('test title 1', $feature->getTitle()); - - $feature = new FeatureNode('test title 2'); - $this->assertEquals('test title 2', $feature->getTitle()); - } - - public function testDescription() - { - $feature = new FeatureNode(); - $this->assertNull($feature->getDescription()); - - $feature->setDescription('test description 1'); - $this->assertEquals('test description 1', $feature->getDescription()); - - $feature = new FeatureNode(null, 'test description 2'); - $this->assertEquals('test description 2', $feature->getDescription()); - } - - public function testLanguage() - { - $feature = new FeatureNode(); - $this->assertEquals('en', $feature->getLanguage()); - - $feature->setLanguage('ru'); - $this->assertEquals('ru', $feature->getLanguage()); - } - - public function testBackground() - { - $feature = new FeatureNode(); - $this->assertNull($feature->getBackground()); - $this->assertFalse($feature->hasBackground()); - - $feature->setBackground($background = new BackgroundNode()); - $this->assertSame($feature, $feature->getBackground()->getFeature()); - $this->assertSame($background, $feature->getBackground()); - $this->assertTrue($feature->hasBackground()); - } - - public function testFile() - { - $feature = new FeatureNode(); - $this->assertNull($feature->getFile()); - - $feature = new FeatureNode(null, null, 'path/to/file_2'); - $this->assertEquals('path/to/file_2', $feature->getFile()); - } - - public function testLine() - { - $feature = new FeatureNode(); - $this->assertEquals(0, $feature->getLine()); - - $feature = new FeatureNode(null, null, null, 23); - $this->assertEquals(23, $feature->getLine()); - } - - public function testScenarios() - { - $feature = new FeatureNode(); - $this->assertEquals(0, count($feature->getScenarios())); - $this->assertFalse($feature->hasScenarios()); - - $feature->addScenario(new ScenarioNode()); - $this->assertEquals(1, count($feature->getScenarios())); - $this->assertTrue($feature->hasScenarios()); - - $feature->addScenario(new OutlineNode()); - $this->assertEquals(2, count($feature->getScenarios())); - $this->assertTrue($feature->hasScenarios()); - - $scenarios = $feature->getScenarios(); - $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[0]); - $this->assertSame($feature, $scenarios[0]->getFeature()); - $this->assertInstanceOf('Behat\Gherkin\Node\OutlineNode', $scenarios[1]); - $this->assertSame($feature, $scenarios[1]->getFeature()); - } - - public function testTags() - { - $feature = new FeatureNode(); - $this->assertFalse($feature->hasTags()); - $this->assertInternalType('array', $feature->getTags()); - $this->assertEquals(0, count($feature->getTags())); - - $feature->setTags($tags = array('tag1', 'tag2')); - $this->assertEquals($tags, $feature->getTags()); - - $feature->addTag('tag3'); - $this->assertEquals(array('tag1', 'tag2', 'tag3'), $feature->getTags()); - - $this->assertFalse($feature->hasTag('tag4')); - $this->assertTrue($feature->hasTag('tag2')); - $this->assertTrue($feature->hasTag('tag3')); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/OutlineNodeTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Node/OutlineNodeTest.php deleted file mode 100644 index d0bf5b7..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/OutlineNodeTest.php +++ /dev/null @@ -1,96 +0,0 @@ -assertNull($outline->getTitle()); - - $outline->setTitle('test title 1'); - $this->assertEquals('test title 1', $outline->getTitle()); - - $outline = new OutlineNode('test title 2'); - $this->assertEquals('test title 2', $outline->getTitle()); - } - - public function testLine() - { - $outline = new OutlineNode(); - $this->assertEquals(0, $outline->getLine()); - - $outline = new OutlineNode(null, 23); - $this->assertEquals(23, $outline->getLine()); - } - - public function testExamples() - { - $outline = new OutlineNode(); - $this->assertNull($outline->getExamples()); - $this->assertFalse($outline->hasExamples()); - - $outline->setExamples($table = new TableNode()); - $this->assertSame($table, $outline->getExamples()); - $this->assertTrue($outline->hasExamples()); - } - - public function testSteps() - { - $outline = new OutlineNode(); - $this->assertEquals(0, count($outline->getSteps())); - $this->assertFalse($outline->hasSteps()); - - $outline->addStep(new StepNode('Given', 'Something')); - $this->assertEquals(1, count($outline->getSteps())); - $this->assertTrue($outline->hasSteps()); - - $outline->addStep(new StepNode('Then', 'Do')); - $this->assertEquals(2, count($outline->getSteps())); - $this->assertTrue($outline->hasSteps()); - - $steps = $outline->getSteps(); - $this->assertInstanceOf('Behat\Gherkin\Node\StepNode', $steps[0]); - - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('Something', $steps[0]->getText()); - $this->assertSame($outline, $steps[0]->getParent()); - - $this->assertEquals('Then', $steps[1]->getType()); - $this->assertEquals('Do', $steps[1]->getText()); - $this->assertSame($outline, $steps[1]->getParent()); - } - - public function testFeature() - { - $outline = new OutlineNode(); - $this->assertNull($outline->getFeature()); - - $outline->setFeature($feature = new FeatureNode()); - $this->assertSame($feature, $outline->getFeature()); - } - - public function testTags() - { - $outline = new OutlineNode(); - $this->assertFalse($outline->hasTags()); - $this->assertInternalType('array', $outline->getTags()); - $this->assertEquals(0, count($outline->getTags())); - - $outline->setTags($tags = array('tag1', 'tag2')); - $this->assertEquals($tags, $outline->getTags()); - - $outline->addTag('tag3'); - $this->assertEquals(array('tag1', 'tag2', 'tag3'), $outline->getTags()); - - $this->assertFalse($outline->hasTag('tag4')); - $this->assertTrue($outline->hasTag('tag2')); - $this->assertTrue($outline->hasTag('tag3')); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/PyStringNodeTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Node/PyStringNodeTest.php deleted file mode 100644 index ea0ad1f..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/PyStringNodeTest.php +++ /dev/null @@ -1,88 +0,0 @@ -assertEquals(<<assertEquals(<<addLine('Hello,'); - $string->addLine(' Gherkin'); - $string->addLine(' users'); - $string->addLine(' =)'); - - $this->assertEquals(<<addLine('Hello, '); - $string->addLine('everything is ?'); - - $string1 = $string->createExampleRowStepArgument(array('username'=>'John', 'status'=>'ok')); - $this->assertNotSame($string, $string1); - $this->assertSame(<<createExampleRowStepArgument(array('username'=>'Mike', 'status'=>'bad')); - $this->assertNotSame($string, $string2); - $this->assertSame(<<assertNull($scenario->getTitle()); - - $scenario->setTitle('test title 1'); - $this->assertEquals('test title 1', $scenario->getTitle()); - - $scenario = new ScenarioNode('test title 2'); - $this->assertEquals('test title 2', $scenario->getTitle()); - } - - public function testLine() - { - $scenario = new ScenarioNode(); - $this->assertEquals(0, $scenario->getLine()); - - $scenario = new ScenarioNode(null, 23); - $this->assertEquals(23, $scenario->getLine()); - } - - public function testSteps() - { - $scenario = new ScenarioNode(); - $this->assertEquals(0, count($scenario->getSteps())); - $this->assertFalse($scenario->hasSteps()); - - $scenario->addStep(new StepNode('Given', 'Something')); - $this->assertEquals(1, count($scenario->getSteps())); - $this->assertTrue($scenario->hasSteps()); - - $scenario->addStep(new StepNode('Then', 'Do')); - $this->assertEquals(2, count($scenario->getSteps())); - $this->assertTrue($scenario->hasSteps()); - - $steps = $scenario->getSteps(); - $this->assertInstanceOf('Behat\Gherkin\Node\StepNode', $steps[0]); - - $this->assertEquals('Given', $steps[0]->getType()); - $this->assertEquals('Something', $steps[0]->getText()); - $this->assertSame($scenario, $steps[0]->getParent()); - - $this->assertEquals('Then', $steps[1]->getType()); - $this->assertEquals('Do', $steps[1]->getText()); - $this->assertSame($scenario, $steps[1]->getParent()); - } - - public function testFeature() - { - $scenario = new ScenarioNode(); - $this->assertNull($scenario->getFeature()); - - $scenario->setFeature($feature = new FeatureNode()); - $this->assertSame($feature, $scenario->getFeature()); - } - - public function testTags() - { - $scenario = new ScenarioNode(); - $this->assertFalse($scenario->hasTags()); - $this->assertInternalType('array', $scenario->getTags()); - $this->assertEquals(0, count($scenario->getTags())); - - $scenario->setTags($tags = array('tag1', 'tag2')); - $this->assertEquals($tags, $scenario->getTags()); - - $scenario->addTag('tag3'); - $this->assertEquals(array('tag1', 'tag2', 'tag3'), $scenario->getTags()); - - $this->assertFalse($scenario->hasTag('tag4')); - $this->assertTrue($scenario->hasTag('tag2')); - $this->assertTrue($scenario->hasTag('tag3')); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/StepNodeTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Node/StepNodeTest.php deleted file mode 100644 index 4181e0e..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/StepNodeTest.php +++ /dev/null @@ -1,95 +0,0 @@ -assertEquals('When', $step->getType()); - - $step->setType('Given'); - $this->assertEquals('Given', $step->getType()); - } - - public function testText() - { - $step = new StepNode('When'); - $this->assertNull($step->getText()); - - $step->setText('Some definition'); - $this->assertEquals('Some definition', $step->getText()); - - $step = new StepNode('When', 'Some action'); - $this->assertEquals('Some action', $step->getText()); - - $step->setText('Some "" in '); - $this->assertEquals('Some "" in ', $step->getText()); - } - - public function testTokens() - { - $step = new StepNode('When', 'Some "" in '); - - $scenario = new ScenarioNode(); - $scenario->addStep($step); - - $feature = new FeatureNode(); - $feature->addScenario($scenario); - $feature->freeze(); - - $step1 = $step->createExampleRowStep(array('text' => 'change')); - $this->assertNotSame($step, $step1); - $this->assertEquals('Some "change" in ', $step1->getText()); - $this->assertEquals('Some "" in ', $step1->getCleanText()); - - $step2 = $step->createExampleRowStep(array('text' => 'change', 'string' => 'browser')); - $this->assertNotSame($step, $step2); - $this->assertEquals('Some "change" in browser', $step2->getText()); - $this->assertEquals('Some "" in ', $step2->getCleanText()); - } - - public function testArguments() - { - $step = new StepNode('Given', null); - $this->assertEquals(0, count($step->getArguments())); - $this->assertFalse($step->hasArguments()); - - $step->addArgument(new PyStringNode()); - $this->assertEquals(1, count($step->getArguments())); - $this->assertTrue($step->hasArguments()); - - $step->addArgument(new TableNode()); - $this->assertEquals(2, count($step->getArguments())); - $this->assertTrue($step->hasArguments()); - - $arguments = $step->getArguments(); - $this->assertInstanceOf('Behat\Gherkin\Node\PyStringNode', $arguments[0]); - $this->assertInstanceOf('Behat\Gherkin\Node\TableNode', $arguments[1]); - } - - public function testParent() - { - $step = new StepNode('Given'); - $this->assertNull($step->getParent()); - - $step->setParent($scenario = new ScenarioNode()); - $this->assertSame($scenario, $step->getParent()); - } - - public function testLine() - { - $step = new StepNode('Given'); - $this->assertEquals(0, $step->getLine()); - - $step = new StepNode('Given', null, 23); - $this->assertEquals(23, $step->getLine()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/TableNodeTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Node/TableNodeTest.php deleted file mode 100644 index 061c8c3..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Node/TableNodeTest.php +++ /dev/null @@ -1,105 +0,0 @@ -assertEquals( - array( - array('username' => 'everzet', 'password' => 'qwerty') - , array('username' => 'antono', 'password' => 'pa$sword') - ) - , $table->getHash() - ); - - $table = new TableNode(<<
assertEquals( - array( - array('username' => '', 'password' => 'qwerty') - , array('username' => 'antono', 'password' => '') - , array('username' => '', 'password' => '') - ) - , $table->getHash() - ); - } - - public function testRowsHashTable() - { - $table = new TableNode(<<
assertEquals(array('username' => 'everzet', 'password' => 'qwerty', 'uid' => '35'), $table->getRowsHash()); - } - - public function testTableFromArrayCreation() - { - $table1 = new TableNode(); - $table1->addRow(array('username', 'password')); - $table1->addRow(array('everzet', 'qwerty')); - $table1->addRow(array('antono', 'pa$sword')); - - $table2 = new TableNode(<<
assertEquals($table2->getRows(), $table1->getRows()); - - $this->assertEquals( - array( - array('username' => 'everzet', 'password' => 'qwerty') - , array('username' => 'antono', 'password' => 'pa$sword') - ) - , $table1->getHash() - ); - - $this->assertEquals( - array('username' => 'password', 'everzet' => 'qwerty', 'antono' => 'pa$sword') - , $table2->getRowsHash() - ); - } - - public function testTokens() - { - $table = new TableNode(); - $table->addRow(array('username', 'password')); - $table->addRow(array('', '')); - - $tableCompare = new TableNode(<<
createExampleRowStepArgument(array( - 'username'=>'everzet', - 'password'=>'qwerty' - )); - $this->assertNotSame($table, $exampleTable); - $this->assertSame($tableCompare->getRows(), $exampleTable->getRows()); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/ParserExceptionsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/ParserExceptionsTest.php deleted file mode 100644 index efbc73b..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/ParserExceptionsTest.php +++ /dev/null @@ -1,273 +0,0 @@ - array( - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline', - 'examples' => 'Examples', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But' - ), - 'ru' => array( - 'feature' => 'Функционал', - 'background' => 'Предыстория', - 'scenario' => 'Сценарий', - 'scenario_outline' => 'Структура сценария', - 'examples' => 'Значения', - 'given' => 'Допустим', - 'when' => 'То', - 'then' => 'Если', - 'and' => 'И', - 'but' => 'Но' - ) - )); - $this->gherkin = new Parser(new Lexer($keywords)); - } - - public function testStepRightAfterFeature() - { - $feature = <<gherkin->parse($feature); - - $this->assertEquals("\n Given some step-like line", $parsed->getDescription()); - } - - public function testTextInBackground() - { - $feature = <<gherkin->parse($feature); - } - - public function testTextInScenario() - { - $feature = <<gherkin->parse($feature); - - $this->assertCount(2, $scenarios = $feature->getScenarios()); - $this->assertEquals(<<getTitle()); - $this->assertEquals(<<getTitle()); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testAmbigiousLanguage() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testEmptyOutline() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testWrongTagPlacement() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testBackgroundWithTag() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testEndlessPyString() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testWrongStepType() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testMultipleBackgrounds() - { - $feature = <<gherkin->parse($feature); - } - - /** - * @expectedException Behat\Gherkin\Exception\ParserException - */ - public function testMultipleFeatures() - { - $feature = <<gherkin->parse($feature); - } -} diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/ParserTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/ParserTest.php deleted file mode 100644 index c8f3815..0000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/ParserTest.php +++ /dev/null @@ -1,122 +0,0 @@ -files()->name('*.yml')->in(__DIR__ . '/Fixtures/etalons'); - - foreach ($files as $file) { - $testname = basename($file, '.yml'); - - $etalonFeature = $this->parseEtalon($testname . '.yml'); - $fixtureFeatures = $this->parseFixture($testname . '.feature'); - - $data[] = array($testname, $etalonFeature, $fixtureFeatures); - } - - return $data; - } - - /** - * @dataProvider parserTestDataProvider - * - * @param string $fixtureName name of the fixture - * @param Behat\Gherkin\Node\FeatureNode $etalon etalon feature (to test against) - * @param array $features array of parsed feature(s) - */ - public function testParser($fixtureName, $etalon, array $features) - { - $this->assertInternalType('array', $features); - $this->assertEquals(1, count($features)); - $fixture = $features[0]; - - $this->assertEquals($etalon, $fixture); - } - - protected function getGherkinParser() - { - if (null === $this->gherkin) { - $keywords = new ArrayKeywords(array( - 'en' => array( - 'feature' => 'Feature', - 'background' => 'Background', - 'scenario' => 'Scenario', - 'scenario_outline' => 'Scenario Outline', - 'examples' => 'Examples', - 'given' => 'Given', - 'when' => 'When', - 'then' => 'Then', - 'and' => 'And', - 'but' => 'But' - ), - 'ru' => array( - 'feature' => 'Функционал', - 'background' => 'Предыстория', - 'scenario' => 'Сценарий', - 'scenario_outline' => 'Структура сценария', - 'examples' => 'Значения', - 'given' => 'Допустим', - 'when' => 'То', - 'then' => 'Если', - 'and' => 'И', - 'but' => 'Но' - ), - 'ja' => array ( - 'feature' => 'フィーチャ', - 'background' => '背景', - 'scenario' => 'シナリオ', - 'scenario_outline' => 'シナリオアウトライン', - 'examples' => '例|サンプル', - 'given' => '前提<', - 'when' => 'もし<', - 'then' => 'ならば<', - 'and' => 'かつ<', - 'but' => 'しかし<' - ) - )); - $this->gherkin = new Parser(new Lexer($keywords)); - } - - return $this->gherkin; - } - - protected function getYamlParser() - { - if (null === $this->yaml) { - $this->yaml = new YamlFileLoader(); - } - - return $this->yaml; - } - - protected function parseFixture($fixture) - { - $file = __DIR__ . '/Fixtures/features/' . $fixture; - return array($this->getGherkinParser()->parse(file_get_contents($file), $file)); - } - - protected function parseEtalon($etalon) - { - $features = $this->getYamlParser()->load(__DIR__ . '/Fixtures/etalons/' . $etalon); - $feature = $features[0]; - $feature->setFile(__DIR__ . '/Fixtures/features/' . basename($etalon, '.yml') . '.feature'); - - return $feature; - } -} diff --git a/vendor/behat/mink b/vendor/behat/mink deleted file mode 160000 index f05e658..0000000 --- a/vendor/behat/mink +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f05e658f90bffaad6d077e30ab96217729953330 diff --git a/vendor/behat/mink-extension b/vendor/behat/mink-extension deleted file mode 160000 index 880fc45..0000000 --- a/vendor/behat/mink-extension +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 880fc457e056924694f7bb396842548ef2d8b3a1 diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php deleted file mode 100644 index a4a0dc5..0000000 --- a/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,207 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - private $prefixes = array(); - private $fallbackDirs = array(); - private $useIncludePath = false; - private $classMap = array(); - - public function getPrefixes() - { - return $this->prefixes; - } - - public function getFallbackDirs() - { - return $this->fallbackDirs; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of classes - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - */ - public function add($prefix, $paths) - { - if (!$prefix) { - foreach ((array) $paths as $path) { - $this->fallbackDirs[] = $path; - } - - return; - } - if (isset($this->prefixes[$prefix])) { - $this->prefixes[$prefix] = array_merge( - $this->prefixes[$prefix], - (array) $paths - ); - } else { - $this->prefixes[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - include $file; - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; - $className = substr($class, $pos + 1); - } else { - // PEAR-like class name - $classPath = null; - $className = $class; - } - - $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - foreach ($this->prefixes as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - } - } - - foreach ($this->fallbackDirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - - if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { - return $file; - } - - return $this->classMap[$class] = false; - } -} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 4a9177d..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - $baseDir . '/', - 'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml/', - 'Symfony\\Component\\Translation' => $vendorDir . '/symfony/translation/', - 'Symfony\\Component\\Finder' => $vendorDir . '/symfony/finder/', - 'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/', - 'Symfony\\Component\\DependencyInjection' => $vendorDir . '/symfony/dependency-injection/', - 'Symfony\\Component\\CssSelector' => $vendorDir . '/symfony/css-selector/', - 'Symfony\\Component\\Console' => $vendorDir . '/symfony/console/', - 'Symfony\\Component\\Config' => $vendorDir . '/symfony/config/', - 'PHPSpec2' => $vendorDir . '/phpspec/phpspec2/src/', - 'Mockery' => $vendorDir . '/mockery/mockery/library/', - 'Diff' => $vendorDir . '/phpspec/php-diff/lib/', - 'Behat\\MinkExtension' => $vendorDir . '/behat/mink-extension/src/', - 'Behat\\Mink' => $vendorDir . '/behat/mink/src/', - 'Behat\\Gherkin' => $vendorDir . '/behat/gherkin/src/', - 'Behat\\Behat' => $vendorDir . '/behat/behat/src/', - '' => $baseDir . '/src', -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index 9028b73..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,35 +0,0 @@ - $path) { - $loader->add($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(); - - return $loader; - } -} diff --git a/vendor/composer/installed_dev.json b/vendor/composer/installed_dev.json deleted file mode 100644 index 1f16ba1..0000000 --- a/vendor/composer/installed_dev.json +++ /dev/null @@ -1,795 +0,0 @@ -[ - { - "name": "phpspec/php-diff", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "8d82ac415225fac373a4073ba14b1fe286aa2312" - }, - "dist": { - "type": "zip", - "url": "https://github.com/phpspec/php-diff/archive/8d82ac415225fac373a4073ba14b1fe286aa2312.zip", - "reference": "8d82ac415225fac373a4073ba14b1fe286aa2312", - "shasum": "" - }, - "time": "2012-11-08 08:55:45", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "Diff": "lib/" - } - }, - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton" - } - ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays)." - }, - { - "name": "mockery/mockery", - "version": "0.7.2", - "version_normalized": "0.7.2.0", - "source": { - "type": "git", - "url": "git://github.com/padraic/mockery.git", - "reference": "0.7.2" - }, - "dist": { - "type": "zip", - "url": "https://github.com/padraic/mockery/zipball/0.7.2", - "reference": "0.7.2", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "suggest": { - "Hamcrest": "1.0.0" - }, - "time": "2012-01-24 12:22:39", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "license": [ - "New BSD" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", - "keywords": [ - "testing", - "library", - "BDD", - "TDD", - "test", - "mockery", - "mock", - "stub", - "test double", - "mock objects" - ] - }, - { - "name": "phpspec/phpspec2", - "version": "dev-develop", - "version_normalized": "dev-develop", - "source": { - "type": "git", - "url": "https://github.com/phpspec/phpspec2.git", - "reference": "1b96ca860acac2345a7464b719c175a86f24dcb3" - }, - "dist": { - "type": "zip", - "url": "https://github.com/phpspec/phpspec2/archive/1b96ca860acac2345a7464b719c175a86f24dcb3.zip", - "reference": "1b96ca860acac2345a7464b719c175a86f24dcb3", - "shasum": "" - }, - "require": { - "mockery/mockery": "0.7.*", - "phpspec/php-diff": "*@dev", - "php": ">=5.3.3", - "symfony/console": ">=2.1,<3.0", - "symfony/event-dispatcher": ">=2.1,<3.0", - "symfony/finder": ">=2.1,<3.0", - "symfony/yaml": ">=2.1,<3.0" - }, - "time": "2012-11-24 20:32:44", - "bin": [ - "bin/phpspec" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "1.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "PHPSpec2": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Specification-oriented BDD framework for PHP 5.3+", - "homepage": "http://phpspec.net/", - "keywords": [ - "testing", - "BDD", - "TDD", - "spec", - "tests", - "SpecBDD", - "specification" - ] - }, - { - "name": "symfony/console", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/Console", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console", - "reference": "528b030bd94d74b06735c9da9fd9495db0567800" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Console/archive/528b030bd94d74b06735c9da9fd9495db0567800.zip", - "reference": "528b030bd94d74b06735c9da9fd9495db0567800", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2012-11-09 08:52:51", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Console": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/event-dispatcher", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/EventDispatcher", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher", - "reference": "b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/EventDispatcher/archive/b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485.zip", - "reference": "b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/dependency-injection": "2.1.*" - }, - "suggest": { - "symfony/dependency-injection": "2.1.*", - "symfony/http-kernel": "2.1.*" - }, - "time": "2012-11-08 09:51:48", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/yaml", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml", - "reference": "e1aff6871fd39607d7ce638ff6b1f971cde6fe6a" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Yaml/archive/e1aff6871fd39607d7ce638ff6b1f971cde6fe6a.zip", - "reference": "e1aff6871fd39607d7ce638ff6b1f971cde6fe6a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2012-11-08 09:51:48", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/finder", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/Finder", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder", - "reference": "24e814560125249010dd08717f4d17079c061e98" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Finder/archive/24e814560125249010dd08717f4d17079c061e98.zip", - "reference": "24e814560125249010dd08717f4d17079c061e98", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2012-11-08 09:51:48", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Finder": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "http://symfony.com" - }, - { - "name": "behat/gherkin", - "version": "v2.2.5", - "version_normalized": "2.2.5.0", - "source": { - "type": "git", - "url": "git://github.com/Behat/Gherkin.git", - "reference": "v2.2.5" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/Gherkin/zipball/v2.2.5", - "reference": "v2.2.5", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/finder": ">=2.0,<2.2-dev" - }, - "require-dev": { - "symfony/yaml": ">=2.0,<2.2-dev", - "symfony/translation": ">=2.0,<2.2-dev", - "symfony/config": ">=2.0,<2.2-dev" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files", - "symfony/translation": "If you want to use Symfony2 translations adapter", - "symfony/config": "If you want to use Config component to manage resources" - }, - "time": "2012-09-26 03:03:21", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Symfony2", - "BDD", - "parser", - "DSL", - "Behat" - ] - }, - { - "name": "symfony/config", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/Config", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config", - "reference": "f12982ffa9843be853c9b61fd5a7896f00aa5fd7" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Config/archive/f12982ffa9843be853c9b61fd5a7896f00aa5fd7.zip", - "reference": "f12982ffa9843be853c9b61fd5a7896f00aa5fd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2012-11-08 09:51:48", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Config": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/dependency-injection", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/DependencyInjection", - "source": { - "type": "git", - "url": "https://github.com/symfony/DependencyInjection", - "reference": "eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/DependencyInjection/archive/eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5.zip", - "reference": "eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/yaml": "2.1.*", - "symfony/config": "2.1.*" - }, - "suggest": { - "symfony/yaml": "2.1.*", - "symfony/config": "2.1.*" - }, - "time": "2012-11-11 11:59:36", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\DependencyInjection": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/translation", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/Translation", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation", - "reference": "806431a802d237e15fe38dca0b0460d512854652" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Translation/archive/806431a802d237e15fe38dca0b0460d512854652.zip", - "reference": "806431a802d237e15fe38dca0b0460d512854652", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/config": "2.1.*", - "symfony/yaml": "2.1.*" - }, - "suggest": { - "symfony/config": "2.1.*", - "symfony/yaml": "2.1.*" - }, - "time": "2012-11-21 15:37:42", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Translation": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/css-selector", - "version": "2.1.x-dev", - "version_normalized": "2.1.9999999.9999999-dev", - "target-dir": "Symfony/Component/CssSelector", - "source": { - "type": "git", - "url": "https://github.com/symfony/CssSelector", - "reference": "abf8279792230c6685234eb0fa95b0a85e9e9c7a" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/CssSelector/archive/abf8279792230c6685234eb0fa95b0a85e9e9c7a.zip", - "reference": "abf8279792230c6685234eb0fa95b0a85e9e9c7a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2012-11-08 09:51:48", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\CssSelector": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "http://symfony.com" - }, - { - "name": "behat/mink", - "version": "dev-develop", - "version_normalized": "dev-develop", - "source": { - "type": "git", - "url": "git://github.com/Behat/Mink.git", - "reference": "f05e658f90bffaad6d077e30ab96217729953330" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/Mink/archive/f05e658f90bffaad6d077e30ab96217729953330.zip", - "reference": "f05e658f90bffaad6d077e30ab96217729953330", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": ">=2.0.0,<2.2.0-dev" - }, - "require-dev": { - "behat/mink-goutte-driver": "*", - "behat/mink-sahi-driver": "*", - "behat/mink-selenium-driver": "*", - "behat/mink-selenium2-driver": "*", - "behat/mink-zombie-driver": "*", - "symfony/finder": ">=2.0.0,<2.2.0-dev" - }, - "suggest": { - "behat/mink-goutte-driver": "to enable Goutte support", - "behat/mink-sahi-driver": "to enable Sahi.JS support", - "behat/mink-selenium-driver": "to enable Selenium1 support", - "behat/mink-selenium2-driver": "to enable Selenium2 (webdriver support)", - "behat/mink-zombie-driver": "to enable Zombie.js support" - }, - "time": "2012-11-06 01:19:22", - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "1.4.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Behat\\Mink": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Web acceptance testing framework for PHP 5.3", - "homepage": "http://mink.behat.org/", - "keywords": [ - "testing", - "browser", - "web" - ] - }, - { - "name": "behat/behat", - "version": "v2.4.4", - "version_normalized": "2.4.4.0", - "source": { - "type": "git", - "url": "git://github.com/Behat/Behat.git", - "reference": "v2.4.4" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/Behat/zipball/v2.4.4", - "reference": "v2.4.4", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "behat/gherkin": ">=2.2.4,<2.3.0-dev", - "symfony/console": ">=2.0.0,<2.2.0-dev", - "symfony/config": ">=2.0.0,<2.2.0-dev", - "symfony/dependency-injection": ">=2.0.0,<2.2.0-dev", - "symfony/event-dispatcher": ">=2.0.0,<2.2.0-dev", - "symfony/translation": ">=2.0.0,<2.2.0-dev", - "symfony/yaml": ">=2.0.0,<2.2.0-dev", - "symfony/finder": ">=2.0.0,<2.2.0-dev" - }, - "suggest": { - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework", - "behat/mink-extension": "for integration with Mink testing framework" - }, - "time": "2012-09-04 07:59:18", - "bin": [ - "bin/behat" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Behat": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Scenario-oriented BDD framework for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Symfony2", - "BDD", - "Behat" - ] - }, - { - "name": "behat/mink-extension", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "git://github.com/Behat/MinkExtension.git", - "reference": "880fc457e056924694f7bb396842548ef2d8b3a1" - }, - "dist": { - "type": "zip", - "url": "https://github.com/Behat/MinkExtension/archive/880fc457e056924694f7bb396842548ef2d8b3a1.zip", - "reference": "880fc457e056924694f7bb396842548ef2d8b3a1", - "shasum": "" - }, - "require": { - "php": ">=5.3.2", - "behat/behat": ">=2.4.0,<2.5.0", - "behat/mink": ">=1.4.0,<1.5.0" - }, - "require-dev": { - "behat/mink-goutte-driver": "*" - }, - "time": "2012-11-21 00:22:28", - "type": "behat-extension", - "installation-source": "source", - "autoload": { - "psr-0": { - "Behat\\MinkExtension": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Mink extension for Behat", - "homepage": "http://mink.behat.org", - "keywords": [ - "test", - "browser", - "web", - "gui" - ] - } -] diff --git a/vendor/mockery/mockery/.gitignore b/vendor/mockery/mockery/.gitignore deleted file mode 100644 index d7f639d..0000000 --- a/vendor/mockery/mockery/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*~ -pearfarm.spec -*.sublime-project \ No newline at end of file diff --git a/vendor/mockery/mockery/LICENSE b/vendor/mockery/mockery/LICENSE deleted file mode 100644 index 6e72c42..0000000 --- a/vendor/mockery/mockery/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, Pádraic Brady -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * The name of Pádraic Brady may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/mockery/mockery/README.markdown b/vendor/mockery/mockery/README.markdown deleted file mode 100644 index c01e96c..0000000 --- a/vendor/mockery/mockery/README.markdown +++ /dev/null @@ -1,1108 +0,0 @@ -Mockery -======== - -Mockery is a simple yet flexible PHP mock object framework for use in unit testing -with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a -test double framework with a succint API capable of clearly defining all possible -object operations and interactions using a human readable Domain Specific Language -(DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, -Mockery is easy to integrate with PHPUnit and can operate alongside -phpunit-mock-objects without the World ending. - -Mockery is released under a New BSD License. - -The current stable version is Mockery 0.7.2. - -Mock Objects ------------- - -In unit tests, mock objects simulate the behaviour of real objects. They are -commonly utilised to offer test isolation, to stand in for objects which do not -yet exist, or to allow for the exploratory design of class APIs without -requiring actual implementation up front. - -The benefits of a mock object framework are to allow for the flexible generation -of such mock objects (and stubs). They allow the setting of expected method calls -and return values using a flexible API which is capable of capturing every -possible real object behaviour in way that is stated as close as possible to a -natural language description. - -Prerequisites -------------- - -Mockery requires PHP 5.3.2 or greater. In addition, it is strongly recommended to install -the Hamcrest library (see below for instructions). - -Installation ------------- - -Mockery may be installed using Composer, PEAR or by cloning it from its Github repository. These -three options are outlined below. - -**Composer** - -You can read more about Composer and its main repository at -[http://packagist.org](http://packagist.org "Packagist"). To install -Mockery using Composer, first install Composer for your project using the instructions on the -Packagist home page. You can then define your dependency on Mockery using the suggested parameters below. - - { - "require": { - "mockery/mockery": ">=0.7.2" - } - } - -**PEAR** - -Mockery is hosted on the [survivethedeepend.com](http://pear.survivethedeepend.com) PEAR channel and -can be installed using the following commands: - - sudo pear channel-discover pear.survivethedeepend.com - sudo pear channel-discover hamcrest.googlecode.com/svn/pear - sudo pear install --alldeps deepend/Mockery - -**Git / Github** - -The git repository hosts the development version in its master branch. You may -install this development version using: - - git clone git://github.com/padraic/mockery.git - cd mockery - sudo pear channel-discover hamcrest.googlecode.com/svn/pear - sudo pear install --alldeps package.xml - -The above processes will install both Mockery and Hamcrest. -While omitting Hamcrest will not break Mockery, Hamcrest is highly recommended -as it adds a wider variety of functionality for argument matching that Mockery -is capable of. - -Simple Example --------------- - -Imagine we have a Temperature class which samples the temperature of a locale -before reporting an average temperature. The data could come from a web service -or any other data source, but we do not have such a class at present. We can, -however, assume some basic interactions with such a class based on its interaction -with the Temperature class. - - class Temperature - { - - public function __construct($service) - { - $this->_service = $service; - } - - public function average() - { - $total = 0; - for ($i=0;$i<3;$i++) { - $total += $this->_service->readTemp(); - } - return $total/3; - } - - } - -Even without an actual service class, we can see how we expect it to operate. -When writing a test for the Temperature class, we can now substitute a mock -object for the real service which allows us to test the behaviour of the -Temperature class without actually needing a concrete service instance. - -Note: PHPUnit integration (see below) can remove the need for a teardown() method. - - use \Mockery as m; - - class TemperatureTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - m::close(); - } - - public function testGetsAverageTemperatureFromThreeServiceReadings() - { - $service = m::mock('service'); - $service->shouldReceive('readTemp')->times(3)->andReturn(10, 12, 14); - $temperature = new Temperature($service); - $this->assertEquals(12, $temperature->average()); - } - - } - -We'll cover the API in greater detail below. - -PHPUnit Integration -------------------- - -Mockery was designed as a simple to use standalone mock object framework, so -its need for integration with any testing framework is entirely optional. -To integrate Mockery, you just need to define a teardown() method for your -tests containing the following (you may use a shorter \Mockery namespace alias): - - public function teardown() { - \Mockery::close(); - } - -This static call cleans up the Mockery container used by the current test, and -run any verification tasks needed for your expectations. - -For some added brevity when it comes to using Mockery, you can also explicitly -use the Mockery namespace with a shorter alias. For example: - - use \Mockery as m; - - class SimpleTest extends PHPUnit_Framework_TestCase - { - public function testSimpleMock() { - $mock = m::mock('simple mock'); - $mock->shouldReceive('foo')->with(5, m::any())->once()->andReturn(10); - $this->assertEquals(10, $mock->foo(5)); - } - - public function teardown() { - m::close(); - } - } - -Mockery ships with an autoloader so you don't need to litter your tests with -require_once() calls. To use it, ensure Mockery is on your include_path and add -the following to your test suite's Bootstrap.php or TestHelper.php file: - - require_once 'Mockery/Loader.php'; - require_once 'Hamcrest/Hamcrest.php'; - $loader = new \Mockery\Loader; - $loader->register(); - -(Note: Prior to Hamcrest 1.0.0, the Hamcrest.php file name had a small "h", i.e. hamcrest.php. If upgrading Hamcrest to 1.0.0 remember to check the file name is updated for all your projects.) - -To integrate Mockery into PHPUnit and avoid having to call the close method and -have Mockery remove itself from code coverage reports, use this in you suite: - - //Create Suite - $suite = new PHPUnit_Framework_TestSuite(); - - //Create a result listener or add it - $result = new PHPUnit_Framework_TestResult(); - $result->addListener(new \Mockery\Adapter\Phpunit\TestListener()); - - // Run the tests. - $suite->run($result); - -If you are using PHPUnit's XML configuration approach, you can include the following to load the TestListener: - - - - - -Quick Reference ---------------- - -Mockery implements a shorthand API when creating a mock. Here's a sampling -of the possible startup methods. - - $mock = \Mockery::mock('foo'); - -Creates a mock object named foo. In this case, foo is a name (not necessarily -a class name) used as a simple identifier when raising exceptions. This creates -a mock object of type \Mockery\Mock and is the loosest form of mock possible. - - $mock = \Mockery::mock(array('foo'=>1,'bar'=>2)); - -Creates an mock object named unknown since we passed no name. However we did -pass an expectation array, a quick method of setting up methods to expect with -their return values. - - $mock = \Mockery::mock('foo', array('foo'=>1,'bar'=>2)); - -Similar to the previous examples and all examples going forward, expectation arrays -can be passed for all mock objects as the second parameter to mock(). - - $mock = \Mockery::mock('foo', function($mock) { - $mock->shouldReceive(method_name); - }); - -In addition to expectation arrays, you can also pass in a closure which contains -reusable expectations. This can be passed as the second parameter, or as the third -parameter if partnered with an expectation array. This is one method for creating -reusable mock expectations. - - $mock = \Mockery::mock('stdClass'); - -Creates a mock identical to a named mock, except the name is an actual class -name. Creates a simple mock as previous examples show, except the mock -object will inherit the class type (via inheritance), i.e. it will pass type hints -or instanceof evaluations for stdClass. Useful where a mock object must be of a specific -type. - - $mock = \Mockery::mock('FooInterface'); - -You can create mock objects based on any concrete class, abstract class or -even an interface. Again, the primary purpose is to ensure the mock object -inherits a specific type for type hinting. There is an exception in that classes -marked final, or with methods marked final, cannot be mocked fully. In these cases -a partial mock (explained below) must be utilised. - - $mock = \Mockery::mock('alias:MyNamespace\MyClass'); - -Prefixing the valid name of a class (which is NOT currently loaded) with "alias:" -will generate an "alias mock". Alias mocks create a class alias with the given -classname to stdClass and are generally used to enable the mocking of public -static methods. Expectations set on the new mock object which refer to static -methods will be used by all static calls to this class. - - $mock = \Mockery::mock('overload:MyNamespace\MyClass'); - -Prefixing the valid name of a class (which is NOT currently loaded) with "overload:" will -generate an alias mock (as with "alias:") except that created new instances of that -class will import any expectations set on the origin mock ($mock). The origin -mock is never verified since it's used an expectation store for new instances. For this -purpose I used the term "instance mock" to differentiate it from the simpler "alias mock". - -Note: Using alias/instance mocks across more than one test will generate a fatal error since -you can't have two classes of the same name. To avoid this, run each test of this -kind in a separate PHP process (which is supported out of the box by both -PHPUnit and PHPT). - - $mock = \Mockery::mock('stdClass, MyInterface1, MyInterface2'); - -The first argument can also accept a list of interfaces that the mock object must -implement, optionally including no more than one existing class to be based on. The -class name doesn't need to be the first member of the list but it's a friendly -convention to use for readability. All subsequent arguments remain unchanged from -previous examples. - - $mock = \Mockery::mock('MyNamespace\MyClass[foo,bar]'); - -The syntax above tells Mockery to partially mock the MyNamespace\MyClass class, -by mocking the foo() and bar() methods only. Any other method will be not be -overridden by Mockery. This form of "partial mock" can be applied to any class -or abstract class (e.g. mocking abstract methods where a concrete implementation -does not exist yet). - - $mock = \Mockery::mock(new Foo); - -Passing any real object into Mockery will create a partial mock. Partials assume -you can already create a concrete object, so all we need to do is selectively -override a subset of existing methods (or add non-existing methods!) for -our expectations. Partial mocks are essential for any class which is marked final -or contains public methods marked final. - -A little revision: All mock methods accept the class, object or alias name to be -mocked as the first parameter. The second parameter can be an expectation array -of methods and their return values, or an expectation closure (which can be the -third param if used in conjunction with an expectation array). - - \Mockery::self() - -At times, you will discover that expectations on a mock include methods which need to return the same mock object (e.g. a common case when designing a Domain Specific Language (DSL) such as the one Mockery itself uses!). To facilitate this, calling \Mockery::self() will always return the last Mock Object created by calling \Mockery::mock(). For example: - - $mock = \Mockery::mock('BazIterator') - ->shouldReceive('next') - ->andReturn(\Mockery::self()); - -The above class being mocked, as the next() method suggests, is an iterator. In many cases, you can replace all the iterated elements (since they are the same type many times) with just the one mock object which is programmed to act as discrete iterated elements. - -Expectation Declarations ------------------------- - -Once you have created a mock object, you'll often want to start defining how -exactly it should behave (and how it should be called). This is where the -Mockery expectation declarations take over. - - shouldReceive(method_name) - -Declares that the mock expects a call to the given method name. This is the -starting expectation upon which all other expectations and constraints are -appended. - - shouldReceive(method1, method2, ...) - -Declares a number of expected method calls, all of which will adopt any chained -expectations or constraints. - - shouldReceive(array('method1'=>1, 'method2'=>2, ...)) - -Declares a number of expected calls but also their return values. All will -adopt any additional chained expectations or constraints. - - shouldReceive(closure) - -Creates a mock object (only from a partial mock) which is used to create a mock -object recorder. The recorder is a simple proxy to the original object passed -in for mocking. This is passed to the closure, which may run it through a set of -operations which are recorded as expectations on the partial mock. A simple -use case is automatically recording expectations based on an existing usage -(e.g. during refactoring). See examples in a later section. - - with(arg1, arg2, ...) - -Adds a constraint that this expectation only applies to method calls which -match the expected argument list. You can add a lot more flexibility to argument -matching using the built in matcher classes (see later). For example, -\Mockery::any() matches any argument passed to that position in the with() -parameter list. Mockery also allows Hamcrest library matchers - for example, the -Hamcrest function anything() is equivalent to \Mockery:any(). - -It's important to note that this means all expectations attached only apply -to the given method when it is called with these exact arguments. This allows for -setting up differing expectations based on the arguments provided to expected calls. - - withAnyArgs() - -Declares that this expectation matches a method call regardless of what arguments -are passed. This is set by default unless otherwise specified. - - withNoArgs() - -Declares this expectation matches method calls with zero arguments. - - andReturn(value) - -Sets a value to be returned from the expected method call. - - andReturn(value1, value2, ...) - -Sets up a sequence of return values or closures. For example, the first call will return -value1 and the second value2. Not that all subsequent calls to a mocked method -will always return the final value (or the only value) given to this declaration. - - andReturnUsing(closure, ...) - -Sets a closure (anonymous function) to be called with the arguments passed to -the method. The return value from the closure is then returned. Useful for some -dynamic processing of arguments into related concrete results. Closures can -queued by passing them as extra parameters as for andReturn(). Note that you -cannot currently mix andReturnUsing() with andReturn(). - - andThrow(Exception) - -Declares that this method will throw the given Exception object when called. - - andThrow(exception_name, message) - -Rather than an object, you can pass in the Exception class and message to -use when throwing an Exception from the mocked method. - - andSet(name, value1) / set(name, value1) - -Used with an expectation so that when a matching method is called, one -can also cause a mock object's public property to be set to a specified value. - - zeroOrMoreTimes() - -Declares that the expected method may be called zero or more times. This is -the default for all methods unless otherwise set. - - once() - -Declares that the expected method may only be called once. Like all other -call count constraints, it will throw a \Mockery\CountValidator\Exception -if breached and can be modified by the atLeast() and atMost() constraints. - - twice() - -Declares that the expected method may only be called twice. - - times(n) - -Declares that the expected method may only be called n times. - - never() - -Declares that the expected method may never be called. Ever! - - atLeast() - -Adds a minimum modifier to the next call count expectation. Thus -atLeast()->times(3) means the call must be called at least three times (given -matching method args) but never less than three times. - - atMost() - -Adds a maximum modifier to the next call count expectation. Thus -atMost()->times(3) means the call must be called no more than three times. This -also means no calls are acceptable. - - between(min, max) - -Sets an expected range of call counts. This is actually identical to using -atLeast()->times(min)->atMost()->times(max) but is provided as a shorthand. -It may be followed by a times() call with no parameter to preserve the -APIs natural language readability. - - ordered() - -Declares that this method is expected to be called in a specific order in -relation to similarly marked methods. The order is dictated by the order in -which this modifier is actually used when setting up mocks. - - ordered(group) - -Declares the method as belonging to an order group (which can be named or -numbered). Methods within a group can be called in any order, but the ordered -calls from outside the group are ordered in relation to the group, i.e. you can -set up so that method1 is called before group1 which is in turn called before -method 2. - - globally() - -When called prior to ordered() or ordered(group), it declares this ordering to -apply across all mock objects (not just the current mock). This allows for dictating -order expectations across multiple mocks. - - byDefault() - -Marks an expectation as a default. Default expectations are applied unless -a non-default expectation is created. These later expectations immediately -replace the previously defined default. This is useful so you can setup default -mocks in your unit test setup() and later tweak them in specific tests as -needed. - - mock() - -Returns the current mock object from an expectation chain. Useful where -you prefer to keep mock setups as a single statement, e.g. - - $mock = \Mockery::mock('foo')->shouldReceive('foo')->andReturn(1)->mock(); - - -Argument Validation -------------------- - -The arguments passed to the with() declaration when setting up an expectation -determine the criteria for matching method calls to expectations. Thus, you -can setup up many expectations for a single method, each differentiated by -the expected arguments. Such argument matching is done on a "best fit" basis. -This ensures explicit matches take precedence over generalised matches. - -An explicit match is merely where the expected argument and the actual argument -are easily equated (i.e. using === or ==). More generalised matches are possible -using regular expressions, class hinting and the available generic matchers. The -purpose of generalised matchers is to allow arguments be defined in non-explicit -terms, e.g. Mockery::any() passed to with() will match ANY argument in that -position. - -Mockery's generic matchers do not cover all possibilities but offers optional -support for the Hamcrest library of matchers. Hamcrest is a PHP port of the -similarly named Java library (which has been ported also to Python, Erlang, etc). -I strongly recommend using Hamcrest since Mockery simply does not need to duplicate -Hamcrest's already impressive utility which itself promotes a natural English DSL. - -The example below show Mockery matchers and their Hamcrest equivalent. Hamcrest uses -functions (no namespacing). - -Here's a sample of the possibilities. - - with(1) - -Matches the integer 1. This passes the === test (identical). It does facilitate -a less strict == check (equals) where the string '1' would also match the -argument. - - with(\Mockery::any()) OR with(anything()) - -Matches any argument. Basically, anything and everything passed in this argument -slot is passed unconstrained. - - with(\Mockery::type('resource')) OR with(resourceValue()) OR with(typeOf('resource')) - -Matches any resource, i.e. returns true from an is_resource() call. The Type -matcher accepts any string which can be attached to "is_" to form a valid -type check. For example, \Mockery::type('float') or Hamcrest's floatValue() and -typeOf('float') checks using is_float(), and \Mockery::type('callable') or Hamcrest's -callable() uses is_callable(). - -The Type matcher also accepts a class or interface name to be used in an instanceof -evaluation of the actual argument (similarly Hamcrest uses anInstanceOf()). - -You may find a full list of the available type checkers at -http://www.php.net/manual/en/ref.var.php or browse Hamcrest's function list at -http://code.google.com/p/hamcrest/source/browse/trunk/hamcrest-php/hamcrest/Hamcrest.php. - - with(\Mockery::on(closure)) - -The On matcher accepts a closure (anonymous function) to which the actual argument -will be passed. If the closure evaluates to (i.e. returns) boolean TRUE then -the argument is assumed to have matched the expectation. This is invaluable -where your argument expectation is a bit too complex for or simply not -implemented in the current default matchers. - -There is no Hamcrest version of this functionality. - - with('/^foo/') OR with(matchesPattern('/^foo/')) - -The argument declarator also assumes any given string may be a regular -expression to be used against actual arguments when matching. The regex option -is only used when a) there is no === or == match and b) when the regex -is verified to be a valid regex (i.e. does not return false from preg_match()). -If the regex detection doesn't suit your tastes, Hamcrest offers the more -explicit matchesPattern() function. - - with(\Mockery::ducktype('foo', 'bar')) - -The Ducktype matcher is an alternative to matching by class type. It simply -matches any argument which is an object containing the provided list -of methods to call. - -There is no Hamcrest version of this functionality. - - with(\Mockery::mustBe(2)) OR with(identicalTo(2)) - -The MustBe matcher is more strict than the default argument matcher. The default -matcher allows for PHP type casting, but the MustBe matcher also verifies that -the argument must be of the same type as the expected value. Thus by default, -the argument '2' matches the actual argument 2 (integer) but the MustBe matcher -would fail in the same situation since the expected argument was a string and -instead we got an integer. - -Note: Objects are not subject to an identical comparison using this matcher -since PHP would fail the comparison if both objects were not the exact same -instance. This is a hindrance when objects are generated prior to being -returned, since an identical match just would never be possible. - - with(\Mockery::not(2)) OR with(not(2)) - -The Not matcher matches any argument which is not equal or identical to the -matcher's parameter. - - with(\Mockery::anyOf(1, 2)) OR with(anyOf(1,2)) - -Matches any argument which equals any one of the given parameters. - - with(\Mockery::notAnyof(1, 2)) - -Matches any argument which is not equal or identical to any of the given -parameters. - -There is no Hamcrest version of this functionality. - - with(\Mockery::subset(array(0=>'foo'))) - -Matches any argument which is any array containing the given array subset. This -enforces both key naming and values, i.e. both the key and value of each -actual element is compared. - -There is no Hamcrest version of this functionality, though Hamcrest can check a -single entry using hasEntry() or hasKeyValuePair(). - - with(\Mockery::contains(value1, value2)) - -Matches any argument which is an array containing the listed values. The naming -of keys is ignored. - - with(\Mockery::hasKey(key)); - -Matches any argument which is an array containing the given key name. - - with(\Mockery::hasValue(value)); - -Matches any argument which is an array containing the given value. - -Creating Partial Mocks ----------------------- - -Partial mocks are useful when you only need to mock several methods of an object -leaving the remainder free to respond to calls normally (i.e. as implemented). - -Unlike other mock objects, a Mockery partial mock has a real concrete object -at its heart. This approach to partial mocks is intended to bypass a number -of troublesome issues with partials. For example, partials might require -constructor parameters and other setup/injection tasks prior to use. Trying -to perform this automatically via Mockery is not a tenth as intuitive as just -doing it normally - and then passing the object into Mockery. - -Partial mocks are therefore constructed as a Proxy with an embedded real object. -The Proxy itself inherits the type of the embedded object (type safety) and -it otherwise behaves like any other Mockery-based mock object, allowing you to -dynamically define expectations. This flexibility means there's little -upfront defining (besides setting up the real object) and you can set defaults, -expectations and ordering on the fly. - -Default Mock Expectations -------------------------- - -Often in unit testing, we end up with sets of tests which use the same object -dependency over and over again. Rather than mocking this class/object within -every single unit test (requiring a mountain of duplicate code), we can instead -define reusable default mocks within the test case's setup() method. This even -works where unit tests use varying expectations on the same or similar mock -object. - -How this works, is that you can define mocks with default expectations. Then, -in a later unit test, you can add or fine-tune expectations for that -specific test. Any expectation can be set as a default using the byDefault() -declaration. - -Mocking Public Properties -------------------------- - -Mockery allows you to mock properties is several ways. The simplest is that -you can simply set a public property and value on any mock object. The second -is that you can use the expectation methods set() and andSet() to set property -values if that expectation is ever met. - -You should note that, in general, Mockery does not support mocking any magic -methods since these are generally not considered a public API (and besides they -are a PITA to differentiate when you badly need them for mocking!). So please -mock virtual properties (those relying on __get and __set) as if they were -actually declared on the class. - -Mocking Public Static Methods ------------------------------ - -Static methods are not called on real objects, so normal mock objects can't mock -them. Mockery supports class aliased mocks, mocks representing a class name which -would normally be loaded (via autoloading or a require statement) in the system -under test. These aliases block that loading (unless via a require statement - so please -use autoloading!) and allow Mockery to intercept static method calls and add -expectations for them. - -Generating Mock Objects Upon Instantiation (Instance Mocking) -------------------------------------------------------------- - -Instance mocking means that a statement like: - -$obj = new \MyNamespace\Foo; - -...will actually generate a mock object. This is done by replacing the real class -with an instance mock (similar to an alias mock), as with mocking public methods. -The alias will import its -expectations from the original mock of that type (note that the original is never -verified and should be ignored after its expectations are setup). This lets you -intercept instantiation where you can't simply inject a replacement object. - -As before, this does not prevent a require statement from including the real -class and triggering a fatal PHP error. It's intended for use where autoloading -is the primary class loading mechanism. - -Preserving Pass-By-Reference Method Parameter Behaviour -------------------------------------------------------- - -PHP Class method may accept parameters by reference. In this case, changes made -to the parameter (a reference to the original variable passed to the method) are -reflected in the original variable. A simple example: - - class Foo { - public function bar(&$a) { - $a++; - } - } - - $baz = 1; - $foo = new Foo; - $foo->bar($baz); - - echo $baz; // will echo the integer 2 - -In the example above, the variable $baz is passed by reference to Foo::bar() -(notice the "&" symbol in front of the parameter?). -Any change bar() makes to the parameter reference is reflected in the original -variable, $baz. - -Mockery 0.7+ handles references correctly for all methods where it can analyse the -parameter (using Reflection) to see if it is passed by reference. To mock how a -reference is manipulated by the class method, you can use a closure argument -matcher to manipulate it, i.e. \Mockery::on() - see Argument Validation section -above. - -There is an exception for internal PHP classes where Mockery cannot analyse -method parameters using Reflection (a limitation in PHP). To work around this, -you can explicitly declare method parameters for an internal class using -/Mockery/Configuration::setInternalClassMethodParamMap(). - -Here's an example using MongoCollection::insert(). MongoCollection is an internal -class offered by the mongo extension from PECL. Its insert() method accepts an array -of data as the first parameter, and an optional options array as the second -parameter. The original data array is updated (i.e. when a insert() pass-by-reference -parameter) to include a new "_id" field. We can mock this behaviour using -a configured parameter map (to tell Mockery to expect a pass by reference parameter) -and a Closure attached to the expected method parameter to be updated. - -Here's a PHPUnit unit test verifying that this pass-by-reference behaviour is preserved: - - public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs() - { - \Mockery::getConfiguration()->setInternalClassMethodParamMap( - 'MongoCollection', - 'insert', - array('&$data', '$options = array()') - ); - $m = \Mockery::mock('MongoCollection'); - $m->shouldReceive('insert')->with( - \Mockery::on(function(&$data) { - if (!is_array($data)) return false; - $data['_id'] = 123; - return true; - }), - \Mockery::any() - ); - $data = array('a'=>1,'b'=>2); - $m->insert($data); - $this->assertTrue(isset($data['_id'])); - $this->assertEquals(123, $data['_id']); - \Mockery::resetContainer(); - } - -Mocking Demeter Chains And Fluent Interfaces --------------------------------------------- - -Both of these terms refer to the growing practice of invoking statements -similar to: - - $object->foo()->bar()->zebra()->alpha()->selfDestruct(); - -The long chain of method calls isn't necessarily a bad thing, assuming they -each link back to a local object the calling class knows. Just as a fun example, -Mockery's long chains (after the first shouldReceive() method) all call to the -same instance of \Mockery\Expectation. However, sometimes this is not the case -and the chain is constantly crossing object boundaries. - -In either case, mocking such a chain can be a horrible task. To make it easier -Mockery support demeter chain mocking. Essentially, we shortcut through the -chain and return a defined value from the final call. For example, let's -assume selfDestruct() returns the string "Ten!" to $object (an instance of -CaptainsConsole). Here's how we could mock it. - - $mock = \Mockery::mock('CaptainsConsole'); - $mock->shouldReceive('foo->bar->zebra->alpha->selfDestruct')->andReturn('Ten!'); - -The above expectation can follow any previously seen format or expectation, except -that the method name is simply the string of all expected chain calls separated -by "->". Mockery will automatically setup the chain of expected calls with -its final return values, regardless of whatever intermediary object might be -used in the real implementation. - -Arguments to all members of the chain (except the final call) are ignored in -this process. - -Mock Object Recording ---------------------- - -In certain cases, you may find that you are testing against an already -established pattern of behaviour, perhaps during refactoring. Rather then hand -crafting mock object expectations for this behaviour, you could instead use -the existing source code to record the interactions a real object undergoes -onto a mock object as expectations - expectations you can then verify against -an alternative or refactored version of the source code. - -To record expectations, you need a concrete instance of the class to be mocked. -This can then be used to create a partial mock to which is given the necessary -code to execute the object interactions to be recorded. A simple example is -outline below (we use a closure for passing instructions to the mock). - -Here we have a very simple setup, a class (SubjectUser) which uses another class -(Subject) to retrieve some value. We want to record as expectations on our -mock (which will replace Subject later) all the calls and return values of -a Subject instance when interacting with SubjectUser. - - class Subject { - - public function execute() { - return 'executed!'; - } - } - - class SubjectUser { - - public function use(Subject $subject) { - return $subject->execute(); - } - } - -Here's the test case showing the recording: - - class SubjectUserTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - \Mockery::close(); - } - - public function testSomething() - { - $mock = \Mockery::mock(new Subject); - $mock->shouldExpect(function ($subject) { - $user = new SubjectUser; - $user->use($subject); - }); - - /** - * Assume we have a replacement SubjectUser called NewSubjectUser. - * We want to verify it behaves identically to SubjectUser, i.e. - * it uses Subject in the exact same way - */ - $newSubject = new NewSubjectUser; - $newSubject->use($mock); - } - - } - -After the \Mockery::close() call in teardown() validates the mock object, we -should have zero exceptions if NewSubjectUser acted on Subject in a similar way -to SubjectUser. By default the order of calls are not enforced, and loose argument -matching is enabled, i.e. arguments may be equal (==) but not necessarily identical -(===). - -If you wished to be more strict, for example ensuring the order of calls -and the final call counts were identical, or ensuring arguments are completely -identical, you can invoke the recorder's strict mode from the closure block, e.g. - - $mock->shouldExpect(function ($subject) { - $subject->shouldBeStrict(); - $user = new SubjectUser; - $user->use($subject); - }); - -Dealing with Final Classes/Methods ----------------------------------- - -One of the primary restrictions of mock objects in PHP, is that mocking classes -or methods marked final is hard. The final keyword prevents methods so marked -from being replaced in subclasses (subclassing is how mock objects can inherit -the type of the class or object being mocked. - -The simplest solution is not to mark classes or methods as final! - -However, in a compromise between mocking functionality and type safety, Mockery -does allow creating "proxy mocks" from classes marked final, or from classes with -methods marked final. This offers all the usual mock object goodness but the -resulting mock will not inherit the class type of the object being mocked, i.e. -it will not pass any instanceof comparison. - -You can create a proxy mock by passing the instantiated object you wish to mock -into \Mockery::mock(), i.e. Mockery will then generate a Proxy to the real object -and selectively intercept method calls for the purposes of setting and -meeting expectations. - -Mockery Global Configuration ----------------------------- - -To allow for a degree of fine-tuning, Mockery utilises a singleton configuration -object to store a small subset of core behaviours. The three currently present -include: - -* Option to allow/disallow the mocking of methods which do not actually exist -* Option to allow/disallow the existence of expectations which are never fulfilled (i.e. unused) -* Setter/Getter for added a parameter map for internal PHP class methods (Reflection cannot detect these automatically) - -By default, the first two behaviours are enabled. Of course, there are situations where -this can lead to unintended consequences. The mocking of non-existent methods -may allow mocks based on real classes/objects to fall out of sync with the -actual implementations, especially when some degree of integration testing (testing -of object wiring) is not being performed. Allowing unfulfilled expectations means -unnecessary mock expectations go unnoticed, cluttering up test code, and -potentially confusing test readers. - -You may allow or disallow these behaviours (whether for whole test suites or just -select tests) by using one or both of the following two calls: - - \Mockery::getConfiguration()->allowMockingNonExistentMethods(bool); - \Mockery::getConfiguration()->allowMockingMethodsUnnecessarily(bool); - -Passing a true allows the behaviour, false disallows it. Both take effect -immediately until switched back. In both cases, if either -behaviour is detected when not allowed, it will result in an Exception being -thrown at that point. Note that disallowing these behaviours should be carefully -considered since they necessarily remove at least some of Mockery's flexibility. - -The other two methods are: - - \Mockery::getConfiguration()->setInternalClassMethodParamMap($class, $method, array $paramMap) - \Mockery::getConfiguration()->getInternalClassMethodParamMap($class, $method) - -These are used to define parameters (i.e. the signature string of each) for the -methods of internal PHP classes (e.g. SPL, or PECL extension classes like -ext/mongo's MongoCollection. Reflection cannot analyse the parameters of internal -classes. Most of the time, you never need to do this. It's mainly needed where an -internal class method uses pass-by-reference for a parameter - you MUST in such -cases ensure the parameter signature includes the "&" symbol correctly as Mockery -won't correctly add it automatically for internal classes. - -Reserved Method Names ---------------------- - -As you may have noticed, Mockery uses a number of methods called directly on -all mock objects, for example shouldReceive(). Such methods are necessary -in order to setup expectations on the given mock, and so they cannot be -implemented on the classes or objects being mocked without creating a method -name collision (reported as a PHP fatal error). The methods reserved by Mockery are: - -* shouldReceive() -* shouldBeStrict() - -In addition, all mocks utilise a set of added methods and protected properties -which cannot exist on the class or object being mocked. These are far less likely -to cause collisions. All properties are prefixed with "_mockery" and all method -names with "mockery_". - -PHP Magic Methods ------------------ - -PHP magic methods which are prefixed with a double underscore, e.g. _set(), pose -a particular problem in mocking and unit testing in general. It is strongly -recommended that unit tests and mock objects do not directly refer to magic -methods. Instead, refer only to the virtual methods and properties these magic -methods simulate. - -Following this piece of advice will ensure you are testing the real API of classes -and also ensures there is no conflict should Mockery override these magic methods, -which it will inevitably do in order to support its role in intercepting method -calls and properties. - -Gotchas! --------- - -Mocking objects in PHP has its limitations and gotchas. Some functionality can't -be mocked or can't be mocked YET! If you locate such a circumstance, please please -(pretty please with sugar on top) create a new issue on Github so it can be -documented and resolved where possible. Here is a list to note: - -1. Classes containing public __wakeup methods can be mocked but the mocked __wakeup -method will perform no actions and cannot have expectations set for it. This is -necessary since Mockery must serialize and unserialize objects to avoid some -__construct() insanity and attempting to mock a __wakeup method as normal leads -to a BadMethodCallException been thrown. - -2. Classes using non-real methods, i.e. where a method call triggers a __call -method, will throw an exception that the non-real method does not exist unless -you first define at least one expectation (a simple shouldReceive() call would -suffice). This is necessary since there is no other way for Mockery to be -aware of the method name. - -3. Mockery has two scenarios where real classes are replaced: Instance mocks and -alias mocks. Both will generate PHP fatal errors if the real class is loaded, -usually via a require or include statement. Only use these two mock types where -autoloading is in place and where classes are not explicitly loaded on a per-file -basis using require(), require_once(), etc. - -4. Internal PHP classes are not entirely capable of being fully analysed using -Reflection. For example, Reflection cannot reveal details of expected parameters -to the methods of such internal classes. As a result, there will be problems -where a method parameter is defined to accept a value by reference (Mockery -cannot detect this condition and will assume a pass by value on scalars and -arrays). If references as internal class method parameters are needed, you -should use the \Mockery\Configuration::setInternalClassMethodParamMap() method. - -The gotchas noted above are largely down to PHP's architecture and are assumed -to be unavoidable. But - if you figure out a solution (or a better one than what -may exist), let me know! - -Quick Examples --------------- - -Create a mock object to return a sequence of values from a set of method calls. - - class SimpleTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - \Mockery::close(); - } - - public function testSimpleMock() - { - $mock = \Mockery::mock(array('pi' => 3.1416, 'e' => 2.71)); - $this->assertEquals(3.1416, $mock->pi()); - $this->assertEquals(2.71, $mock->e()); - } - - } - -Create a mock object which returns a self-chaining Undefined object for a method -call. - - use \Mockery as m; - - class UndefinedTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - m::close(); - } - - public function testUndefinedValues() - { - $mock = m::mock('my mock'); - $mock->shouldReceive('divideBy')->with(0)->andReturnUndefined(); - $this->assertTrue($mock->divideBy(0) instanceof \Mockery\Undefined); - } - - } - -Creates a mock object which multiple query calls and a single update call - - use \Mockery as m; - - class DbTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - m::close(); - } - - public function testDbAdapter() - { - $mock = m::mock('db'); - $mock->shouldReceive('query')->andReturn(1, 2, 3); - $mock->shouldReceive('update')->with(5)->andReturn(NULL)->once(); - - // test code here using the mock - } - - } - -Expect all queries to be executed before any updates. - - use \Mockery as m; - - class DbTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - m::close(); - } - - public function testQueryAndUpdateOrder() - { - $mock = m::mock('db'); - $mock->shouldReceive('query')->andReturn(1, 2, 3)->ordered(); - $mock->shouldReceive('update')->andReturn(NULL)->once()->ordered(); - - // test code here using the mock - } - - } - -Create a mock object where all queries occur after startup, but before finish, and -where queries are expected with several different params. - - use \Mockery as m; - - class DbTest extends PHPUnit_Framework_TestCase - { - - public function teardown() - { - m::close(); - } - - public function testOrderedQueries() - { - $db = m::mock('db'); - $db->shouldReceive('startup')->once()->ordered(); - $db->shouldReceive('query')->with('CPWR')->andReturn(12.3)->once()->ordered('queries'); - $db->shouldReceive('query')->with('MSFT')->andReturn(10.0)->once()->ordered('queries'); - $db->shouldReceive('query')->with("/^....$/")->andReturn(3.3)->atLeast()->once()->ordered('queries'); - $db->shouldReceive('finish')->once()->ordered(); - - // test code here using the mock - } - - } diff --git a/vendor/mockery/mockery/composer.json b/vendor/mockery/mockery/composer.json deleted file mode 100644 index 4fdcfab..0000000 --- a/vendor/mockery/mockery/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "mockery/mockery", - "version": "0.7.2", - "type": "library", - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "keywords": ["library", "testing", "test", "stub", "mock", "mockery", "test double", "tdd", "bdd", "mock objects"], - "homepage": "http://github.com/padraic/mockery", - "license": "New BSD", - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "require": { - "php": ">=5.3.2" - }, - "autoload": { - "psr-0": { "Mockery": "library/" } - }, - "repositories": { - "hamcrest googlecode com": { - "pear": { - "url": "http://hamcrest.googlecode.com/svn/pear" - } - } - }, - "suggest": { - "Hamcrest": "1.0.0" - } -} \ No newline at end of file diff --git a/vendor/mockery/mockery/examples/starship/Bootstrap.php b/vendor/mockery/mockery/examples/starship/Bootstrap.php deleted file mode 100644 index 93b0af9..0000000 --- a/vendor/mockery/mockery/examples/starship/Bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -register(); diff --git a/vendor/mockery/mockery/examples/starship/Starship.php b/vendor/mockery/mockery/examples/starship/Starship.php deleted file mode 100644 index 3e3ecf3..0000000 --- a/vendor/mockery/mockery/examples/starship/Starship.php +++ /dev/null @@ -1,25 +0,0 @@ -_engineering = $engineering; - } - - public function enterOrbit() - { - $this->_engineering->disengageWarp(); - $this->_engineering->runDiagnosticLevel(5); - $this->_engineering->divertPower(0.40, 'sensors'); - $this->_engineering->divertPower(0.30, 'auxengines'); - $this->_engineering->runDiagnosticLevel(1); - - // We can add more runDiagnosticLevel() calls without failing the test - // anywhere above since they are unordered. - } - -} diff --git a/vendor/mockery/mockery/examples/starship/StarshipTest.php b/vendor/mockery/mockery/examples/starship/StarshipTest.php deleted file mode 100644 index 570eb1b..0000000 --- a/vendor/mockery/mockery/examples/starship/StarshipTest.php +++ /dev/null @@ -1,22 +0,0 @@ -shouldReceive('disengageWarp')->once()->ordered(); - $mock->shouldReceive('divertPower')->with(0.40, 'sensors')->once()->ordered(); - $mock->shouldReceive('divertPower')->with(0.30, 'auxengines')->once()->ordered(); - $mock->shouldReceive('runDiagnosticLevel')->with(1)->once()->ordered(); - $mock->shouldReceive('runDiagnosticLevel')->with(M::type('int'))->zeroOrMoreTimes(); - - $starship = new Starship($mock); - $starship->enterOrbit(); - } - -} diff --git a/vendor/mockery/mockery/examples/starship/phpunit.xml b/vendor/mockery/mockery/examples/starship/phpunit.xml deleted file mode 100644 index db2725f..0000000 --- a/vendor/mockery/mockery/examples/starship/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - ./ - - - - - - diff --git a/vendor/mockery/mockery/library/Mockery.php b/vendor/mockery/mockery/library/Mockery.php deleted file mode 100644 index c0893b8..0000000 --- a/vendor/mockery/mockery/library/Mockery.php +++ /dev/null @@ -1,347 +0,0 @@ -mockery_teardown(); - self::$_container->mockery_close(); - self::$_container = null; - } - - /** - * Static fetching of a mock associated with a name or explicit class poser - */ - public static function fetchMock($name) - { - return self::$_container->fetchMock($name); - } - - /** - * Get the container - */ - public static function getContainer() - { - return self::$_container; - } - - /** - * Set the container - */ - public static function setContainer(Mockery\Container $container) - { - return self::$_container = $container; - } - - /** - * Reset the container to NULL - */ - public static function resetContainer() - { - self::$_container = null; - } - - /** - * Return instance of ANY matcher - * - * @return - */ - public static function any() - { - $return = new \Mockery\Matcher\Any(); - return $return; - } - - /** - * Return instance of TYPE matcher - * - * @return - */ - public static function type($expected) - { - $return = new \Mockery\Matcher\Type($expected); - return $return; - } - - /** - * Return instance of DUCKTYPE matcher - * - * @return - */ - public static function ducktype() - { - $return = new \Mockery\Matcher\Ducktype(func_get_args()); - return $return; - } - - /** - * Return instance of SUBSET matcher - * - * @return - */ - public static function subset(array $part) - { - $return = new \Mockery\Matcher\Subset($part); - return $return; - } - - /** - * Return instance of CONTAINS matcher - * - * @return - */ - public static function contains() - { - $return = new \Mockery\Matcher\Contains(func_get_args()); - return $return; - } - - /** - * Return instance of HASKEY matcher - * - * @return - */ - public static function hasKey($key) - { - $return = new \Mockery\Matcher\HasKey($key); - return $return; - } - - /** - * Return instance of HASVALUE matcher - * - * @return - */ - public static function hasValue($val) - { - $return = new \Mockery\Matcher\HasValue($val); - return $return; - } - - /** - * Return instance of CLOSURE matcher - * - * @return - */ - public static function on($closure) - { - $return = new \Mockery\Matcher\Closure($closure); - return $return; - } - - /** - * Return instance of MUSTBE matcher - * - * @return - */ - public static function mustBe($expected) - { - $return = new \Mockery\Matcher\MustBe($expected); - return $return; - } - - /** - * Return instance of NOT matcher - * - * @return - */ - public static function not($expected) - { - $return = new \Mockery\Matcher\Not($expected); - return $return; - } - - /** - * Return instance of ANYOF matcher - * - * @return - */ - public static function anyOf() - { - $return = new \Mockery\Matcher\AnyOf(func_get_args()); - return $return; - } - - /** - * Return instance of NOTANYOF matcher - * - * @return - */ - public static function notAnyOf() - { - $return = new \Mockery\Matcher\NotAnyOf(func_get_args()); - return $return; - } - - /** - * Get the global configuration container - */ - public static function getConfiguration() - { - if (is_null(self::$_config)) { - self::$_config = new \Mockery\Configuration; - } - return self::$_config; - } - - /** - * Utility method to format method name and args into a string - * - * @param string $method - * @param array $args - * @return string - */ - public static function formatArgs($method, array $args = null) - { - $return = $method . '('; - if ($args && !empty($args)) { - $parts = array(); - foreach($args as $arg) { - if (is_object($arg)) { - $parts[] = get_class($arg); - } elseif (is_int($arg) || is_float($arg)) { - $parts[] = $arg; - } elseif (is_array($arg)) { - $parts[] = 'Array'; - } else { - $parts[] = '"' . (string) $arg . '"'; - } - } - $return .= implode(', ', $parts); // TODO: improve format - - } - $return .= ')'; - return $return; - } - - /** - * Utility function to parse shouldReceive() arguments and generate - * expectations from such as needed. - * - * @param \Mockery\MockInterface - * @param array $args - * @return \Mockery\CompositeExpectation - */ - public static function parseShouldReturnArgs(\Mockery\MockInterface $mock, $args, $add) - { - $composite = new \Mockery\CompositeExpectation; - foreach ($args as $arg) { - if (is_array($arg)) { - foreach($arg as $k=>$v) { - $expectation = self::_buildDemeterChain($mock, $k, $add)->andReturn($v); - $composite->add($expectation); - } - } elseif (is_string($arg)) { - $expectation = self::_buildDemeterChain($mock, $arg, $add); - $composite->add($expectation); - } - } - return $composite; - } - - /** - * Sets up expectations on the members of the CompositeExpectation and - * builds up any demeter chain that was passed to shouldReceive - * - * @param \Mockery\MockInterface $mock - * @param string $arg - * @param Closure $add - * @return \Mockery\ExpectationDirector - */ - protected static function _buildDemeterChain(\Mockery\MockInterface $mock, $arg, $add) - { - $container = $mock->mockery_getContainer(); - $names = explode('->', $arg); - reset($names); - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() - && !in_array(current($names), $mock->mockery_getMockableMethods())) { - throw new \Mockery\Exception( - 'Mockery\'s configuration currently forbids mocking the method ' - . current($names) . ' as it does not exist on the class or object ' - . 'being mocked' - ); - } - $exp = null; - $nextExp = function ($n) use ($add) {return $add($n);}; - while (true) { - $method = array_shift($names); - $exp = $mock->mockery_getExpectationsFor($method); - $needNew = false; - if (is_null($exp) || empty($names)) { - $needNew = true; - } - if ($needNew) $exp = $nextExp($method); - if (empty($names)) break; - if ($needNew) { - $mock = $container->mock('demeter_' . $method); - $exp->withNoArgs()->andReturn($mock); - } - $nextExp = function ($n) use ($mock) {return $mock->shouldReceive($n);}; - } - return $exp; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php deleted file mode 100644 index f0d72aa..0000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php +++ /dev/null @@ -1,74 +0,0 @@ -getTestResultObject(); - $result->addError($test, $e, $time); - } - } - - /** - * Add Mockery files to PHPUnit's blacklist so they don't showup on coverage reports - */ - public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) { - - if (class_exists('\\PHP_CodeCoverage_Filter') - && method_exists('\\PHP_CodeCoverage_Filter', 'getInstance')) { - \PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist( - __DIR__.'/../../../Mockery/', '.php', '', 'PHPUNIT' - ); - - \PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__DIR__.'/../../../Mockery.php', 'PHPUNIT'); - } - } - /** - * The Listening methods below are not required for Mockery - */ - public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) {} - - public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) {} - - public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {} - - public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {} - - - public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) {} - - public function startTest(\PHPUnit_Framework_Test $test) {} - -} diff --git a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php deleted file mode 100644 index 528aa5d..0000000 --- a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php +++ /dev/null @@ -1,123 +0,0 @@ -_expectations[] = $expectation; - } - - /** - * Intercept any expectation calls and direct against all expectations - * - * @param string $method - * @param array $args - * @return self - */ - public function __call($method, array $args) - { - foreach ($this->_expectations as $expectation) { - call_user_func_array(array($expectation, $method), $args); - } - return $this; - } - - /** - * Return order number of the first expectation - * - * @return int - */ - public function getOrderNumber() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getOrderNumber(); - } - - /** - * Return the parent mock of the first expectation - * - * @return \Mockery\MockInterface - */ - public function getMock() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getMock(); - } - - /** - * Mockery API alias to getMock - * - * @return \Mockery\MockInterface - */ - public function mock() - { - return $this->getMock(); - } - - /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain - * - * @return \Mockery\Expectation - */ - public function shouldReceive() - { - $args = func_get_args(); - reset($this->_expectations); - $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldReceive'), $args); - } - - /** - * Return the string summary of this composite expectation - * - * @return string - */ - public function __toString() - { - $return = '['; - $parts = array(); - foreach ($this->_expectations as $exp) { - $parts[] = (string) $exp; - } - $return .= implode(', ', $parts) . ']'; - return $return; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Configuration.php b/vendor/mockery/mockery/library/Mockery/Configuration.php deleted file mode 100644 index 9973957..0000000 --- a/vendor/mockery/mockery/library/Mockery/Configuration.php +++ /dev/null @@ -1,119 +0,0 @@ -_allowMockingNonExistentMethod = (bool) $flag; - } - - /** - * Return flag indicating whether mocking non-existent methods allowed - * - * @return bool - */ - public function mockingNonExistentMethodsAllowed() - { - return $this->_allowMockingNonExistentMethod; - } - - /** - * Set boolean to allow/prevent unnecessary mocking of methods - * - * @param bool - */ - public function allowMockingMethodsUnnecessarily($flag = true) - { - $this->_allowMockingMethodsUnnecessarily = (bool) $flag; - } - - /** - * Return flag indicating whether mocking non-existent methods allowed - * - * @return bool - */ - public function mockingMethodsUnnecessarilyAllowed() - { - return $this->_allowMockingMethodsUnnecessarily; - } - - /** - * Set a parameter map (array of param signature strings) for the method - * of an internal PHP class. - * - * @param string $class - * @param string $method - * @param array $map - */ - public function setInternalClassMethodParamMap($class, $method, array $map) - { - if (!isset($this->_internalClassParamMap[strtolower($class)])) { - $this->_internalClassParamMap[strtolower($class)] = array(); - } - $this->_internalClassParamMap[strtolower($class)][strtolower($method)] = $map; - } - - /** - * Get the parameter map of an internal PHP class method - * - * @return array - */ - public function getInternalClassMethodParamMap($class, $method) - { - if (isset($this->_internalClassParamMap[strtolower($class)][strtolower($method)])) { - return $this->_internalClassParamMap[strtolower($class)][strtolower($method)]; - } - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Container.php b/vendor/mockery/mockery/library/Mockery/Container.php deleted file mode 100644 index 16388ac..0000000 --- a/vendor/mockery/mockery/library/Mockery/Container.php +++ /dev/null @@ -1,343 +0,0 @@ - 1) { - $finalArg = end($args); - reset($args); - if (is_callable($finalArg)) { - $expectationClosure = array_pop($args); - } - } - while (count($args) > 0) { - $arg = current($args); - // check for multiple interfaces - if (is_string($arg) && strpos($arg, ',') && !strpos($arg, ']')) { - $interfaces = explode(',', str_replace(' ', '', $arg)); - foreach ($interfaces as $i) { - if (!interface_exists($i, true) && !class_exists($i, true)) { - throw new \Mockery\Exception( - 'Class name follows the format for defining multiple' - . ' interfaces, however one or more of the interfaces' - . ' do not exist or are not included, or the base class' - . ' (optional) does not exist' - ); - } - } - $class = $interfaces; - array_shift($args); - } elseif (is_string($arg) && substr($arg, 0, 6) == 'alias:') { - $class = 'stdClass'; - $name = array_shift($args); - $name = str_replace('alias:', '', $name); - } elseif (is_string($arg) && substr($arg, 0, 9) == 'overload:') { - $class = 'stdClass'; - $name = array_shift($args); - $name = str_replace('overload:', '', $name); - $makeInstanceMock = true; - } elseif (is_string($arg) && substr($arg, strlen($arg)-1, 1) == ']') { - $parts = explode('[', $arg); - if (!class_exists($parts[0], true) && !interface_exists($parts[0], true)) { - throw new \Mockery\Exception('Can only create a partial mock from' - . ' an existing class or interface'); - } - $class = $parts[0]; - $parts[1] = str_replace(' ','', $parts[1]); - $partialMethods = explode(',', strtolower(rtrim($parts[1], ']'))); - array_shift($args); - } elseif (is_string($arg) && (class_exists($arg, true) || interface_exists($arg, true))) { - $class = array_shift($args); - } elseif (is_string($arg)) { - $name = array_shift($args); - } elseif (is_object($arg)) { - $partial = array_shift($args); - } elseif (is_array($arg)) { - if(array_key_exists(self::BLOCKS, $arg)) $blocks = $arg[self::BLOCKS]; unset($arg[self::BLOCKS]); - $quickdefs = array_shift($args); - } else { - throw new \Mockery\Exception( - 'Unable to parse arguments sent to ' - . get_class($this) . '::mock()' - ); - } - } - if (!is_null($name) && !is_null($class)) { - if (!$makeInstanceMock) { - $mockName = \Mockery\Generator::createClassMock($class); - } else { - $mockName = \Mockery\Generator::createClassMock($class, null, null, array(), true); - } - $result = class_alias($mockName, $name); - $mock = $this->_getInstance($name); - $mock->mockery_init($class, $this); - } elseif (!is_null($name)) { - $mock = new \Mockery\Mock(); - $mock->mockery_init($name, $this); - } elseif(!is_null($class)) { - $mockName = \Mockery\Generator::createClassMock($class, null, null, array(), false, $partialMethods); - $mock = $this->_getInstance($mockName); - $mock->mockery_init($class, $this); - } elseif(!is_null($partial)) { - $mockName = \Mockery\Generator::createClassMock(get_class($partial), null, true, $blocks); - $mock = $this->_getInstance($mockName); - $mock->mockery_init(get_class($partial), $this, $partial); - } else { - $mock = new \Mockery\Mock(); - $mock->mockery_init('unknown', $this); - } - if (!empty($quickdefs)) { - $mock->shouldReceive($quickdefs); - } - if (!empty($expectationClosure)) { - $expectationClosure($mock); - } - $this->rememberMock($mock); - return $mock; - } - - public function instanceMock() - { - - } - - /** - * Tear down tasks for this container - * - * @return void - */ - public function mockery_teardown() - { - try { - $this->mockery_verify(); - } catch (\Exception $e) { - $this->mockery_close(); - throw $e; - } - } - - /** - * Verify the container mocks - * - * @return void - */ - public function mockery_verify() - { - foreach($this->_mocks as $mock) { - $mock->mockery_verify(); - } - } - - /** - * Reset the container to its original state - * - * @return void - */ - public function mockery_close() - { - foreach($this->_mocks as $mock) { - $mock->mockery_teardown(); - } - $this->_mocks = array(); - } - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder() - { - $this->_allocatedOrder += 1; - return $this->_allocatedOrder; - } - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order) - { - $this->_groups[$group] = $order; - } - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups() - { - return $this->_groups; - } - - /** - * Set current ordered number - * - * @param int $order - * @return int The current order number that was set - */ - public function mockery_setCurrentOrder($order) - { - $this->_currentOrder = $order; - return $this->_currentOrder; - } - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder() - { - return $this->_currentOrder; - } - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order) - { - if ($order < $this->_currentOrder) { - throw new \Mockery\Exception( - 'Method ' . $method . ' called out of order: expected order ' - . $order . ', was ' . $this->_currentOrder - ); - } - $this->mockery_setCurrentOrder($order); - } - - /** - * Store a mock and set its container reference - * - * @param \Mockery\Mock - * @return \Mockery\Mock - */ - public function rememberMock(\Mockery\MockInterface $mock) - { - if (!isset($this->_mocks[get_class($mock)])) { - $this->_mocks[get_class($mock)] = $mock; - } else { - /** - * This condition triggers for an instance mock where origin mock - * is already remembered - */ - $this->_mocks[] = $mock; - } - return $mock; - } - - /** - * Retrieve the last remembered mock object, which is the same as saying - * retrieve the current mock being programmed where you have yet to call - * mock() to change it - thus why the method name is "self" since it will be - * be used during the programming of the same mock. - * - * @return \Mockery\Mock - */ - public function self() - { - $mocks = array_values($this->_mocks); - $index = count($mocks) - 1; - return $mocks[$index]; - } - - /** - * Return a specific remembered mock according to the array index it - * was stored to in this container instance - * - * @return \Mockery\Mock - */ - public function fetchMock($reference) - { - if (isset($this->_mocks[$reference])) return $this->_mocks[$reference]; - } - - protected function _getInstance($mockName) - { - if (!method_exists($mockName, '__construct')) { - $return = new $mockName; - return $return; - } - $return = unserialize(sprintf('O:%d:"%s":0:{}', strlen($mockName), $mockName)); - return $return; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php deleted file mode 100644 index f60bf11..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php +++ /dev/null @@ -1,56 +0,0 @@ -_limit > $n) { - throw new Exception( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' at least ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - } - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php deleted file mode 100644 index b0b212d..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php +++ /dev/null @@ -1,45 +0,0 @@ -_limit < $n) { - throw new Exception( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' at most ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - } - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php deleted file mode 100644 index b965081..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php +++ /dev/null @@ -1,71 +0,0 @@ -_expectation = $expectation; - $this->_limit = $limit; - } - - /** - * Checks if the validator can accept an additional nth call - * - * @param int $n - * @return bool - */ - public function isEligible($n) - { - return ($n < $this->_limit); - } - - /** - * Validate the call count against this validator - * - * @param int $n - * @return bool - */ - public abstract function validate($n); - -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php deleted file mode 100644 index 7f40749..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php +++ /dev/null @@ -1,45 +0,0 @@ -_limit !== $n) { - throw new Exception( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' exactly ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - } - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php deleted file mode 100644 index c702875..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php +++ /dev/null @@ -1,26 +0,0 @@ -_mock = $mock; - $this->_name = $name; - } - - /** - * Return a string with the method name and arguments formatted - * - * @param string $name Name of the expected method - * @param array $args List of arguments to the method - * @return string - */ - public function __toString() - { - return \Mockery::formatArgs($this->_name, $this->_expectedArgs); - } - - /** - * Verify the current call, i.e. that the given arguments match those - * of this expectation - * - * @param array $args - * @return mixed - */ - public function verifyCall(array $args) - { - $this->validateOrder(); - $this->_actualCount++; - $return = $this->_getReturnValue($args); - if ($return instanceof \Exception && $this->_throw === true) { - throw $return; - } - return $return; - } - - /** - * Fetch the return value for the matching args - * - * @param array $args - * @return mixed - */ - protected function _getReturnValue(array $args) - { - if (count($this->_closureQueue) > 1) { - return call_user_func_array(array_shift($this->_closureQueue), $args); - } elseif (count($this->_closureQueue) > 0) { - return call_user_func_array(current($this->_closureQueue), $args); - } elseif (count($this->_returnQueue) > 1) { - return array_shift($this->_returnQueue); - } elseif (count($this->_returnQueue) > 0) { - return current($this->_returnQueue); - } - } - - /** - * Checks if this expectation is eligible for additional calls - * - * @return bool - */ - public function isEligible() - { - foreach ($this->_countValidators as $validator) { - if (!$validator->isEligible($this->_actualCount)) { - return false; - } - } - return true; - } - - /** - * Check if there is a constraint on call count - * - * @return bool - */ - public function isCallCountConstrained() - { - return (count($this->_countValidators) > 0); - } - - /** - * Verify call order - * - * @return void - */ - public function validateOrder() - { - if ($this->_orderNumber) { - $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber); - } - if ($this->_globalOrderNumber) { - $this->_mock->mockery_getContainer() - ->mockery_validateOrder((string) $this, $this->_globalOrderNumber); - } - } - - /** - * Verify this expectation - * - * @return bool - */ - public function verify() - { - foreach ($this->_countValidators as $validator) { - $validator->validate($this->_actualCount); - } - } - - /** - * Check if passed arguments match an argument expectation - * - * @param array $args - * @return bool - */ - public function matchArgs(array $args) - { - if(empty($this->_expectedArgs) && !$this->_noArgsExpectation) { - return true; - } - if(count($args) !== count($this->_expectedArgs)) { - return false; - } - for ($i=0; $i_matchArg($this->_expectedArgs[$i], $param)) { - return false; - } - } - return true; - } - - /** - * Check if passed argument matches an argument expectation - * - * @param array $args - * @return bool - */ - protected function _matchArg($expected, &$actual) - { - if ($expected === $actual) { - return true; - } - if (!is_object($expected) && !is_object($actual) && $expected == $actual) { - return true; - } - if (is_string($expected) && !is_array($actual) && !is_object($actual)) { - $result = @preg_match($expected, (string) $actual); - if($result) { - return true; - } - } - if (is_string($expected) && is_object($actual)) { - $result = $actual instanceof $expected; - if($result) { - return true; - } - } - if ($expected instanceof \Mockery\Matcher\MatcherAbstract) { - return $expected->match($actual); - } - if ($expected instanceof \Hamcrest_Matcher) { - return $expected->matches($actual); - } - return false; - } - - /** - * Expected argument setter for the expectation - * - * @param mixed - * @return self - */ - public function with() - { - $this->_expectedArgs = func_get_args(); - return $this; - } - - /** - * Set with() as no arguments expected - * - * @return self - */ - public function withNoArgs() - { - $this->_noArgsExpectation = true; - return $this->with(); - } - - /** - * Set expectation that any arguments are acceptable - * - * @return self - */ - public function withAnyArgs() - { - $this->_expectedArgs = array(); - return $this; - } - - /** - * Set a return value, or sequential queue of return values - * - * @return self - */ - public function andReturn() - { - $this->_returnQueue = func_get_args(); - return $this; - } - - /** - * Set a closure or sequence of closures with which to generate return - * values. The arguments passed to the expected method are passed to the - * closures as parameters. - * - * @return self - */ - public function andReturnUsing() - { - $this->_closureQueue = func_get_args(); - return $this; - } - - /** - * Return a self-returning black hole object. - * - * @return self - */ - public function andReturnUndefined() - { - $this->andReturn(new \Mockery\Undefined); - return $this; - } - - /** - * Set Exception class and arguments to that class to be thrown - * - * @param string $exception - * @param string $message - * @param int $code - * @param Exception $previous - * @return self - */ - public function andThrow($exception, $message = '', $code = 0, \Exception $previous = null) - { - $this->_throw = true; - if (is_object($exception)) { - $this->andReturn($exception); - } else { - $this->andReturn(new $exception($message, $code, $previous)); - } - return $this; - } - - /** - * Set a public property on the mock - * - * @param string $name - * @param mixed $value - * @return self - */ - public function andSet($name, $value) - { - $this->_mock->{$name} = $value; - return $this; - } - - /** - * Set a public property on the mock (alias to andSet()). Allows the natural - * English construct - set('foo', 'bar')->andReturn('bar') - * - * @param string $name - * @param mixed $value - * @return self - */ - public function set($name, $value) - { - return $this->andSet($name, $value); - } - - /** - * Indicates this expectation should occur zero or more times - * - * @return self - */ - public function zeroOrMoreTimes() - { - $this->atLeast()->never(); - } - - /** - * Indicates the number of times this expectation should occur - * - * @param int $limit - */ - public function times($limit = null) - { - if (is_null($limit)) return $this; - $this->_countValidators[] = new $this->_countValidatorClass($this, $limit); - $this->_countValidatorClass = 'Mockery\CountValidator\Exact'; - return $this; - } - - /** - * Indicates that this expectation is never expected to be called - * - * @return self - */ - public function never() - { - return $this->times(0); - } - - /** - * Indicates that this expectation is expected exactly once - * - * @return self - */ - public function once() - { - return $this->times(1); - } - - /** - * Indicates that this expectation is expected exactly twice - * - * @return self - */ - public function twice() - { - return $this->times(2); - } - - /** - * Sets next count validator to the AtLeast instance - * - * @return self - */ - public function atLeast() - { - $this->_countValidatorClass = 'Mockery\CountValidator\AtLeast'; - return $this; - } - - /** - * Sets next count validator to the AtMost instance - * - * @return self - */ - public function atMost() - { - $this->_countValidatorClass = 'Mockery\CountValidator\AtMost'; - return $this; - } - - /** - * Shorthand for setting minimum and maximum constraints on call counts - * - * @param int $minimum - * @param int $maximum - */ - public function between($minimum, $maximum) - { - return $this->atLeast()->times($minimum)->atMost()->times($maximum); - } - - /** - * Indicates that this expectation must be called in a specific given order - * - * @param string $group Name of the ordered group - * @return self - */ - public function ordered($group = null) - { - if ($this->_globally) { - $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer()); - } else { - $this->_orderNumber = $this->_defineOrdered($group, $this->_mock); - } - $this->_globally = false; - return $this; - } - - /** - * Indicates call order should apply globally - * - * @return self - */ - public function globally() - { - $this->_globally = true; - return $this; - } - - /** - * Setup the ordering tracking on the mock or mock container - * - * @param string $group - * @param object $ordering - * @return int - */ - protected function _defineOrdered($group, $ordering) - { - $groups = $ordering->mockery_getGroups(); - if (is_null($group)) { - $result = $ordering->mockery_allocateOrder(); - } elseif (isset($groups[$group])) { - $result = $groups[$group]; - } else { - $result = $ordering->mockery_allocateOrder(); - $ordering->mockery_setGroup($group, $result); - } - return $result; - } - - /** - * Return order number - * - * @return int - */ - public function getOrderNumber() - { - return $this->_orderNumber; - } - - /** - * Mark this expectation as being a default - * - * @return self - */ - public function byDefault() - { - $director = $this->_mock->mockery_getExpectationsFor($this->_name); - if(!empty($director)) { - $director->makeExpectationDefault($this); - } - return $this; - } - - /** - * Return the parent mock of the expectation - * - * @return \Mockery\MockInterface - */ - public function getMock() - { - return $this->_mock; - } - - /** - * Cloning logic - * - */ - public function __clone() - { - $newValidators = array(); - $countValidators = $this->_countValidators; - foreach ($countValidators as $validator) { - $newValidators[] = clone $validator; - } - $this->_countValidators = $newValidators; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php deleted file mode 100644 index e947d00..0000000 --- a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php +++ /dev/null @@ -1,188 +0,0 @@ -_name = $name; - $this->_mock = $mock; - } - - /** - * Add a new expectation to the director - * - * @param Mutateme\Expectation $expectation - */ - public function addExpectation(\Mockery\Expectation $expectation) - { - $this->_expectations[] = $expectation; - } - - /** - * Handle a method call being directed by this instance - * - * @param array $args - * @return mixed - */ - public function call(array $args) - { - $expectation = $this->findExpectation($args); - if (is_null($expectation)) { - throw new \Mockery\Exception( - 'No matching handler found for ' - . $this->_mock->mockery_getName() . '::' - . \Mockery::formatArgs($this->_name, $args) - . '. Either the method was unexpected or its arguments matched' - . ' no expected argument list for this method' - ); - } - return $expectation->verifyCall($args); - } - - /** - * Verify all expectations of the director - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function verify() - { - if (!empty($this->_expectations)) { - foreach ($this->_expectations as $exp) { - $exp->verify(); - } - } else { - foreach ($this->_defaults as $exp) { - $exp->verify(); - } - } - } - - /** - * Attempt to locate an expecatation matching the provided args - * - * @param array $args - * @return mixed - */ - public function findExpectation(array $args) - { - if (!empty($this->_expectations)) { - return $this->_findExpectationIn($this->_expectations, $args); - } else { - return $this->_findExpectationIn($this->_defaults, $args); - } - } - - /** - * Make the given expectation a default for all others assuming it was - * correctly created last - * - * @param \Mockery\Expectation - */ - public function makeExpectationDefault(\Mockery\Expectation $expectation) - { - $last = end($this->_expectations); - if ($last === $expectation) { - array_pop($this->_expectations); - $this->_defaults[] = $expectation; - } else { - throw new \Mockery\Exception( - 'Cannot turn a previously defined expectation into a default' - ); - } - } - - /** - * Search current array of expectations for a match - * - * @param array $expectations - * @param array $args - * @return mixed - */ - protected function _findExpectationIn(array $expectations, array $args) - { - foreach ($expectations as $exp) { - if ($exp->matchArgs($args) && $exp->isEligible()) { - return $exp; - } - } - foreach ($expectations as $exp) { - if ($exp->matchArgs($args)) { - return $exp; - } - } - } - - /** - * Return all expectations assigned to this director - * - * @return array - */ - public function getExpectations() - { - return $this->_expectations; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator.php b/vendor/mockery/mockery/library/Mockery/Generator.php deleted file mode 100644 index 5ca91c0..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator.php +++ /dev/null @@ -1,587 +0,0 @@ -isInterface()) { - $interfaceInheritance[] = $data['className']; - } elseif ($data['class']->isFinal() || $data['hasFinalMethods']) { - $inheritance = ' extends ' . $data['className']; - $classNameInherited = $data['className']; - $classIsFinal = true; - } else { - $inheritance = ' extends ' . $data['className'] . ' implements \Mockery\MockInterface'; - $classNameInherited = $data['className']; - } - } - if (count($interfaceInheritance) > 0) { - if (!$classIsFinal) $interfaceInheritance[] = '\Mockery\MockInterface'; - if (strlen($classNameInherited) > 0) $inheritance = ' extends ' . $classNameInherited; - $inheritance .= ' implements ' . implode(', ', $interfaceInheritance); - } - - $definition .= 'class ' . $mockName . $inheritance . PHP_EOL . '{' . PHP_EOL; - foreach ($classData as $data) { - if (!$data['class']->isFinal() && !$data['hasFinalMethods']) { - $result = self::applyMockeryTo($data['class'], $data['publicMethods'], $block, $partialMethods); - if ($result['callTypehinting']) $callTypehinting = true; - $definition .= $result['definition']; - $definition .= self::stubAbstractProtected($data['protectedMethods']); - } else { - $useStandardMethods = false; - } - } - if ($useStandardMethods) $definition .= self::_getStandardMethods($callTypehinting, $makeInstanceMock); - $definition .= PHP_EOL . '}'; - eval($definition); - return $mockName; - } - - protected static function _analyseClass($class, $className, $allowFinal = false) - { - if ($class->isFinal() && !$allowFinal) { - throw new \Mockery\Exception( - 'The class ' . $className . ' is marked final and its methods' - . ' cannot be replaced. Classes marked final can be passed in' - . ' to \Mockery::mock() as instantiated objects to create a' - . ' partial mock, but only if the mock is not subject to type' - . ' hinting checks.' - ); - } elseif ($class->isFinal()) { - $className = '\\Mockery\\Mock'; - } - $hasFinalMethods = false; - $methods = $class->getMethods(\ReflectionMethod::IS_PUBLIC); - $protected = $class->getMethods(\ReflectionMethod::IS_PROTECTED); - foreach ($methods as $method) { - if ($method->isFinal() && !$allowFinal) { - throw new \Mockery\Exception( - 'The method ' . $method->getName() - . ' is marked final and it is not possible to generate a ' - . 'mock object with such a method defined. You should instead ' - . 'pass an instance of this object to Mockery to create a ' - . 'partial mock.' - ); - } elseif ($method->isFinal()) { - $className = '\\Mockery\\Mock'; - $hasFinalMethods = true; - } - } - return array( - 'class' => $class, - 'className' => $className, - 'hasFinalMethods' => $hasFinalMethods, - 'publicMethods' => $methods, - 'protectedMethods' => $protected - ); - } - - /** - * Add all Mockery methods for mocks to the class being defined - * - * - */ - public static function applyMockeryTo(\ReflectionClass $class, - array $methods, array $block, $partialMethods = array()) - { - $definition = ''; - $callTypehinting = false; - /** - * TODO: Worry about all these other method types later. - */ - foreach ($methods as $method) { - if(in_array($method->getName(), $block)) continue; - if (count($partialMethods) > 0 && !in_array(strtolower($method->getName()), $partialMethods)) { - continue; - } - if (!$method->isDestructor() - && !$method->isStatic() - && $method->getName() !== '__call' - && $method->getName() !== '__clone' - && $method->getName() !== '__wakeup' - && $method->getName() !== '__set' - && $method->getName() !== '__get' - && $method->getName() !== '__isset') { - $definition .= self::_replacePublicMethod($method); - } - if ($method->getName() == '__call') { - $params = $method->getParameters(); - if ($params[1]->isArray()) { - $callTypehinting = true; - } - } - } - return array('definition'=>$definition, 'callTypehinting'=>$callTypehinting); - } - - public static function stubAbstractProtected(array $methods) - { - $definition = ''; - foreach ($methods as $method) { - if ($method->isAbstract()) { - $definition .= self::_replaceProtectedAbstractMethod($method); - } - } - return $definition; - } - - /** - * Attempts to replace defined public (non-static) methods so they all - * redirect to the Mock Object's __call() interceptor - * - * TODO: Add exclusions for partial mock support - */ - protected static function _replacePublicMethod(\ReflectionMethod $method) - { - $body = ''; - $name = $method->getName(); - if ($name !== '__construct' && $method->isPublic()) { - /** - * Purpose of this block is to create an argument array where - * references are preserved (func_get_args() does not preserve - * references) - */ - $body = <<__call('$name', \$args); -BODY; - } - $methodParams = self::_renderPublicMethodParameters($method); - $paramDef = implode(',', $methodParams); - if ($method->isPublic()) { - $access = 'public'; - } elseif($method->isProtected()) { - $access = 'protected'; - } else { - $access = 'private'; - } - if ($method->isStatic()) { - $access .= ' static'; - } - return $access . ' function ' . $name . '(' . $paramDef . ')' - . '{' . $body . '}'; - } - - protected static function _renderPublicMethodParameters(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - if ($class->isInternal()) { // check for parameter overrides for internal PHP classes - $paramMap = \Mockery::getConfiguration() - ->getInternalClassMethodParamMap($class->getName(), $method->getName()); - if (!is_null($paramMap)) return $paramMap; - } - $methodParams = array(); - $params = $method->getParameters(); - foreach ($params as $param) { - $paramDef = ''; - if ($param->isArray()) { - $paramDef .= 'array '; - } elseif ($param->getClass()) { - $paramDef .= $param->getClass()->getName() . ' '; - } - $paramDef .= ($param->isPassedByReference() ? '&' : '') . '$' . $param->getName(); - if ($param->isDefaultValueAvailable()) { - $default = var_export($param->getDefaultValue(), true); - if ($default == '') { - $default = 'null'; - } - $paramDef .= ' = ' . $default; - } else if ($param->isOptional()) { - $paramDef .= ' = null'; - } - - $methodParams[] = $paramDef; - } - return $methodParams; - } - - /** - * Replace abstract protected methods (the only enforceable type outside - * of public methods). The replacement is just a stub that does nothing. - */ - protected static function _replaceProtectedAbstractMethod(\ReflectionMethod $method) - { - $body = ''; - $name = $method->getName(); - $methodParams = array(); - $params = $method->getParameters(); - foreach ($params as $param) { - $paramDef = ''; - if ($param->isArray()) { - $paramDef .= 'array '; - } elseif ($param->getClass()) { - $paramDef .= $param->getClass()->getName() . ' '; - } - $paramDef .= ($param->isPassedByReference() ? '&' : '') . '$' . $param->getName(); - if ($param->isDefaultValueAvailable()) { - $default = var_export($param->getDefaultValue(), true); - if ($default == '') { - $default = 'null'; - } - $paramDef .= ' = ' . $default; - } else if ($param->isOptional()) { - $paramDef .= ' = null'; - } - $methodParams[] = $paramDef; - } - $paramDef = implode(',', $methodParams); - $access = 'protected'; - return $access . ' function ' . $name . '(' . $paramDef . ')' - . '{' . $body . '}'; - } - - /** - * NOTE: The code below is taken from Mockery\Mock and should - * be an exact copy with only one difference - we define the Mockery\Mock - * constructor as a public init method (since the original class - * constructor is often not replaceable, e.g. for interface adherance) - * - * Return a string def of the standard Mock Object API needed for all mocks - * - */ - public static function _getStandardMethods($callTypehint = true, $makeInstanceMock = false) - { - $typehint = $callTypehint ? 'array' : ''; - $std = <<_mockery_name = \$name; - if(is_null(\$container)) { - \$container = new \Mockery\Container; - } - \$this->_mockery_container = \$container; - if (!is_null(\$partialObject)) { - \$this->_mockery_partial = \$partialObject; - } - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) { - if (isset(\$this->_mockery_partial)) { - \$reflected = new \ReflectionObject(\$this->_mockery_partial); - } else { - \$reflected = new \ReflectionClass(\$this->_mockery_name); - } - \$methods = \$reflected->getMethods(\ReflectionMethod::IS_PUBLIC); - foreach (\$methods as \$method) { - if (!\$method->isStatic()) \$this->_mockery_mockableMethods[] = \$method->getName(); - } - } - } - - public function shouldReceive() - { - \$self = \$this; - \$lastExpectation = \Mockery::parseShouldReturnArgs( - \$this, func_get_args(), function(\$method) use (\$self) { - \$director = \$self->mockery_getExpectationsFor(\$method); - if (!\$director) { - \$director = new \Mockery\ExpectationDirector(\$method, \$self); - \$self->mockery_setExpectationsFor(\$method, \$director); - } - \$expectation = new \Mockery\Expectation(\$self, \$method); - \$director->addExpectation(\$expectation); - return \$expectation; - } - ); - return \$lastExpectation; - } - - public function shouldIgnoreMissing() - { - \$this->_mockery_ignoreMissing = true; - } - - public function shouldExpect(Closure \$closure) - { - \$recorder = new \Mockery\Recorder(\$this, \$this->_mockery_partial); - \$this->_mockery_disableExpectationMatching = true; - \$closure(\$recorder); - \$this->_mockery_disableExpectationMatching = false; - return \$this; - } - - public function byDefault() - { - foreach (\$this->_mockery_expectations as \$director) { - \$exps = \$director->getExpectations(); - foreach (\$exps as \$exp) { - \$exp->byDefault(); - } - } - return \$this; - } - - public function __call(\$method, $typehint \$args) - { - if (isset(\$this->_mockery_expectations[\$method]) - && !\$this->_mockery_disableExpectationMatching) { - \$handler = \$this->_mockery_expectations[\$method]; - return \$handler->call(\$args); - } elseif (!is_null(\$this->_mockery_partial) && method_exists(\$this->_mockery_partial, \$method)) { - return call_user_func_array(array(\$this->_mockery_partial, \$method), \$args); - } elseif (\$this->_mockery_ignoreMissing) { - \$return = new \Mockery\Undefined; - return \$return; - } - throw new \BadMethodCallException( - 'Method ' . \$this->_mockery_name . '::' . \$method . '() does not exist on this mock object' - ); - } - - public function mockery_verify() - { - if (\$this->_mockery_verified) return true; - if (isset(\$this->_mockery_ignoreVerification) - && \$this->_mockery_ignoreVerification == true) { - return true; - } - \$this->_mockery_verified = true; - foreach(\$this->_mockery_expectations as \$director) { - \$director->verify(); - } - } - - public function mockery_teardown() - { - - } - - public function mockery_allocateOrder() - { - \$this->_mockery_allocatedOrder += 1; - return \$this->_mockery_allocatedOrder; - } - - public function mockery_setGroup(\$group, \$order) - { - \$this->_mockery_groups[\$group] = \$order; - } - - public function mockery_getGroups() - { - return \$this->_mockery_groups; - } - - public function mockery_setCurrentOrder(\$order) - { - \$this->_mockery_currentOrder = \$order; - return \$this->_mockery_currentOrder; - } - - public function mockery_getCurrentOrder() - { - return \$this->_mockery_currentOrder; - } - - public function mockery_validateOrder(\$method, \$order) - { - if (isset(\$this->_mockery_ignoreVerification) - && \$this->_mockery_ignoreVerification === false) { - return; - } - if (\$order < \$this->_mockery_currentOrder) { - throw new \Mockery\Exception( - 'Method ' . \$this->_mockery_name . '::' . \$method . '()' - . ' called out of order: expected order ' - . \$order . ', was ' . \$this->_mockery_currentOrder - ); - } - \$this->mockery_setCurrentOrder(\$order); - } - - public function mockery_setExpectationsFor(\$method, \Mockery\ExpectationDirector \$director) - { - \$this->_mockery_expectations[\$method] = \$director; - } - - public function mockery_getExpectationsFor(\$method) - { - if (isset(\$this->_mockery_expectations[\$method])) { - return \$this->_mockery_expectations[\$method]; - } - } - - public function mockery_findExpectation(\$method, array \$args) - { - if (!isset(\$this->_mockery_expectations[\$method])) { - return null; - } - \$director = \$this->_mockery_expectations[\$method]; - return \$director->findExpectation(\$args); - } - - public function mockery_getContainer() - { - return \$this->_mockery_container; - } - - public function mockery_getName() - { - return \$this->_mockery_name; - } - - public function mockery_getMockableMethods() - { - return \$this->_mockery_mockableMethods; - } - - public function mockery_getMockableProperties() - { - return \$this->_mockery_mockableProperties; - } - - //** Everything below this line is not copied from/needed for Mockery/Mock **// - - public function __wakeup() - { - /** - * This does not add __wakeup method support. It's a blind method and any - * expected __wakeup work will NOT be performed. It merely cuts off - * annoying errors where a __wakeup exists but is not essential when - * mocking - */ - } - - public static function __callStatic(\$method, $typehint \$args) - { - try { - \$associatedRealObject = \Mockery::fetchMock(__CLASS__); - return \$associatedRealObject->__call(\$method, \$args); - } catch (\BadMethodCallException \$e) { - throw new \BadMethodCallException( - 'Static method ' . \$associatedRealObject->mockery_getName() . '::' . \$method - . '() does not exist on this mock object' - ); - } - } - - public function mockery_getExpectations() - { - return \$this->_mockery_expectations; - } - -MOCK; - /** - * Note: An instance mock allows the declaration of an instantiable class - * which imports cloned expectations from an existing mock object. In effect - * it enables pseudo-overloading of the "new" operator. - */ - if ($makeInstanceMock) { - $mim = <<_mockery_ignoreVerification = false; - \$associatedRealObject = \Mockery::fetchMock(__CLASS__); - \$directors = \$associatedRealObject->mockery_getExpectations(); - foreach (\$directors as \$method=>\$director) { - \$expectations = \$director->getExpectations(); - // get the director method needed - \$existingDirector = \$this->mockery_getExpectationsFor(\$method); - if (!\$existingDirector) { - \$existingDirector = new \Mockery\ExpectationDirector(\$method, \$this); - \$this->mockery_setExpectationsFor(\$method, \$existingDirector); - } - foreach (\$expectations as \$expectation) { - \$clonedExpectation = clone \$expectation; - \$existingDirector->addExpectation(\$clonedExpectation); - } - } - \Mockery::getContainer()->rememberMock(\$this); - } -MOCK; - $std .= $mim; - } - return $std; - } - - -} diff --git a/vendor/mockery/mockery/library/Mockery/Loader.php b/vendor/mockery/mockery/library/Mockery/Loader.php deleted file mode 100644 index a8ed707..0000000 --- a/vendor/mockery/mockery/library/Mockery/Loader.php +++ /dev/null @@ -1,144 +0,0 @@ -register(); - * - * @author Jonathan H. Wage - * @author Roman S. Borschel - * @author Matthew Weier O'Phinney - * @author Kris Wallsmith - * @author Fabien Potencier - */ - -namespace Mockery; - -class Loader -{ - private $_fileExtension = '.php'; - private $_namespace; - private $_includePath; - private $_namespaceSeparator = '\\'; - - /** - * Creates a new Loader that loads classes of the - * specified namespace. - * - * @param string $ns The namespace to use. - */ - public function __construct($ns = 'Mockery', $includePath = null) - { - $this->_namespace = $ns; - $this->_includePath = $includePath; - } - - /** - * Sets the namespace separator used by classes in the namespace of this class loader. - * - * @param string $sep The separator to use. - */ - public function setNamespaceSeparator($sep) - { - $this->_namespaceSeparator = $sep; - } - - /** - * Gets the namespace seperator used by classes in the namespace of this class loader. - * - * @return void - */ - public function getNamespaceSeparator() - { - return $this->_namespaceSeparator; - } - - /** - * Sets the base include path for all class files in the namespace of this class loader. - * - * @param string $includePath - */ - public function setIncludePath($includePath) - { - $this->_includePath = $includePath; - } - - /** - * Gets the base include path for all class files in the namespace of this class loader. - * - * @return string $includePath - */ - public function getIncludePath() - { - return $this->_includePath; - } - - /** - * Sets the file extension of class files in the namespace of this class loader. - * - * @param string $fileExtension - */ - public function setFileExtension($fileExtension) - { - $this->_fileExtension = $fileExtension; - } - - /** - * Gets the file extension of class files in the namespace of this class loader. - * - * @return string $fileExtension - */ - public function getFileExtension() - { - return $this->_fileExtension; - } - - /** - * Installs this class loader on the SPL autoload stack. - * - * @param bool $prepend If true, prepend autoloader on the autoload stack - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Uninstalls this class loader from the SPL autoloader stack. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $className The name of the class to load. - * @return void - */ - public function loadClass($className) - { - if ($className === 'Mockery') { - require 'Mockery.php'; - return; - } - if (null === $this->_namespace - || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) { - $fileName = ''; - $namespace = ''; - if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { - $namespace = substr($className, 0, $lastNsPos); - $className = substr($className, $lastNsPos + 1); - $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; - } - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; - require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php deleted file mode 100644 index 70ace61..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php +++ /dev/null @@ -1,47 +0,0 @@ -'; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php deleted file mode 100644 index 1feff41..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php +++ /dev/null @@ -1,63 +0,0 @@ -_expected = $expected; - } - - /** - * Check if the actual value does not match the expected (in this - * case it's specifically NOT expected). - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - foreach ($this->_expected as $exp) { - if ($actual === $exp || $actual == $exp) { - return true; - } - } - return false; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php b/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php deleted file mode 100644 index e063eec..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php +++ /dev/null @@ -1,49 +0,0 @@ -_expected; - $result = $closure($actual); - return $result === true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php deleted file mode 100644 index f641af3..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php +++ /dev/null @@ -1,66 +0,0 @@ -_expected as $exp) { - $match = false; - foreach ($values as $val) { - if ($exp === $val || $exp == $val) { - $match = true; - break; - } - } - if ($match === false) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected as $v) { - $elements[] = (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php deleted file mode 100644 index 10c57b8..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php +++ /dev/null @@ -1,55 +0,0 @@ -_expected as $method) { - if (!method_exists($actual, $method)) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '_expected) . ']>'; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php deleted file mode 100644 index fb6ad42..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php +++ /dev/null @@ -1,48 +0,0 @@ -_expected, array_keys($actual)); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected . ']>'; - return $return; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php deleted file mode 100644 index de0e954..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php +++ /dev/null @@ -1,48 +0,0 @@ -_expected, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected . ']>'; - return $return; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php deleted file mode 100644 index 1fff83c..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php +++ /dev/null @@ -1,60 +0,0 @@ -_expected = $expected; - } - - /** - * Check if the actual value matches the expected. - * Actual passed by reference to preserve reference trail (where applicable) - * back to the original method parameter. - * - * @param mixed $actual - * @return bool - */ - public abstract function match(&$actual); - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public abstract function __toString(); - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php deleted file mode 100644 index 457d25d..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php +++ /dev/null @@ -1,51 +0,0 @@ -_expected === $actual; - } else { - return $this->_expected == $actual; - } - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php deleted file mode 100644 index db83e13..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php +++ /dev/null @@ -1,48 +0,0 @@ -_expected; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php deleted file mode 100644 index ec5d788..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php +++ /dev/null @@ -1,63 +0,0 @@ -_expected = $expected; - } - - /** - * Check if the actual value does not match the expected (in this - * case it's specifically NOT expected). - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - foreach ($this->_expected as $exp) { - if ($actual === $exp || $actual == $exp) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php deleted file mode 100644 index 3fd4315..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php +++ /dev/null @@ -1,61 +0,0 @@ -_expected as $k=>$v) { - if (!isset($actual[$k])) { - return false; - } - if ($actual[$k] !== $v) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected as $k=>$v) { - $elements[] = $k . '=' . (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php deleted file mode 100644 index 3412107..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php +++ /dev/null @@ -1,54 +0,0 @@ -_expected); - if (function_exists($function)) { - return $function($actual); - } elseif (is_string($this->_expected) - && (class_exists($this->_expected) || interface_exists($this->_expected))) { - return $actual instanceof $this->_expected; - } - return false; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<' . ucfirst($this->_expected) . '>'; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/Mock.php b/vendor/mockery/mockery/library/Mockery/Mock.php deleted file mode 100644 index 47a0947..0000000 --- a/vendor/mockery/mockery/library/Mockery/Mock.php +++ /dev/null @@ -1,408 +0,0 @@ -_mockery_name = $name; - if(is_null($container)) { - $container = new \Mockery\Container; - } - $this->_mockery_container = $container; - if (!is_null($partialObject)) { - $this->_mockery_partial = $partialObject; - } - } - - /** - * Set expected method calls - * - * @param mixed - * @return \Mockery\Expectation - */ - public function shouldReceive() - { - $self = $this; - $lastExpectation = \Mockery::parseShouldReturnArgs( - $this, func_get_args(), function($method) use ($self) { - $director = $self->mockery_getExpectationsFor($method); - if (!$director) { - $director = new \Mockery\ExpectationDirector($method, $self); - $self->mockery_setExpectationsFor($method, $director); - } - $expectation = new \Mockery\Expectation($self, $method); - $director->addExpectation($expectation); - return $expectation; - } - ); - return $lastExpectation; - } - - /** - * Set mock to ignore unexpected methods and return Undefined class - * - * @return void - */ - public function shouldIgnoreMissing() - { - $this->_mockery_ignoreMissing = true; - } - - /** - * Accepts a closure which is executed with an object recorder which proxies - * to the partial source object. The intent being to record the - * interactions of a concrete object as a set of expectations on the - * current mock object. The partial may then be passed to a second process - * to see if it fulfils the same (or exact same) contract as the original. - * - * @param Closure $closure - */ - public function shouldExpect(Closure $closure) - { - $recorder = new \Mockery\Recorder($this, $this->_mockery_partial); - $this->_mockery_disableExpectationMatching = true; - $closure($recorder); - $this->_mockery_disableExpectationMatching = false; - return $this; - } - - /** - * In the event shouldReceive() accepting one or more methods/returns, - * this method will switch them from normal expectations to default - * expectations - * - * @return self - */ - public function byDefault() - { - foreach ($this->_mockery_expectations as $director) { - $exps = $director->getExpectations(); - foreach ($exps as $exp) { - $exp->byDefault(); - } - } - return $this; - } - - /** - * Capture calls to this mock - */ - public function __call($method, array $args) - { - if (isset($this->_mockery_expectations[$method]) - && !$this->_mockery_disableExpectationMatching) { - $handler = $this->_mockery_expectations[$method]; - return $handler->call($args); - } elseif (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) { - return call_user_func_array(array($this->_mockery_partial, $method), $args); - } elseif ($this->_mockery_ignoreMissing) { - $return = new \Mockery\Undefined; - return $return; - } - throw new \BadMethodCallException( - 'Method ' . $this->_mockery_name . '::' . $method . '() does not exist on this mock object' - ); - } - - /**public function __set($name, $value) - { - $this->_mockery_mockableProperties[$name] = $value; - return $this; - } - - public function __get($name) - { - if (isset($this->_mockery_mockableProperties[$name])) { - return $this->_mockery_mockableProperties[$name]; - } elseif(isset($this->{$name})) { - return $this->{$name}; - } - throw new \InvalidArgumentException ( - 'Property ' . $this->_mockery_name . '::' . $name . ' does not exist on this mock object' - ); - }**/ - - /** - * Iterate across all expectation directors and validate each - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function mockery_verify() - { - if ($this->_mockery_verified) return true; - $this->_mockery_verified = true; - foreach($this->_mockery_expectations as $director) { - $director->verify(); - } - } - - /** - * Tear down tasks for this mock - * - * @return void - */ - public function mockery_teardown() - { - - } - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder() - { - $this->_mockery_allocatedOrder += 1; - return $this->_mockery_allocatedOrder; - } - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order) - { - $this->_mockery_groups[$group] = $order; - } - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups() - { - return $this->_mockery_groups; - } - - /** - * Set current ordered number - * - * @param int $order - */ - public function mockery_setCurrentOrder($order) - { - $this->_mockery_currentOrder = $order; - return $this->_mockery_currentOrder; - } - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder() - { - return $this->_mockery_currentOrder; - } - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order) - { - if ($order < $this->_mockery_currentOrder) { - throw new \Mockery\Exception( - 'Method ' . $this->_mockery_name . '::' . $method . '()' - . ' called out of order: expected order ' - . $order . ', was ' . $this->_mockery_currentOrder - ); - } - $this->mockery_setCurrentOrder($order); - } - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director) - { - $this->_mockery_expectations[$method] = $director; - } - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_getExpectationsFor($method) - { - if (isset($this->_mockery_expectations[$method])) { - return $this->_mockery_expectations[$method]; - } - } - - /** - * Find an expectation matching the given method and arguments - * - * @var string $method - * @var array $args - * @return \Mockery\Expectation|null - */ - public function mockery_findExpectation($method, array $args) - { - if (!isset($this->_mockery_expectations[$method])) { - return null; - } - $director = $this->_mockery_expectations[$method]; - return $director->findExpectation($args); - } - - /** - * Return the container for this mock - * - * @return \Mockery\Container - */ - public function mockery_getContainer() - { - return $this->_mockery_container; - } - - /** - * Return the name for this mock - * - * @return string - */ - public function mockery_getName() - { - return $this->_mockery_name; - } - - public function mockery_getMockableProperties() - { - return $this->_mockery_mockableProperties; - } - -} diff --git a/vendor/mockery/mockery/library/Mockery/MockInterface.php b/vendor/mockery/mockery/library/Mockery/MockInterface.php deleted file mode 100644 index 5ce799d..0000000 --- a/vendor/mockery/mockery/library/Mockery/MockInterface.php +++ /dev/null @@ -1,174 +0,0 @@ -_mock = $mock; - $this->_subject = $subject; - } - - /** - * Sets the recorded into strict mode where method calls are more strictly - * matched against the argument and call count and ordering is also - * set as enforceable. - * - * @return void - */ - public function shouldBeStrict() - { - $this->_strict = true; - } - - /** - * Intercept all calls on the subject, and use the call details to create - * a new expectation. The actual return value is then returned after being - * recorded. - * - * @param string $method - * @param array $args - * @return mixed - */ - public function __call($method, array $args) - { - $return = call_user_func_array(array($this->_subject, $method), $args); - $expectation = $this->_mock->shouldReceive($method)->andReturn($return); - if ($this->_strict) { - $exactArgs = array(); - foreach ($args as $arg) { - $exactArgs[] = \Mockery::mustBe($arg); - } - $expectation->once()->ordered(); - call_user_func_array(array($expectation, 'with'), $exactArgs); - } else { - call_user_func_array(array($expectation, 'with'), $args); - } - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Undefined.php b/vendor/mockery/mockery/library/Mockery/Undefined.php deleted file mode 100644 index 3b7dc9d..0000000 --- a/vendor/mockery/mockery/library/Mockery/Undefined.php +++ /dev/null @@ -1,38 +0,0 @@ - - - Mockery - pear.survivethedeepend.com - Mockery is a simple yet flexible mock object framework for use in unit testing. - Mockery is a simple yet flexible mock object framework for use in unit testing. - - Padraic Brady - padraic - padraic.brady@yahoo.com - yes - - 2012-01-24 - - - 0.7.2 - 0.7.2 - - - stable - stable - - BSD - http://github.com/padraic/mockery#readme - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5.3.0 - - - 1.4.0 - - - - - Hamcrest - hamcrest.googlecode.com/svn/pear - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/mockery/mockery/tests/Bootstrap.php b/vendor/mockery/mockery/tests/Bootstrap.php deleted file mode 100644 index dd0516b..0000000 --- a/vendor/mockery/mockery/tests/Bootstrap.php +++ /dev/null @@ -1,78 +0,0 @@ -=')) { - - /* - * Add Mutateme library/ directory to the PHPUnit code coverage - * whitelist. This has the effect that only production code source files - * appear in the code coverage report and that all production code source - * files, even those that are not covered by a test yet, are processed. - */ - PHPUnit_Util_Filter::addDirectoryToWhitelist($library); - - /* - * Omit from code coverage reports the contents of the tests directory - */ - foreach (array('.php', '.phtml', '.csv', '.inc') as $suffix) { - PHPUnit_Util_Filter::addDirectoryToFilter($tests, $suffix); - } - PHPUnit_Util_Filter::addDirectoryToFilter(PEAR_INSTALL_DIR); - PHPUnit_Util_Filter::addDirectoryToFilter(PHP_LIBDIR); -} - -require_once 'Mockery/Loader.php'; -$loader = new \Mockery\Loader; -$loader->register(); -require_once 'Hamcrest/Hamcrest.php'; - -/* - * Unset global variables that are no longer needed. - */ -unset($root, $library, $tests, $path); - diff --git a/vendor/mockery/mockery/tests/Mockery/AdhocTest.php b/vendor/mockery/mockery/tests/Mockery/AdhocTest.php deleted file mode 100644 index 925204e..0000000 --- a/vendor/mockery/mockery/tests/Mockery/AdhocTest.php +++ /dev/null @@ -1,46 +0,0 @@ -container = new \Mockery\Container; - } - - public function teardown() - { - $this->container->mockery_close(); - } - - public function testSimplestMockCreation() - { - $m = $this->container->mock('MockeryTest_NameOfExistingClass'); - $this->assertTrue($m instanceof MockeryTest_NameOfExistingClass); - } - -} - -class MockeryTest_NameOfExistingClass {} diff --git a/vendor/mockery/mockery/tests/Mockery/ContainerTest.php b/vendor/mockery/mockery/tests/Mockery/ContainerTest.php deleted file mode 100644 index 322620f..0000000 --- a/vendor/mockery/mockery/tests/Mockery/ContainerTest.php +++ /dev/null @@ -1,757 +0,0 @@ -container = new \Mockery\Container; - } - - public function teardown() - { - $this->container->mockery_close(); - } - - public function testSimplestMockCreation() - { - $m = $this->container->mock(); - $m->shouldReceive('foo')->andReturn('bar'); - $this->assertEquals('bar', $m->foo()); - } - - public function testNamedMocksAddNameToExceptions() - { - $m = $this->container->mock('Foo'); - $m->shouldReceive('foo')->with(1)->andReturn('bar'); - try { - $m->foo(); - } catch (\Mockery\Exception $e) { - $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage())); - } - } - - public function testSimpleMockWithArrayDefs() - { - $m = $this->container->mock(array('foo'=>1,'bar'=>2)); - $this->assertEquals(1, $m->foo()); - $this->assertEquals(2, $m->bar()); - } - - public function testNamedMockWithArrayDefs() - { - $m = $this->container->mock('Foo', array('foo'=>1,'bar'=>2)); - $this->assertEquals(1, $m->foo()); - $this->assertEquals(2, $m->bar()); - try { - $m->f(); - } catch (BadMethodCallException $e) { - $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage())); - } - } - - public function testMockingAKnownConcreteClassSoMockInheritsClassType() - { - $m = $this->container->mock('stdClass'); - $m->shouldReceive('foo')->andReturn('bar'); - $this->assertEquals('bar', $m->foo()); - $this->assertTrue($m instanceof stdClass); - } - - public function testMockingAKnownUserClassSoMockInheritsClassType() - { - $m = $this->container->mock('MockeryTest_TestInheritedType'); - $this->assertTrue($m instanceof MockeryTest_TestInheritedType); - } - - public function testMockingAConcreteObjectCreatesAPartialWithoutError() - { - $m = $this->container->mock(new stdClass); - $m->shouldReceive('foo')->andReturn('bar'); - $this->assertEquals('bar', $m->foo()); - $this->assertTrue($m instanceof stdClass); - } - - public function testCreatingAPartialAllowsDynamicExpectationsAndPassesThroughUnexpectedMethods() - { - $m = $this->container->mock(new MockeryTestFoo); - $m->shouldReceive('bar')->andReturn('bar'); - $this->assertEquals('bar', $m->bar()); - $this->assertEquals('foo', $m->foo()); - $this->assertTrue($m instanceof MockeryTestFoo); - } - - public function testCreatingAPartialAllowsExpectationsToInterceptCallsToImplementedMethods() - { - $m = $this->container->mock(new MockeryTestFoo2); - $m->shouldReceive('bar')->andReturn('baz'); - $this->assertEquals('baz', $m->bar()); - $this->assertEquals('foo', $m->foo()); - $this->assertTrue($m instanceof MockeryTestFoo2); - } - - public function testBlockForwardingToPartialObject() - { - $m = $this->container->mock(new MockeryTestBar1, array('foo'=>1, \Mockery\Container::BLOCKS => array('method1'))); - $this->assertSame($m, $m->method1()); - } - - public function testPartialWithArrayDefs() - { - $m = $this->container->mock(new MockeryTestBar1, array('foo'=>1, \Mockery\Container::BLOCKS => array('method1'))); - $this->assertEquals(1, $m->foo()); - } - - public function testPassingClosureAsFinalParameterUsedToDefineExpectations() - { - $m = $this->container->mock('foo', function($m) { - $m->shouldReceive('foo')->once()->andReturn('bar'); - }); - $this->assertEquals('bar', $m->foo()); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testMockingAKnownConcreteFinalClassThrowsErrors_OnlyPartialMocksCanMockFinalElements() - { - $m = $this->container->mock('MockeryFoo3'); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testMockingAKnownConcreteClassWithFinalMethodsThrowsErrors_OnlyPartialMocksCanMockFinalElements() - { - $m = $this->container->mock('MockeryFoo4'); - } - - /** - * @group finalclass - */ - public function testFinalClassesCanBePartialMocks() - { - $m = $this->container->mock(new MockeryFoo3); - $m->shouldReceive('foo')->andReturn('baz'); - $this->assertEquals('baz', $m->foo()); - $this->assertFalse($m instanceof MockeryFoo3); - } - - public function testClassesWithFinalMethodsCanBePartialMocks() - { - $m = $this->container->mock(new MockeryFoo4); - $m->shouldReceive('foo')->andReturn('baz'); - $this->assertEquals('baz', $m->foo()); - $this->assertEquals('bar', $m->bar()); - $this->assertFalse($m instanceof MockeryFoo4); - } - - public function testCanMockInterface() - { - $m = $this->container->mock('MockeryTest_Interface'); - $this->assertTrue($m instanceof MockeryTest_Interface); - } - - public function testCanMockSpl() - { - $m = $this->container->mock('\\splFileObject'); - $this->assertTrue($m instanceof \splFileObject); - } - - public function testCanMockInterfaceWithAbstractMethod() - { - $m = $this->container->mock('MockeryTest_InterfaceWithAbstractMethod'); - $this->assertTrue($m instanceof MockeryTest_InterfaceWithAbstractMethod); - $m->shouldReceive('foo')->andReturn(1); - $this->assertEquals(1, $m->foo()); - } - - public function testCanMockAbstractWithAbstractProtectedMethod() - { - $m = $this->container->mock('MockeryTest_AbstractWithAbstractMethod'); - $this->assertTrue($m instanceof MockeryTest_AbstractWithAbstractMethod); - } - - public function testCanMockClassWithConstructor() - { - $m = $this->container->mock('MockeryTest_ClassConstructor'); - $this->assertTrue($m instanceof MockeryTest_ClassConstructor); - } - - public function testCanMockClassWithConstructorNeedingClassArgs() - { - $m = $this->container->mock('MockeryTest_ClassConstructor2'); - $this->assertTrue($m instanceof MockeryTest_ClassConstructor2); - } - - /** - * @group partial - */ - public function testCanPartiallyMockANormalClass() - { - $m = $this->container->mock('MockeryTest_PartialNormalClass[foo]'); - $this->assertTrue($m instanceof MockeryTest_PartialNormalClass); - $m->shouldReceive('foo')->andReturn('cba'); - $this->assertEquals('abc', $m->bar()); - $this->assertEquals('cba', $m->foo()); - } - - /** - * @group partial - */ - public function testCanPartiallyMockAnAbstractClass() - { - $m = $this->container->mock('MockeryTest_PartialAbstractClass[foo]'); - $this->assertTrue($m instanceof MockeryTest_PartialAbstractClass); - $m->shouldReceive('foo')->andReturn('cba'); - $this->assertEquals('abc', $m->bar()); - $this->assertEquals('cba', $m->foo()); - } - - /** - * @group partial - */ - public function testCanPartiallyMockANormalClassWith2Methods() - { - $m = $this->container->mock('MockeryTest_PartialNormalClass2[foo, baz]'); - $this->assertTrue($m instanceof MockeryTest_PartialNormalClass2); - $m->shouldReceive('foo')->andReturn('cba'); - $m->shouldReceive('baz')->andReturn('cba'); - $this->assertEquals('abc', $m->bar()); - $this->assertEquals('cba', $m->foo()); - $this->assertEquals('cba', $m->baz()); - } - - /** - * @group partial - */ - public function testCanPartiallyMockAnAbstractClassWith2Methods() - { - $m = $this->container->mock('MockeryTest_PartialAbstractClass2[foo,baz]'); - $this->assertTrue($m instanceof MockeryTest_PartialAbstractClass2); - $m->shouldReceive('foo')->andReturn('cba'); - $m->shouldReceive('baz')->andReturn('cba'); - $this->assertEquals('abc', $m->bar()); - $this->assertEquals('cba', $m->foo()); - $this->assertEquals('cba', $m->baz()); - } - - /** - * @expectedException \Mockery\Exception - * @group partial - */ - public function testThrowsExceptionIfSettingExpectationForNonMockedMethodOfPartialMock() - { - $this->markTestSkipped('For now...'); - $m = $this->container->mock('MockeryTest_PartialNormalClass[foo]'); - $this->assertTrue($m instanceof MockeryTest_PartialNormalClass); - $m->shouldReceive('bar')->andReturn('cba'); - } - - /** - * @expectedException \Mockery\Exception - * @group partial - */ - public function testThrowsExceptionIfClassOrInterfaceForPartialMockDoesNotExist() - { - $m = $this->container->mock('MockeryTest_PartialNormalClassXYZ[foo]'); - } - - /** - * @group issue/4 - */ - public function testCanMockClassContainingMagicCallMethod() - { - $m = $this->container->mock('MockeryTest_Call1'); - $this->assertTrue($m instanceof MockeryTest_Call1); - } - - /** - * @group issue/4 - */ - public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting() - { - $m = $this->container->mock('MockeryTest_Call2'); - $this->assertTrue($m instanceof MockeryTest_Call2); - } - - /** - * @group issue/14 - */ - public function testCanMockClassContainingAPublicWakeupMethod() - { - $m = $this->container->mock('MockeryTest_Wakeup1'); - $this->assertTrue($m instanceof MockeryTest_Wakeup1); - } - - /** - * @group issue/18 - */ - public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods() - { - $m = \Mockery::mock('Gateway'); - $m->shouldReceive('iDoSomethingReallyCoolHere'); - $m->iDoSomethingReallyCoolHere(); - } - - /** - * @group issue/18 - */ - public function testCanPartialMockObjectUsingMagicCallMethodsInPlaceOfNormalMethods() - { - $m = \Mockery::mock(new Gateway); - $m->shouldReceive('iDoSomethingReallyCoolHere'); - $m->iDoSomethingReallyCoolHere(); - } - - /** - * @group issue/13 - */ - public function testCanMockClassWhereMethodHasReferencedParameter() - { - $m = \Mockery::mock(new MockeryTest_MethodParamRef); - } - - /** - * @group issue/13 - */ - public function testCanPartiallyMockObjectWhereMethodHasReferencedParameter() - { - $m = \Mockery::mock(new MockeryTest_MethodParamRef2); - } - - /** - * @group issue/11 - */ - public function testMockingAKnownConcreteClassCanBeGrantedAnArbitraryClassType() - { - $m = $this->container->mock('alias:MyNamespace\MyClass'); - $m->shouldReceive('foo')->andReturn('bar'); - $this->assertEquals('bar', $m->foo()); - $this->assertTrue($m instanceof MyNamespace\MyClass); - } - - /** - * @group issue/15 - */ - public function testCanMockMultipleInterfaces() - { - $m = $this->container->mock('MockeryTest_Interface1, MockeryTest_Interface2'); - $this->assertTrue($m instanceof MockeryTest_Interface1); - $this->assertTrue($m instanceof MockeryTest_Interface2); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testMockingMultipleInterfacesThrowsExceptionWhenGivenNonExistingClassOrInterface() - { - $m = $this->container->mock('DoesNotExist, MockeryTest_Interface2'); - $this->assertTrue($m instanceof MockeryTest_Interface1); - $this->assertTrue($m instanceof MockeryTest_Interface2); - } - - /** - * @group issue/15 - */ - public function testCanMockClassAndApplyMultipleInterfaces() - { - $m = $this->container->mock('MockeryTestFoo, MockeryTest_Interface1, MockeryTest_Interface2'); - $this->assertTrue($m instanceof MockeryTestFoo); - $this->assertTrue($m instanceof MockeryTest_Interface1); - $this->assertTrue($m instanceof MockeryTest_Interface2); - } - - /** - * @group issue/7 - * - * Noted: We could complicate internally, but a blind class is better built - * with a real class noted up front (stdClass is a perfect choice it is - * behaviourless). Fine, it's a muddle - but we need to draw a line somewhere. - */ - public function testCanMockStaticMethods() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('alias:MyNamespace\MyClass2'); - $m->shouldReceive('staticFoo')->andReturn('bar'); - $this->assertEquals('bar', \MyNameSpace\MyClass2::staticFoo()); - \Mockery::resetContainer(); - } - - /** - * @group issue/7 - * @expectedException \Mockery\CountValidator\Exception - */ - public function testMockedStaticMethodsObeyMethodCounting() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('alias:MyNamespace\MyClass3'); - $m->shouldReceive('staticFoo')->once()->andReturn('bar'); - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - /** - * @expectedException BadMethodCallException - */ - public function testMockedStaticThrowsExceptionWhenMethodDoesNotExist(){ - \Mockery::setContainer($this->container); - $m = $this->container->mock('alias:MyNamespace\StaticNoMethod'); - $this->assertEquals('bar', \MyNameSpace\StaticNoMethod::staticFoo()); - \Mockery::resetContainer(); - } - - /** - * @group issue/17 - */ - public function testMockingAllowsPublicPropertyStubbingOnRealClass() - { - $m = $this->container->mock('MockeryTestFoo'); - $m->foo = 'bar'; - $this->assertEquals('bar', $m->foo); - //$this->assertTrue(array_key_exists('foo', $m->mockery_getMockableProperties())); - } - - /** - * @group issue/17 - */ - public function testMockingAllowsPublicPropertyStubbingOnNamedMock() - { - $m = $this->container->mock('Foo'); - $m->foo = 'bar'; - $this->assertEquals('bar', $m->foo); - //$this->assertTrue(array_key_exists('foo', $m->mockery_getMockableProperties())); - } - - /** - * @group issue/17 - */ - public function testMockingAllowsPublicPropertyStubbingOnPartials() - { - $m = $this->container->mock(new stdClass); - $m->foo = 'bar'; - $this->assertEquals('bar', $m->foo); - //$this->assertTrue(array_key_exists('foo', $m->mockery_getMockableProperties())); - } - - /** - * @group issue/17 - */ - public function testMockingDoesNotStubNonStubbedPropertiesOnPartials() - { - $m = $this->container->mock(new MockeryTest_ExistingProperty); - $this->assertEquals('bar', $m->foo); - $this->assertFalse(array_key_exists('foo', $m->mockery_getMockableProperties())); - } - - public function testCreationOfInstanceMock() - { - $m = $this->container->mock('overload:MyNamespace\MyClass4'); - $this->assertTrue($m instanceof \MyNamespace\MyClass4); - } - - public function testInstantiationOfInstanceMock() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('overload:MyNamespace\MyClass5'); - $instance = new \MyNamespace\MyClass5; - $this->assertTrue($instance instanceof \MyNamespace\MyClass5); - \Mockery::resetContainer(); - } - - public function testInstantiationOfInstanceMockImportsExpectations() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('overload:MyNamespace\MyClass6'); - $m->shouldReceive('foo')->andReturn('bar'); - $instance = new \MyNamespace\MyClass6; - $this->assertEquals('bar', $instance->foo()); - \Mockery::resetContainer(); - } - - public function testInstantiationOfInstanceMocksIgnoresVerificationOfOriginMock() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('overload:MyNamespace\MyClass7'); - $m->shouldReceive('foo')->once()->andReturn('bar'); - $this->container->mockery_verify(); - \Mockery::resetContainer(); //should not throw an exception - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testInstantiationOfInstanceMocksAddsThemToContainerForVerification() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('overload:MyNamespace\MyClass8'); - $m->shouldReceive('foo')->once(); - $instance = new \MyNamespace\MyClass8; - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - public function testInstantiationOfInstanceMocksDoesNotHaveCountValidatorCrossover() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('overload:MyNamespace\MyClass9'); - $m->shouldReceive('foo')->once(); - $instance1 = new \MyNamespace\MyClass9; - $instance2 = new \MyNamespace\MyClass9; - $instance1->foo(); - $instance2->foo(); - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testInstantiationOfInstanceMocksDoesNotHaveCountValidatorCrossover2() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('overload:MyNamespace\MyClass10'); - $m->shouldReceive('foo')->once(); - $instance1 = new \MyNamespace\MyClass10; - $instance2 = new \MyNamespace\MyClass10; - $instance1->foo(); - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - public function testMethodParamsPassedByReferenceHaveReferencePreserved() - { - $m = $this->container->mock('MockeryTestRef1'); - $m->shouldReceive('foo')->with( - \Mockery::on(function(&$a) {$a += 1;return true;}), - \Mockery::any() - ); - $a = 1; - $b = 1; - $m->foo($a, $b); - $this->assertEquals(2, $a); - $this->assertEquals(1, $b); - } - - public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs() - { - if (!class_exists('MongoCollection', false)) $this->markTestSkipped('ext/mongo not installed'); - \Mockery::getConfiguration()->setInternalClassMethodParamMap( - 'MongoCollection', 'insert', array('&$data', '$options') - ); - $m = $this->container->mock('MongoCollection'); - $m->shouldReceive('insert')->with( - \Mockery::on(function(&$data) {$data['_id'] = 123; return true;}), - \Mockery::type('array') - ); - $data = array('a'=>1,'b'=>2); - $m->insert($data, array()); - $this->assertTrue(isset($data['_id'])); - $this->assertEquals(123, $data['_id']); - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - /** - * @group abstract - */ - public function testCanMockAbstractClassWithAbstractPublicMethod() - { - $m = $this->container->mock('MockeryTest_AbstractWithAbstractPublicMethod'); - $this->assertTrue($m instanceof MockeryTest_AbstractWithAbstractPublicMethod); - } - - /** - * @issue issue/21 - */ - public function testClassDeclaringIssetDoesNotThrowException() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('MockeryTest_IssetMethod'); - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - /** - * @issue issue/21 - */ - public function testClassDeclaringUnsetDoesNotThrowException() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('MockeryTest_UnsetMethod'); - $this->container->mockery_verify(); - \Mockery::resetContainer(); - } - - /** - * @issue issue/35 - */ - public function testCallingSelfOnlyReturnsLastMockCreatedOrCurrentMockBeingProgrammedSinceTheyAreOneAndTheSame() - { - \Mockery::setContainer($this->container); - $m = $this->container->mock('MockeryTestFoo'); - $this->assertFalse($this->container->self() instanceof MockeryTestFoo2); - //$m = $this->container->mock('MockeryTestFoo2'); - //$this->assertTrue($this->container->self() instanceof MockeryTestFoo2); - //$m = $this->container->mock('MockeryTestFoo'); - //$this->assertFalse(\Mockery::self() instanceof MockeryTestFoo2); - //$this->assertTrue(\Mockery::self() instanceof MockeryTestFoo); - \Mockery::resetContainer(); - } - -} - -class MockeryTest_IssetMethod -{ - protected $_properties = array(); - public function __construct() {} - public function __isset($property=null) { - return isset($this->_properties[$property]); - } -} - -class MockeryTest_UnsetMethod -{ - protected $_properties = array(); - public function __construct() {} - public function __unset($property) { - unset($this->_properties[$property]); - } -} - -class MockeryTestFoo { - public function foo() { return 'foo'; } -} - -class MockeryTestFoo2 { - public function foo() { return 'foo'; } - public function bar() { return 'bar'; } -} - -final class MockeryFoo3 { - public function foo() { return 'baz'; } -} - -class MockeryFoo4 { - final public function foo() { return 'baz'; } - public function bar() { return 'bar'; } -} - -interface MockeryTest_Interface {} -interface MockeryTest_Interface1 {} -interface MockeryTest_Interface2 {} - -interface MockeryTest_InterfaceWithAbstractMethod -{ - public function set(); -} - -abstract class MockeryTest_AbstractWithAbstractMethod -{ - abstract protected function set(); -} - -class MockeryTest_ClassConstructor { - public function __construct($param1) {} -} - -class MockeryTest_ClassConstructor2 { - public function __construct(stdClass $param1) {} -} - -class MockeryTest_Call1 { - public function __call($method, array $params) {} -} - -class MockeryTest_Call2 { - public function __call($method, $params) {} -} - -class MockeryTest_Wakeup1 { - public function __construct() {} - public function __wakeup() {} -} - -class MockeryTest_ExistingProperty { - public $foo = 'bar'; -} -abstract class MockeryTest_AbstractWithAbstractPublicMethod{ - abstract public function foo($a, $b); -} - -// issue/18 -class SoCool -{ - public function iDoSomethingReallyCoolHere() - { - return 3; - } -} -class Gateway -{ - public function __call($method, $args) - { - $m = new SoCool(); - return call_user_func_array(array($m, $method), $args); - } -} - -class MockeryTestBar1 { - public function method1() - { - return $this; - } -} - -class MockeryTest_MethodParamRef { - public function method1(&$foo){return true;} -} -class MockeryTest_MethodParamRef2 { - public function method1(&$foo){return true;} -} -class MockeryTestRef1 { - public function foo(&$a, $b) {} -} - -class MockeryTest_PartialNormalClass { - public function foo() {return 'abc';} - public function bar() {return 'abc';} -} - -abstract class MockeryTest_PartialAbstractClass { - abstract public function foo(); - public function bar() {return 'abc';} -} - -class MockeryTest_PartialNormalClass2 { - public function foo() {return 'abc';} - public function bar() {return 'abc';} - public function baz() {return 'abc';} -} - -abstract class MockeryTest_PartialAbstractClass2 { - abstract public function foo(); - public function bar() {return 'abc';} - abstract public function baz(); -} - -class MockeryTest_TestInheritedType {} diff --git a/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php deleted file mode 100644 index 6a4685a..0000000 --- a/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php +++ /dev/null @@ -1,1643 +0,0 @@ -container = new \Mockery\Container; - $this->mock = $this->container->mock('foo'); - } - - public function teardown() - { - \Mockery::getConfiguration()->allowMockingNonExistentMethods(true); - $this->container->mockery_close(); - } - - public function testReturnsNullWhenNoArgs() - { - $this->mock->shouldReceive('foo'); - $this->assertNull($this->mock->foo()); - } - - public function testReturnsNullWhenSingleArg() - { - $this->mock->shouldReceive('foo'); - $this->assertNull($this->mock->foo(1)); - } - - public function testReturnsNullWhenManyArgs() - { - $this->mock->shouldReceive('foo'); - $this->assertNull($this->mock->foo('foo', array(), new stdClass)); - } - - public function testReturnsSameValueForAllIfNoArgsExpectationAndNoneGiven() - { - $this->mock->shouldReceive('foo')->andReturn(1); - $this->assertEquals(1, $this->mock->foo()); - } - - public function testSetsPublicPropertyWhenRequested() - { - $this->mock->shouldReceive('foo')->andSet('bar', 'baz'); - $this->mock->foo(); - $this->assertEquals('baz', $this->mock->bar); - } - - public function testSetsPublicPropertyWhenRequestedUsingAlias() - { - $this->mock->shouldReceive('foo')->set('bar', 'baz'); - $this->mock->foo(); - $this->assertEquals('baz', $this->mock->bar); - } - - public function testReturnsSameValueForAllIfNoArgsExpectationAndSomeGiven() - { - $this->mock->shouldReceive('foo')->andReturn(1); - $this->assertEquals(1, $this->mock->foo('foo')); - } - - public function testReturnsValueFromSequenceSequentially() - { - $this->mock->shouldReceive('foo')->andReturn(1, 2, 3); - $this->mock->foo('foo'); - $this->assertEquals(2, $this->mock->foo('foo')); - } - - public function testReturnsValueFromSequenceSequentiallyAndRepeatedlyReturnsFinalValueOnExtraCalls() - { - $this->mock->shouldReceive('foo')->andReturn(1, 2, 3); - $this->mock->foo('foo'); - $this->mock->foo('foo'); - $this->assertEquals(3, $this->mock->foo('foo')); - $this->assertEquals(3, $this->mock->foo('foo')); - } - - public function testReturnsValueFromSequenceSequentiallyAndRepeatedlyReturnsFinalValueOnExtraCallsWithManyAndReturnCalls() - { - $this->mock->shouldReceive('foo')->andReturn(1)->andReturn(2, 3); - $this->mock->foo('foo'); - $this->mock->foo('foo'); - $this->assertEquals(3, $this->mock->foo('foo')); - $this->assertEquals(3, $this->mock->foo('foo')); - } - - public function testReturnsValueOfClosure() - { - $this->mock->shouldReceive('foo')->with(5)->andReturnUsing(function($v){return $v+1;}); - $this->assertEquals(6, $this->mock->foo(5)); - } - - public function testReturnsUndefined() - { - $this->mock->shouldReceive('foo')->andReturnUndefined(); - $this->assertTrue($this->mock->foo() instanceof \Mockery\Undefined); - } - - /** - * @expectedException OutOfBoundsException - */ - public function testThrowsException() - { - $this->mock->shouldReceive('foo')->andThrow(new OutOfBoundsException); - $this->mock->foo(); - } - - /** - * @expectedException OutOfBoundsException - */ - public function testThrowsExceptionBasedOnArgs() - { - $this->mock->shouldReceive('foo')->andThrow('OutOfBoundsException'); - $this->mock->foo(); - } - - public function testThrowsExceptionBasedOnArgsWithMessage() - { - $this->mock->shouldReceive('foo')->andThrow('OutOfBoundsException', 'foo'); - try { - $this->mock->foo(); - } catch (OutOfBoundsException $e) { - $this->assertEquals('foo', $e->getMessage()); - } - } - - /** - * @expectedException OutOfBoundsException - */ - public function testThrowsExceptionSequentially() - { - $this->mock->shouldReceive('foo')->andThrow(new Exception)->andThrow(new OutOfBoundsException); - try { - $this->mock->foo(); - } catch (Exception $e) {} - $this->mock->foo(); - } - - public function testMultipleExpectationsWithReturns() - { - $this->mock->shouldReceive('foo')->with(1)->andReturn(10); - $this->mock->shouldReceive('bar')->with(2)->andReturn(20); - $this->assertEquals(10, $this->mock->foo(1)); - $this->assertEquals(20, $this->mock->bar(2)); - } - - public function testExpectsNoArguments() - { - $this->mock->shouldReceive('foo')->withNoArgs(); - $this->mock->foo(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testExpectsNoArgumentsThrowsExceptionIfAnyPassed() - { - $this->mock->shouldReceive('foo')->withNoArgs(); - $this->mock->foo(1); - } - - public function testExpectsAnyArguments() - { - $this->mock->shouldReceive('foo')->withAnyArgs(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 'k', new stdClass); - } - - public function testExpectsArgumentMatchingRegularExpression() - { - $this->mock->shouldReceive('foo')->with('/bar/i'); - $this->mock->foo('xxBARxx'); - } - - public function testExpectsArgumentMatchingObjectType() - { - $this->mock->shouldReceive('foo')->with('\stdClass'); - $this->mock->foo(new stdClass); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testThrowsExceptionOnNoArgumentMatch() - { - $this->mock->shouldReceive('foo')->with(1); - $this->mock->foo(2); - } - - public function testNeverCalled() - { - $this->mock->shouldReceive('foo')->never(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testNeverCalledThrowsExceptionOnCall() - { - $this->mock->shouldReceive('foo')->never(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledOnce() - { - $this->mock->shouldReceive('foo')->once(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCalledOnceThrowsExceptionIfNotCalled() - { - $this->mock->shouldReceive('foo')->once(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCalledOnceThrowsExceptionIfCalledTwice() - { - $this->mock->shouldReceive('foo')->once(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledTwice() - { - $this->mock->shouldReceive('foo')->twice(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCalledTwiceThrowsExceptionIfNotCalled() - { - $this->mock->shouldReceive('foo')->twice(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCalledOnceThrowsExceptionIfCalledThreeTimes() - { - $this->mock->shouldReceive('foo')->twice(); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledZeroOrMoreTimesAtZeroCalls() - { - $this->mock->shouldReceive('foo')->zeroOrMoreTimes(); - $this->container->mockery_verify(); - } - - public function testCalledZeroOrMoreTimesAtThreeCalls() - { - $this->mock->shouldReceive('foo')->zeroOrMoreTimes(); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testTimesCountCalls() - { - $this->mock->shouldReceive('foo')->times(4); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testTimesCountCallThrowsExceptionOnTooFewCalls() - { - $this->mock->shouldReceive('foo')->times(2); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testTimesCountCallThrowsExceptionOnTooManyCalls() - { - $this->mock->shouldReceive('foo')->times(2); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledAtLeastOnceAtExactlyOneCall() - { - $this->mock->shouldReceive('foo')->atLeast()->once(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledAtLeastOnceAtExactlyThreeCalls() - { - $this->mock->shouldReceive('foo')->atLeast()->times(3); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCalledAtLeastThrowsExceptionOnTooFewCalls() - { - $this->mock->shouldReceive('foo')->atLeast()->twice(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledAtMostOnceAtExactlyOneCall() - { - $this->mock->shouldReceive('foo')->atMost()->once(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCalledAtMostAtExactlyThreeCalls() - { - $this->mock->shouldReceive('foo')->atMost()->times(3); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCalledAtLeastThrowsExceptionOnTooManyCalls() - { - $this->mock->shouldReceive('foo')->atMost()->twice(); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testExactCountersOverrideAnyPriorSetNonExactCounters() - { - $this->mock->shouldReceive('foo')->atLeast()->once()->once(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testComboOfLeastAndMostCallsWithOneCall() - { - $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testComboOfLeastAndMostCallsWithTwoCalls() - { - $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testComboOfLeastAndMostCallsThrowsExceptionAtTooFewCalls() - { - $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testComboOfLeastAndMostCallsThrowsExceptionAtTooManyCalls() - { - $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice(); - $this->mock->foo(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testCallCountingOnlyAppliesToMatchedExpectations() - { - $this->mock->shouldReceive('foo')->with(1)->once(); - $this->mock->shouldReceive('foo')->with(2)->twice(); - $this->mock->shouldReceive('foo')->with(3); - $this->mock->foo(1); - $this->mock->foo(2); - $this->mock->foo(2); - $this->mock->foo(3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCallCountingThrowsExceptionOnAnyMismatch() - { - $this->mock->shouldReceive('foo')->with(1)->once(); - $this->mock->shouldReceive('foo')->with(2)->twice(); - $this->mock->shouldReceive('foo')->with(3); - $this->mock->shouldReceive('bar'); - $this->mock->foo(1); - $this->mock->foo(2); - $this->mock->foo(3); - $this->mock->bar(); - $this->container->mockery_verify(); - } - - public function testOrderedCallsWithoutError() - { - $this->mock->shouldReceive('foo')->ordered(); - $this->mock->shouldReceive('bar')->ordered(); - $this->mock->foo(); - $this->mock->bar(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testOrderedCallsWithOutOfOrderError() - { - $this->mock->shouldReceive('foo')->ordered(); - $this->mock->shouldReceive('bar')->ordered(); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testDifferentArgumentsAndOrderingsPassWithoutException() - { - $this->mock->shouldReceive('foo')->with(1)->ordered(); - $this->mock->shouldReceive('foo')->with(2)->ordered(); - $this->mock->foo(1); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testDifferentArgumentsAndOrderingsThrowExceptionWhenInWrongOrder() - { - $this->mock->shouldReceive('foo')->with(1)->ordered(); - $this->mock->shouldReceive('foo')->with(2)->ordered(); - $this->mock->foo(2); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testUnorderedCallsIgnoredForOrdering() - { - $this->mock->shouldReceive('foo')->with(1)->ordered(); - $this->mock->shouldReceive('foo')->with(2); - $this->mock->shouldReceive('foo')->with(3)->ordered(); - $this->mock->foo(2); - $this->mock->foo(1); - $this->mock->foo(2); - $this->mock->foo(3); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testOrderingOfDefaultGrouping() - { - $this->mock->shouldReceive('foo')->ordered(); - $this->mock->shouldReceive('bar')->ordered(); - $this->mock->foo(); - $this->mock->bar(); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testOrderingOfDefaultGroupingThrowsExceptionOnWrongOrder() - { - $this->mock->shouldReceive('foo')->ordered(); - $this->mock->shouldReceive('bar')->ordered(); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testOrderingUsingNumberedGroups() - { - $this->mock->shouldReceive('start')->ordered(1); - $this->mock->shouldReceive('foo')->ordered(2); - $this->mock->shouldReceive('bar')->ordered(2); - $this->mock->shouldReceive('final')->ordered(); - $this->mock->start(); - $this->mock->bar(); - $this->mock->foo(); - $this->mock->bar(); - $this->mock->final(); - $this->container->mockery_verify(); - } - - public function testOrderingUsingNamedGroups() - { - $this->mock->shouldReceive('start')->ordered('start'); - $this->mock->shouldReceive('foo')->ordered('foobar'); - $this->mock->shouldReceive('bar')->ordered('foobar'); - $this->mock->shouldReceive('final')->ordered(); - $this->mock->start(); - $this->mock->bar(); - $this->mock->foo(); - $this->mock->bar(); - $this->mock->final(); - $this->container->mockery_verify(); - } - - /** - * @group 2A - */ - public function testGroupedUngroupedOrderingDoNotOverlap() - { - $s = $this->mock->shouldReceive('start')->ordered(); - $m = $this->mock->shouldReceive('mid')->ordered('foobar'); - $e = $this->mock->shouldReceive('end')->ordered(); - $this->assertTrue($s->getOrderNumber() < $m->getOrderNumber()); - $this->assertTrue($m->getOrderNumber() < $e->getOrderNumber()); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testGroupedOrderingThrowsExceptionWhenCallsDisordered() - { - $this->mock->shouldReceive('foo')->ordered('first'); - $this->mock->shouldReceive('bar')->ordered('second'); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testExpectationMatchingWithNoArgsOrderings() - { - $this->mock->shouldReceive('foo')->withNoArgs()->once()->ordered(); - $this->mock->shouldReceive('bar')->withNoArgs()->once()->ordered(); - $this->mock->shouldReceive('foo')->withNoArgs()->once()->ordered(); - $this->mock->foo(); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testExpectationMatchingWithAnyArgsOrderings() - { - $this->mock->shouldReceive('foo')->withAnyArgs()->once()->ordered(); - $this->mock->shouldReceive('bar')->withAnyArgs()->once()->ordered(); - $this->mock->shouldReceive('foo')->withAnyArgs()->once()->ordered(); - $this->mock->foo(); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testEnsuresOrderingIsNotCrossMockByDefault() - { - $this->mock->shouldReceive('foo')->ordered(); - $mock2 = $this->container->mock('bar'); - $mock2->shouldReceive('bar')->ordered(); - $mock2->bar(); - $this->mock->foo(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testEnsuresOrderingIsCrossMockWhenGloballyFlagSet() - { - $this->mock->shouldReceive('foo')->globally()->ordered(); - $mock2 = $this->container->mock('bar'); - $mock2->shouldReceive('bar')->globally()->ordered(); - $mock2->bar(); - $this->mock->foo(); - } - - public function testExpectationCastToStringFormatting() - { - $exp = $this->mock->shouldReceive('foo')->with(1, 'bar', new stdClass, array()); - $this->assertEquals('[foo(1, "bar", stdClass, Array)]', (string) $exp); - } - - public function testMultipleExpectationCastToStringFormatting() - { - $exp = $this->mock->shouldReceive('foo', 'bar')->with(1); - $this->assertEquals('[foo(1), bar(1)]', (string) $exp); - } - - public function testGroupedOrderingWithLimitsAllowsMultipleReturnValues() - { - $this->mock->shouldReceive('foo')->with(2)->once()->andReturn('first'); - $this->mock->shouldReceive('foo')->with(2)->twice()->andReturn('second/third'); - $this->mock->shouldReceive('foo')->with(2)->andReturn('infinity'); - $this->assertEquals('first', $this->mock->foo(2)); - $this->assertEquals('second/third', $this->mock->foo(2)); - $this->assertEquals('second/third', $this->mock->foo(2)); - $this->assertEquals('infinity', $this->mock->foo(2)); - $this->assertEquals('infinity', $this->mock->foo(2)); - $this->assertEquals('infinity', $this->mock->foo(2)); - $this->container->mockery_verify(); - } - - public function testExpectationsCanBeMarkedAsDefaults() - { - $this->mock->shouldReceive('foo')->andReturn('bar')->byDefault(); - $this->assertEquals('bar', $this->mock->foo()); - $this->container->mockery_verify(); - } - - public function testDefaultExpectationsValidatedInCorrectOrder() - { - $this->mock->shouldReceive('foo')->with(1)->once()->andReturn('first')->byDefault(); - $this->mock->shouldReceive('foo')->with(2)->once()->andReturn('second')->byDefault(); - $this->assertEquals('first', $this->mock->foo(1)); - $this->assertEquals('second', $this->mock->foo(2)); - $this->container->mockery_verify(); - } - - public function testDefaultExpectationsAreReplacedByLaterConcreteExpectations() - { - $this->mock->shouldReceive('foo')->andReturn('bar')->once()->byDefault(); - $this->mock->shouldReceive('foo')->andReturn('bar')->twice(); - $this->mock->foo(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testDefaultExpectationsCanBeChangedByLaterExpectations() - { - $this->mock->shouldReceive('foo')->with(1)->andReturn('bar')->once()->byDefault(); - $this->mock->shouldReceive('foo')->with(2)->andReturn('baz')->once(); - try { - $this->mock->foo(1); - $this->fail('Expected exception not thrown'); - } catch (\Mockery\Exception $e) {} - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testDefaultExpectationsCanBeOrdered() - { - $this->mock->shouldReceive('foo')->ordered()->byDefault(); - $this->mock->shouldReceive('bar')->ordered()->byDefault(); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testDefaultExpectationsCanBeOrderedAndReplaced() - { - $this->mock->shouldReceive('foo')->ordered()->byDefault(); - $this->mock->shouldReceive('bar')->ordered()->byDefault(); - $this->mock->shouldReceive('bar')->ordered(); - $this->mock->shouldReceive('foo')->ordered(); - $this->mock->bar(); - $this->mock->foo(); - $this->container->mockery_verify(); - } - - public function testByDefaultOperatesFromMockConstruction() - { - $container = new \Mockery\Container; - $mock = $container->mock('f', array('foo'=>'rfoo','bar'=>'rbar','baz'=>'rbaz'))->byDefault(); - $mock->shouldReceive('foo')->andReturn('foobar'); - $this->assertEquals('foobar', $mock->foo()); - $this->assertEquals('rbar', $mock->bar()); - $this->assertEquals('rbaz', $mock->baz()); - $mock->mockery_verify(); - } - - public function testByDefaultOnAMockDoesSquatWithoutExpectations() - { - $container = new \Mockery\Container; - $mock = $container->mock('f')->byDefault(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testByDefaultPreventedFromSettingDefaultWhenDefaultingExpectationWasReplaced() - { - $exp = $this->mock->shouldReceive('foo')->andReturn(1); - $this->mock->shouldReceive('foo')->andReturn(2); - $exp->byDefault(); - } - - /** - * Argument Constraint Tests - */ - - public function testAnyConstraintMatchesAnyArg() - { - $this->mock->shouldReceive('foo')->with(1, Mockery::any())->twice(); - $this->mock->foo(1, 2); - $this->mock->foo(1, 'str'); - $this->container->mockery_verify(); - } - - public function testAnyConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::any())->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - public function testArrayConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('array'))->once(); - $this->mock->foo(array()); - $this->container->mockery_verify(); - } - - public function testArrayConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('array'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testArrayConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('array'))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testBoolConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('bool'))->once(); - $this->mock->foo(true); - $this->container->mockery_verify(); - } - - public function testBoolConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('bool'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testBoolConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('bool'))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testCallableConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('callable'))->once(); - $this->mock->foo(function(){return 'f';}); - $this->container->mockery_verify(); - } - - public function testCallableConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('callable'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testCallableConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('callable'))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testDoubleConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('double'))->once(); - $this->mock->foo(2.25); - $this->container->mockery_verify(); - } - - public function testDoubleConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('double'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testDoubleConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('double'))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testFloatConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('float'))->once(); - $this->mock->foo(2.25); - $this->container->mockery_verify(); - } - - public function testFloatConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('float'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testFloatConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('float'))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testIntConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('int'))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testIntConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('int'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testIntConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('int'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testLongConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('long'))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testLongConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('long'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testLongConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('long'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testNullConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('null'))->once(); - $this->mock->foo(null); - $this->container->mockery_verify(); - } - - public function testNullConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('null'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testNullConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('null'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testNumericConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('numeric'))->once(); - $this->mock->foo('2'); - $this->container->mockery_verify(); - } - - public function testNumericConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('numeric'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testNumericConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('numeric'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testObjectConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once(); - $this->mock->foo(new stdClass); - $this->container->mockery_verify(); - } - - public function testObjectConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('object`'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testObjectConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testRealConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('real'))->once(); - $this->mock->foo(2.25); - $this->container->mockery_verify(); - } - - public function testRealConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('real'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testRealConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('real'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testResourceConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('resource'))->once(); - $r = fopen(dirname(__FILE__) . '/_files/file.txt', 'r'); - $this->mock->foo($r); - $this->container->mockery_verify(); - } - - public function testResourceConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('resource'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testResourceConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('resource'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - - public function testScalarConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('scalar'))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testScalarConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('scalar'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testScalarConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('scalar'))->once(); - $this->mock->foo(array()); - $this->container->mockery_verify(); - } - - public function testStringConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('string'))->once(); - $this->mock->foo('2'); - $this->container->mockery_verify(); - } - - public function testStringConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('string'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testStringConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('string'))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testClassConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once(); - $this->mock->foo(new stdClass); - $this->container->mockery_verify(); - } - - public function testClassConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::type('stdClass'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testClassConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once(); - $this->mock->foo(new Exception); - $this->container->mockery_verify(); - } - - public function testDucktypeConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::ducktype('quack', 'swim'))->once(); - $this->mock->foo(new Mockery_Duck); - $this->container->mockery_verify(); - } - - public function testDucktypeConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::ducktype('quack', 'swim'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testDucktypeConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::ducktype('quack', 'swim'))->once(); - $this->mock->foo(new Mockery_Duck_Nonswimmer); - $this->container->mockery_verify(); - } - - public function testArrayContentConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::subset(array('a'=>1,'b'=>2)))->once(); - $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3)); - $this->container->mockery_verify(); - } - - public function testArrayContentConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::subset(array('a'=>1,'b'=>2)))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testArrayContentConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::subset(array('a'=>1,'b'=>2)))->once(); - $this->mock->foo(array('a'=>1,'c'=>3)); - $this->container->mockery_verify(); - } - - public function testContainsConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::contains(1, 2))->once(); - $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3)); - $this->container->mockery_verify(); - } - - public function testContainsConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::contains(1, 2))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testContainsConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::contains(1, 2))->once(); - $this->mock->foo(array('a'=>1,'c'=>3)); - $this->container->mockery_verify(); - } - - public function testHasKeyConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::hasKey('c'))->once(); - $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3)); - $this->container->mockery_verify(); - } - - public function testHasKeyConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::hasKey('a'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, array('a'=>1), 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testHasKeyConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::hasKey('c'))->once(); - $this->mock->foo(array('a'=>1,'b'=>3)); - $this->container->mockery_verify(); - } - - public function testHasValueConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::hasValue(1))->once(); - $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3)); - $this->container->mockery_verify(); - } - - public function testHasValueConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::hasValue(1))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, array('a'=>1), 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testHasValueConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::hasValue(2))->once(); - $this->mock->foo(array('a'=>1,'b'=>3)); - $this->container->mockery_verify(); - } - - public function testOnConstraintMatchesArgument_ClosureEvaluatesToTrue() - { - $function = function($arg){return $arg % 2 == 0;}; - $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once(); - $this->mock->foo(4); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testOnConstraintThrowsExceptionWhenConstraintUnmatched_ClosureEvaluatesToFalse() - { - $function = function($arg){return $arg % 2 == 0;}; - $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once(); - $this->mock->foo(5); - $this->container->mockery_verify(); - } - - public function testMustBeConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::mustBe(2))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testMustBeConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::mustBe(2))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testMustBeConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::mustBe(2))->once(); - $this->mock->foo('2'); - $this->container->mockery_verify(); - } - - public function testMustBeConstraintMatchesObjectArgumentWithEqualsComparisonNotIdentical() - { - $a = new stdClass; $a->foo = 1; - $b = new stdClass; $b->foo = 1; - $this->mock->shouldReceive('foo')->with(Mockery::mustBe($a))->once(); - $this->mock->foo($b); - $this->container->mockery_verify(); - } - - public function testMustBeConstraintNonMatchingCaseWithObject() - { - $a = new stdClass; $a->foo = 1; - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::mustBe($a))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, $a, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testMustBeConstraintThrowsExceptionWhenConstraintUnmatchedWithObject() - { - $a = new stdClass; $a->foo = 1; - $b = new stdClass; $b->foo = 2; - $this->mock->shouldReceive('foo')->with(Mockery::mustBe($a))->once(); - $this->mock->foo($b); - $this->container->mockery_verify(); - } - - public function testMatchPrecedenceBasedOnExpectedCallsFavouringExplicitMatch() - { - $this->mock->shouldReceive('foo')->with(1)->once(); - $this->mock->shouldReceive('foo')->with(Mockery::any())->never(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testMatchPrecedenceBasedOnExpectedCallsFavouringAnyMatch() - { - $this->mock->shouldReceive('foo')->with(Mockery::any())->once(); - $this->mock->shouldReceive('foo')->with(1)->never(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testReturnUndefinedIfIgnoreMissingMethodsSet() - { - $this->mock->shouldIgnoreMissing(); - $this->assertTrue($this->mock->g(1,2) instanceof \Mockery\Undefined); - } - - public function testReturnUndefinedAllowsForInfiniteSelfReturningChain() - { - $this->mock->shouldIgnoreMissing(); - $this->assertTrue($this->mock->g(1,2)->a()->b()->c() instanceof \Mockery\Undefined); - } - - public function testOptionalMockRetrieval() - { - $m = $this->container->mock('f')->shouldReceive('foo')->with(1)->andReturn(3)->mock(); - $this->assertTrue($m instanceof \Mockery\MockInterface); - } - - public function testNotConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::not(1))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testNotConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::not(2))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testNotConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::not(2))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testAnyOfConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2))->twice(); - $this->mock->foo(2); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - - public function testAnyOfConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::anyOf(1, 2))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testAnyOfConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2))->once(); - $this->mock->foo(3); - $this->container->mockery_verify(); - } - - public function testNotAnyOfConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(Mockery::notAnyOf(1, 2))->once(); - $this->mock->foo(3); - $this->container->mockery_verify(); - } - - public function testNotAnyOfConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); - $this->mock->shouldReceive('foo')->with(1, Mockery::notAnyOf(1, 2))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 4, 3); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testNotAnyOfConstraintThrowsExceptionWhenConstraintUnmatched() - { - $this->mock->shouldReceive('foo')->with(Mockery::notAnyOf(1, 2))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testGlobalConfigMayForbidMockingNonExistentMethodsOnClasses() - { - \Mockery::getConfiguration()->allowMockingNonExistentMethods(false); - $mock = $this->container->mock('stdClass'); - $mock->shouldReceive('foo'); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testGlobalConfigMayForbidMockingNonExistentMethodsOnObjects() - { - \Mockery::getConfiguration()->allowMockingNonExistentMethods(false); - $mock = $this->container->mock(new stdClass); - $mock->shouldReceive('foo'); - } - - public function testAnExampleWithSomeExpectationAmends() - { - $service = $this->container->mock('MyService'); - $service->shouldReceive('login')->with('user', 'pass')->once()->andReturn(true); - $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(false); - $service->shouldReceive('addBookmark')->with('/^http:/', \Mockery::type('string'))->times(3)->andReturn(true); - $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(true); - - $this->assertTrue($service->login('user', 'pass')); - $this->assertFalse($service->hasBookmarksTagged('php')); - $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1')); - $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2')); - $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3')); - $this->assertTrue($service->hasBookmarksTagged('php')); - - $this->container->mockery_verify(); - } - - public function testAnExampleWithSomeExpectationAmendsOnCallCounts() - { - $service = $this->container->mock('MyService'); - $service->shouldReceive('login')->with('user', 'pass')->once()->andReturn(true); - $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(false); - $service->shouldReceive('addBookmark')->with('/^http:/', \Mockery::type('string'))->times(3)->andReturn(true); - $service->shouldReceive('hasBookmarksTagged')->with('php')->twice()->andReturn(true); - - $this->assertTrue($service->login('user', 'pass')); - $this->assertFalse($service->hasBookmarksTagged('php')); - $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1')); - $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2')); - $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3')); - $this->assertTrue($service->hasBookmarksTagged('php')); - $this->assertTrue($service->hasBookmarksTagged('php')); - - $this->container->mockery_verify(); - } - - public function testAnExampleWithSomeExpectationAmendsOnCallCounts_PHPUnitTest() - { - $service = $this->getMock('MyService2'); - $service->expects($this->once())->method('login')->with('user', 'pass')->will($this->returnValue(true)); - $service->expects($this->exactly(3))->method('hasBookmarksTagged')->with('php') - ->will($this->onConsecutiveCalls(false, true, true)); - $service->expects($this->exactly(3))->method('addBookmark') - ->with($this->matchesRegularExpression('/^http:/'), $this->isType('string')) - ->will($this->returnValue(true)); - - $this->assertTrue($service->login('user', 'pass')); - $this->assertFalse($service->hasBookmarksTagged('php')); - $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1')); - $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2')); - $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3')); - $this->assertTrue($service->hasBookmarksTagged('php')); - $this->assertTrue($service->hasBookmarksTagged('php')); - } - - public function testMockedMethodsCallableFromWithinOriginalClass() - { - $mock = $this->container->mock('MockeryTest_InterMethod1[doThird]'); - $mock->shouldReceive('doThird')->andReturn(true); - $this->assertTrue($mock->doFirst()); - } - - /** - * @group issue #20 - */ - public function testMockingDemeterChainsPassesMockeryExpectationToCompositeExpectation() - { - $mock = $this->container->mock('Mockery_Demeterowski'); - $mock->shouldReceive('foo->bar->baz')->andReturn('Spam!'); - $demeter = new Mockery_UseDemeter($mock); - $this->assertSame('Spam!', $demeter->doit()); - } -} - -class MockeryTest_InterMethod1 -{ - public function doFirst() { - return $this->doSecond(); - } - - private function doSecond() { - return $this->doThird(); - } - - public function doThird() { - return false; - } -} - -class MyService2 -{ - public function login($user, $pass){} - public function hasBookmarksTagged($tag){} - public function addBookmark($uri, $tag){} -} - -class Mockery_Duck { - function quack(){} - function swim(){} -} - -class Mockery_Duck_Nonswimmer { - function quack(){} -} - -class Mockery_Demeterowski { - public function foo() { - return $this; - } - public function bar() { - return $this; - } - public function baz() { - return 'Ham!'; - } -} - -class Mockery_UseDemeter { - public function __construct($demeter) { - $this->demeter = $demeter; - } - public function doit() { - return $this->demeter->foo()->bar()->baz(); - } -} \ No newline at end of file diff --git a/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php deleted file mode 100644 index 4d68ba6..0000000 --- a/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php +++ /dev/null @@ -1,63 +0,0 @@ -container = new \Mockery\Container; - $this->mock = $this->container->mock('foo'); - } - - public function teardown() - { - \Mockery::getConfiguration()->allowMockingNonExistentMethods(true); - $this->container->mockery_close(); - } - - /** Just a quickie roundup of a few Hamcrest matchers to check nothing obvious out of place **/ - - public function testAnythingConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(anything())->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - public function testGreaterThanConstraintMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(greaterThan(1))->once(); - $this->mock->foo(2); - $this->container->mockery_verify(); - } - - /** - * @expectedException Mockery\Exception - */ - public function testGreaterThanConstraintNotMatchesArgument() - { - $this->mock->shouldReceive('foo')->with(greaterThan(1))->once(); - $this->mock->foo(1); - $this->container->mockery_verify(); - } - -} diff --git a/vendor/mockery/mockery/tests/Mockery/LoaderTest.php b/vendor/mockery/mockery/tests/Mockery/LoaderTest.php deleted file mode 100644 index 5f53183..0000000 --- a/vendor/mockery/mockery/tests/Mockery/LoaderTest.php +++ /dev/null @@ -1,46 +0,0 @@ -register(); - $expected = array($loader, 'loadClass'); - $this->assertTrue(in_array($expected, spl_autoload_functions())); - } - - public function tearDown() - { - spl_autoload_unregister('\Mockery\Loader::loadClass'); - $loader = new \Mockery\Loader; - $loader->register(); - } - -} diff --git a/vendor/mockery/mockery/tests/Mockery/RecorderTest.php b/vendor/mockery/mockery/tests/Mockery/RecorderTest.php deleted file mode 100644 index b702b31..0000000 --- a/vendor/mockery/mockery/tests/Mockery/RecorderTest.php +++ /dev/null @@ -1,188 +0,0 @@ -container = new \Mockery\Container; - } - - public function teardown() - { - $this->container->mockery_close(); - } - - public function testRecorderWithSimpleObject() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doFoo(); - }); - - $this->assertEquals(1, $mock->foo()); - $mock->mockery_verify(); - } - - public function testArgumentsArePassedAsMethodExpectations() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doBar(); - }); - - $this->assertEquals(4, $mock->bar(2)); - $mock->mockery_verify(); - } - - public function testArgumentsLooselyMatchedByDefault() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doBar(); - }); - - $this->assertEquals(4, $mock->bar('2')); - $mock->mockery_verify(); - } - - public function testMultipleMethodExpectations() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doFoo(); - $user->doBar(); - }); - - $this->assertEquals(1, $mock->foo()); - $this->assertEquals(4, $mock->bar(2)); - $mock->mockery_verify(); - } - - public function testRecordingDoesNotSpecifyExactOrderByDefault() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doFoo(); - $user->doBar(); - }); - - $this->assertEquals(4, $mock->bar(2)); - $this->assertEquals(1, $mock->foo()); - $mock->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testRecordingDoesSpecifyExactOrderInStrictMode() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $subject->shouldBeStrict(); - $user = new MockeryTestSubjectUser($subject); - $user->doFoo(); - $user->doBar(); - }); - - $mock->bar(2); - $mock->foo(); - $mock->mockery_verify(); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testArgumentsAreMatchedExactlyUnderStrictMode() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $subject->shouldBeStrict(); - $user = new MockeryTestSubjectUser($subject); - $user->doBar(); - }); - - $mock->bar('2'); - } - - /** - * @expectedException \Mockery\Exception - */ - public function testThrowsExceptionWhenArgumentsNotExpected() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doBar(); - }); - - $mock->bar(4); - } - - public function testCallCountUnconstrainedByDefault() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $user = new MockeryTestSubjectUser($subject); - $user->doBar(); - }); - - $mock->bar(2); - $this->assertEquals(4, $mock->bar(2)); - $mock->mockery_verify(); - } - - /** - * @expectedException \Mockery\CountValidator\Exception - */ - public function testCallCountConstrainedInStrictMode() - { - $mock = $this->container->mock(new MockeryTestSubject); - $mock->shouldExpect(function ($subject) { - $subject->shouldBeStrict(); - $user = new MockeryTestSubjectUser($subject); - $user->doBar(); - }); - - $mock->bar(2); - $mock->bar(2); - $mock->mockery_verify(); - } - -} - -class MockeryTestSubject { - function foo() { return 1; } - function bar($i) { return $i * 2; } -} - -class MockeryTestSubjectUser { - public $subject = null; - function __construct($subject) { $this->subject = $subject; } - function doFoo () { return $this->subject->foo(); } - function doBar () { return $this->subject->bar(2); } -} diff --git a/vendor/mockery/mockery/tests/Mockery/_files/file.txt b/vendor/mockery/mockery/tests/Mockery/_files/file.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/mockery/mockery/tests/phpunit.xml b/vendor/mockery/mockery/tests/phpunit.xml deleted file mode 100644 index 3fb35d8..0000000 --- a/vendor/mockery/mockery/tests/phpunit.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - ./ - - - - - disable - - - - - - ../library/ - - - - diff --git a/vendor/phpspec/php-diff b/vendor/phpspec/php-diff deleted file mode 160000 index 8d82ac4..0000000 --- a/vendor/phpspec/php-diff +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d82ac415225fac373a4073ba14b1fe286aa2312 diff --git a/vendor/phpspec/phpspec2 b/vendor/phpspec/phpspec2 deleted file mode 160000 index 1b96ca8..0000000 --- a/vendor/phpspec/phpspec2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1b96ca860acac2345a7464b719c175a86f24dcb3 diff --git a/vendor/symfony/config/Symfony/Component/Config b/vendor/symfony/config/Symfony/Component/Config deleted file mode 160000 index f12982f..0000000 --- a/vendor/symfony/config/Symfony/Component/Config +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f12982ffa9843be853c9b61fd5a7896f00aa5fd7 diff --git a/vendor/symfony/console/Symfony/Component/Console b/vendor/symfony/console/Symfony/Component/Console deleted file mode 160000 index 528b030..0000000 --- a/vendor/symfony/console/Symfony/Component/Console +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 528b030bd94d74b06735c9da9fd9495db0567800 diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector b/vendor/symfony/css-selector/Symfony/Component/CssSelector deleted file mode 160000 index abf8279..0000000 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector +++ /dev/null @@ -1 +0,0 @@ -Subproject commit abf8279792230c6685234eb0fa95b0a85e9e9c7a diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection deleted file mode 160000 index eca7e5d..0000000 --- a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eca7e5dfc35b2d2d67366d4b8fad66bdec819ab5 diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher deleted file mode 160000 index b5b6807..0000000 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b5b6807bcc192f3a1c4fba7ef48466ebbd3c4485 diff --git a/vendor/symfony/finder/Symfony/Component/Finder b/vendor/symfony/finder/Symfony/Component/Finder deleted file mode 160000 index 24e8145..0000000 --- a/vendor/symfony/finder/Symfony/Component/Finder +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24e814560125249010dd08717f4d17079c061e98 diff --git a/vendor/symfony/translation/Symfony/Component/Translation b/vendor/symfony/translation/Symfony/Component/Translation deleted file mode 160000 index 806431a..0000000 --- a/vendor/symfony/translation/Symfony/Component/Translation +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 806431a802d237e15fe38dca0b0460d512854652 diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml b/vendor/symfony/yaml/Symfony/Component/Yaml deleted file mode 160000 index e1aff68..0000000 --- a/vendor/symfony/yaml/Symfony/Component/Yaml +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e1aff6871fd39607d7ce638ff6b1f971cde6fe6a