update behat and deps

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2022-03-02 16:03:05 +01:00
parent 8f212c50e0
commit 3435d5093a
No known key found for this signature in database
GPG key ID: 7424F1874854DF23
1515 changed files with 28156 additions and 77418 deletions

File diff suppressed because it is too large Load diff

View file

@ -4,58 +4,246 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
## 3.10.0 - 2021-11-02
## What's Changed
* PHP8 Hook attributes by @rpkamp in https://github.com/Behat/Behat/pull/1372
**Full Changelog**: https://github.com/Behat/Behat/compare/v3.9.1...v3.10.0
## 3.9.1 - 2021-11-02
## What's Changed
* Fix issue 1363 (Symfony 6 compatibility) by @dmaicher in https://github.com/Behat/Behat/pull/1368
* update branch alias for dev-master by @dmaicher in https://github.com/Behat/Behat/pull/1369
* Fix SYMFONY_REQUIRE for github action by @dmaicher in https://github.com/Behat/Behat/pull/1370
* Issue #1373 - Replace %1% with %count% in hu translations by @Sweetchuck in https://github.com/Behat/Behat/pull/1374
## New Contributors
* @dmaicher made their first contribution in https://github.com/Behat/Behat/pull/1368
* @Sweetchuck made their first contribution in https://github.com/Behat/Behat/pull/1374
**Full Changelog**: https://github.com/Behat/Behat/compare/v3.9.0...v3.9.1
## [3.9.0] - 2021-10-18
### What's Changed
* Fix syntax help test and bump gherkin dependency by @ciaranmcnulty in https://github.com/Behat/Behat/pull/1336
* Remove legacy Symfony compatibility layers (#1305, #1347) by @simonhammes in https://github.com/Behat/Behat/pull/1349
* Add PHP 8.1 support by @javer in https://github.com/Behat/Behat/pull/1355
* Introduce reading PHP8 Attributes for Given, When and Then steps by @rpkamp in https://github.com/Behat/Behat/pull/1342
* Allow Symfony 6 by @Kocal in https://github.com/Behat/Behat/pull/1346
* Remove minimum-stability dev from composer.json & require Gherkin ^4.9.0 by @pamil in https://github.com/Behat/Behat/pull/1365
* Allow to manually run GitHub Actions by @pamil in https://github.com/Behat/Behat/pull/1361
* Add vimeo/psalm (#1307) by @simonhammes in https://github.com/Behat/Behat/pull/1348
### New Contributors
* @simonhammes made their first contribution in https://github.com/Behat/Behat/pull/1349
* @javer made their first contribution in https://github.com/Behat/Behat/pull/1355
* @Kocal made their first contribution in https://github.com/Behat/Behat/pull/1346
## [3.8.1] - 2020-11-07
### Fixed
* [1329](https://github.com/Behat/Behat/pull/1329): Regression when using scalar type hints ([@ciaranmcnulty](https://github.com/ciaranmcnulty))
## [3.8.0] - 2020-11-01
### Added
* [1198](https://github.com/Behat/Behat/pull/1198): Korean language translations ([@getsolaris](https://github.com/getsolaris))
* [1252](https://github.com/Behat/Behat/pull/1252): Hungarian language translations ([@kolesar-andras](https://github.com/kolesar-andras))
* [1217](https://github.com/Behat/Behat/pull/1217): Bulgarian language translations ([@toni-kolev](https://github.com/toni-kolev))
* [1322](https://github.com/Behat/Behat/pull/1322): Feature title as classname in JUnit output ([@steefmin](https://github.com/steefmin))
* [1313](https://github.com/Behat/Behat/pull/1313): PHP 8 support ([@ciaranmcnulty](https://github.com/ciaranmcnulty))
* [1313](https://github.com/Behat/Behat/pull/1323): Further PHP 8 support ([@dgafka](https://github.com/dgafka))
### Fixed
* [#1303](https://github.com/Behat/Behat/pull/1303): Error when running `--debug` with recent Symfony versions ([@jawira](https://github.com/jawira))
* [#1311](https://github.com/Behat/Behat/pull/1311): Remove symfony deprecation messages about transChoice ([@guilliamxavier](https://github.com/guilliamxavier))
* [#1318](https://github.com/Behat/Behat/pull/1318): Allow negated filters on scenario hoooks ([@andrewnicols ](https://github.com/andrewnicols))
### Changed
* [#1299](https://github.com/Behat/Behat/pull/1299): Removed support for PHP <7.2, Symfony <4.4 ([@upamil](https://github.com/pamil))
* [#1310](https://github.com/Behat/Behat/pull/1310): Refactoring to use newer language features ([@rpkamp](https://github.com/rpkamp))
* [#1315](https://github.com/Behat/Behat/pull/1315): Remove BC layer for unsuppored symfony dispatcher ([@rpkamp](https://github.com/rpkamp))
* [#1314](https://github.com/Behat/Behat/pull/1314): Remove BC layer for unsuppored symfony translator ([@rpkamp](https://github.com/rpkamp))
* [#1212](https://github.com/Behat/Behat/pull/1212): Updated composer description ([@tkotosz](https://github.com/tkotosz))
* [#1317](https://github.com/Behat/Behat/pull/1317): Use PHPUnit8 for unit testing ([@phil-davis](https://github.com/phil-davis))
## [3.7.0] - 2020-06-03
### Added
* [#1236](https://github.com/Behat/Behat/pull/1236): Add support for php 7.4 ([@snapshotpl](https://github.com/snapshotpl))
### Fixed
* [#1270](https://github.com/Behat/Behat/pull/1270): Fix issues with PHP version handling in build ([@Sam-Burns](https://github.com/Sam-Burns))
* [#1282](https://github.com/Behat/Behat/pull/1282): Updated the year on Changelog dates ([@choult](https://github.com/choult))
* [#1284](https://github.com/Behat/Behat/pull/1284): Restore PHP 5.3/5.4 compat ([@dvdoug](https://github.com/dvdoug), [@Sam-Burns](https://github.com/Sam-Burns), [@pamil](https://github.com/pamil))
### Changed
* [#1281](https://github.com/Behat/Behat/pull/1281): Make container-interop/container-interop optional dependency ([@upyx](https://github.com/upyx))
## [3.6.1] - 2020-02-06
### Fixed
* [#1275](https://github.com/Behat/Behat/pull/1275): fix php 7.1 deprecation for ReflectionType::__toString
* [#1278](https://github.com/Behat/Behat/pull/1278): Fix fatal when unexpected symfony/event-dispatcher version is installed
## [3.6.0] - 2020-02-04
### Added
* [#1244](https://github.com/Behat/Behat/pull/1244): Hide internal steps from stack traces in very verbose mode
### Fixed
* [#1238](https://github.com/Behat/Behat/pull/1238): Don't run Junit output if ext-dom is not present (and suggest in composer)
### Changed
* [#1256](https://github.com/Behat/Behat/pull/1256): Update dependencies to support Symfony 5.x
* [#1171](https://github.com/Behat/Behat/pull/1171): Remove symfony/class-loader dependency
* [#1170](https://github.com/Behat/Behat/pull/1170): Switch to PSR-4 autoloading
* [#1230](https://github.com/Behat/Behat/pull/1230): PHP 7.3 support
* [#1230](https://github.com/Behat/Behat/pull/1230): Suggest ext-dom for JUnit support
## [3.5.0] - 2018-08-10
### Added
* [#1144](https://github.com/Behat/Behat/pull/1144): Allow to use arrays as context parameters
* [#1081](https://github.com/Behat/Behat/pull/1081): Allow passing null as a named context parameter
* [#1083](https://github.com/Behat/Behat/pull/1083): Time attribute in JUnit output
### Changed
* [#1153](https://github.com/Behat/Behat/pull/1153): Cache pattern to regex transformations
* [#1155](https://github.com/Behat/Behat/pull/1155): Remove composer suggestions
### Fixed
* Custom container must be public for symfony 4
* [#1160](https://github.com/Behat/Behat/pull/1160): Register CLI services as synthetic
* [#1163](https://github.com/Behat/Behat/pull/1163): Allow for new-style symfony serialisation
* [#1130](https://github.com/Behat/Behat/pull/1130): Fix quoteless definition arguments matching with unicode characters
## [3.4.3] - 2017-11-27
### Fixed
* BC break due to parameters resolution in Dependency Injection Container
## [3.4.2] - 2017-11-20
### Added
* [#1095](https://github.com/Behat/Behat/pull/1095): Support for Symfony 4.x
* [#1096](https://github.com/Behat/Behat/pull/1096): Allow to use latest PHPUnit
## [3.4.1] - 2017-09-18
### Fixed
* PHP 5.3 style cleanup.
## [3.4.0] - 2017-09-10
### Added
* [#1071](https://github.com/Behat/Behat/pull/1071): Services auto-wiring
* [#1054](https://github.com/Behat/Behat/pull/1054): [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md)
support for helper containers.
* Support for modern PHPUnit.
### Fixed
* [#1056](https://github.com/Behat/Behat/pull/1056): Make Gherkin aware of the
base path so it can filter correctly
### Changed
* [#1069](https://github.com/Behat/Behat/pull/1069): Rework argument validators
### Deprecated
* [#1054](https://github.com/Behat/Behat/pull/1054): Deprecated usage
of `Interop\Container`. Versions prior to `1.2` are not supported, but `1.2`
is a non-breaking change. If you depend heavily on `Interop`, upgrade to
`1.2`, which is still supported by helper containers. Aim to migrate to
`Psr` before Behat 4.0 shows up on horizon
* PHP versions prior to 5.6 and HHVM were dropped from CI build matrix. It
doesn't mean that we'll start using features of 5.6 yet, it just means we
don't get out of our way to support 5.3 and 5.4 anymore. In 4.0 support will
be completely dropped.
## [3.3.1] - 2017-05-15
### Added
* [#976](https://github.com/Behat/Behat/pull/1001): Add tests to check that
snippets treat words containing apostrophes as a single word
### Fixed
* [#993](https://github.com/Behat/Behat/pull/993) Fix mixed arguments
organizer not marking typehinted arguments as "defined"
* [#992](https://github.com/Behat/Behat/pull/993) Do not misinterpret first
argument as a numbered argument if it is in fact typehinted
* [#1028](https://github.com/Behat/Behat/pull/1028) Parent / Child class
argument ambiguity issue with `MixedArgumentResolver`
## [3.3.0] - 2016-12-25
### Added
* [#973](https://github.com/Behat/Behat/pull/974): Added helper containers
* [#973](https://github.com/Behat/Behat/pull/974): Added `SuiteScopedResolverFactory` extension point
* [#973](https://github.com/Behat/Behat/pull/974): Added
`SuiteScopedResolverFactory` extension point
### Removed
* Removed php 5.3 from the Travis build matrix. You can consider it official
end of support. 5.4 and 5.5 will follow shortly.
## [3.2.3] - 2016-12-25
### Fixed
* [#971](https://github.com/Behat/Behat/pull/971): Added support for suite names with hyphens
* [#971](https://github.com/Behat/Behat/pull/971): Added support for suite
names with hyphens
## [3.2.2] - 2016-11-05
### Fixed
* [#959](https://github.com/Behat/Behat/issues/959): Fix transformations not sorted properly on different php version
* [#959](https://github.com/Behat/Behat/issues/959): Fix transformations not
sorted properly on different php version
## [3.2.1] - 2016-09-25
### Changed
* [#955](https://github.com/Behat/Behat/pull/955): `--snippets-for` is not required now as interactive mode is the new default
* [#954](https://github.com/Behat/Behat/pull/954): Stop execution on missing steps when running with `--stop-on-failure` and `--strict` options
* [#955](https://github.com/Behat/Behat/pull/955): `--snippets-for` is not
required now as interactive mode is the new default
* [#954](https://github.com/Behat/Behat/pull/954): Stop execution on missing
steps when running with `--stop-on-failure` and `--strict` options
## [3.2.0] - 2016-09-20
### Added
* [#910](https://github.com/Behat/Behat/pull/910): Return type based transformations
* [#903](https://github.com/Behat/Behat/pull/903): Multiline step definitions support
* [#910](https://github.com/Behat/Behat/pull/910): Return type based
transformations
* [#903](https://github.com/Behat/Behat/pull/903): Multiline step definitions
support
* [#930](https://github.com/Behat/Behat/pull/930): Whole table transformation
* [#935](https://github.com/Behat/Behat/pull/935): Narrative filters in suites
* [#936](https://github.com/Behat/Behat/pull/936): Debug command
* [#931](https://github.com/Behat/Behat/pull/931): Exception handlers extension point
* [#870](https://github.com/Behat/Behat/pull/870): Added build-related files and folders to .gitattributes
* [#946](https://github.com/Behat/Behat/pull/946): Official full Windows support with CI ([AppVeyor](http://appveyor.com)) on every build
* [#931](https://github.com/Behat/Behat/pull/931): Exception handlers
extension point
* [#870](https://github.com/Behat/Behat/pull/870): Added build-related files
and folders to .gitattributes
* [#946](https://github.com/Behat/Behat/pull/946): Official full Windows
support with CI ([AppVeyor](http://appveyor.com)) on every build
### Changed
* [#922](https://github.com/Behat/Behat/pull/922): Snippets generation revamp
* [#920](https://github.com/Behat/Behat/pull/920): More context for pending/failed steps with progress formatter
* [#920](https://github.com/Behat/Behat/pull/920): More context for
pending/failed steps with progress formatter
* [#905](https://github.com/Behat/Behat/pull/905): Transformations refactoring
* [#864](https://github.com/Behat/Behat/pull/864): Use only one autoloader if possible
* [#920](https://github.com/Behat/Behat/pull/920): Improve "No specifications found" error message
* [#864](https://github.com/Behat/Behat/pull/864): Use only one autoloader if
possible
* [#920](https://github.com/Behat/Behat/pull/920): Improve "No specifications
found" error message
* Refactor changelog to follow [Keep a Changelog](http://keepachangelog.com/)
* Refreshed [CONTRIBUTING.md](CONTRIBUTING.md)
* Refreshed Scrutinizer config
### Fixed
* [#911](https://github.com/Behat/Behat/pull/911): Fix context isolation for Scenario Outlines
* [#860](https://github.com/Behat/Behat/pull/860): Include basepath in `generateKey`
* [#857](https://github.com/Behat/Behat/pull/857): Only cache failed scenario's for rerun
* [#933](https://github.com/Behat/Behat/pull/933): Save failed runs with suite information
* [#833](https://github.com/Behat/Behat/pull/833): Properly handle interupts on PHP7
* [#904](https://github.com/Behat/Behat/pull/904): Provide clearer exception message when long token names used
* [#941](https://github.com/Behat/Behat/pull/941): Transformation should be allowed if printable chars are used
* [#911](https://github.com/Behat/Behat/pull/911): Fix context isolation for
Scenario Outlines
* [#860](https://github.com/Behat/Behat/pull/860): Include basepath in
`generateKey`
* [#857](https://github.com/Behat/Behat/pull/857): Only cache failed
scenario's for rerun
* [#933](https://github.com/Behat/Behat/pull/933): Save failed runs with suite
information
* [#833](https://github.com/Behat/Behat/pull/833): Properly handle interupts
on PHP7
* [#904](https://github.com/Behat/Behat/pull/904): Provide clearer exception
message when long token names used
* [#941](https://github.com/Behat/Behat/pull/941): Transformation should be
allowed if printable chars are used
### Deprecated
* [#922](https://github.com/Behat/Behat/pull/922): `*SnippetAcceptingContext` interfaces
* [#922](https://github.com/Behat/Behat/pull/922): `*SnippetAcceptingContext`
interfaces
* [#905](https://github.com/Behat/Behat/pull/905): `RuntimeTransformation`
* [#905](https://github.com/Behat/Behat/pull/905): `Transformation::getPattern`
* [#920](https://github.com/Behat/Behat/pull/920): `StepStat`
@ -74,7 +262,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Add Japanese translation (thanks @SNakano)
* Add romanian translation for formatters (thanks @Chriton)
* Add table row transformations (thanks @ciaranmcnulty)
* Add support for negative numbers without surrounding quotes (thanks @ryancookdev)
* Add support for negative numbers without surrounding quotes (thanks
@ryancookdev)
* Handle case when non-existent config file is used (thanks @watermanio)
* Handle non-default `error_reporting()`
* Handle PHP7 errors implementing `Throwable`
@ -88,7 +277,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Allow suite settings with null values to exist (thanks @docteurklein)
* Improve "can not generate snippets" message
* Improve performance of Turnip parsing (thanks @Sam-Burns)
* Improve the snippet generation by auto-importing needed classes (thanks @stof)
* Improve the snippet generation by auto-importing needed classes (thanks
@stof)
## [3.0.15] - 2015-02-22
### Changed
@ -793,7 +983,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
* Initial release
[Unreleased]: https://github.com/Behat/Behat/compare/v3.3.0...HEAD
[Unreleased]: https://github.com/Behat/Behat/compare/v3.9.0...master
[3.9.0]: https://github.com/Behat/Behat/compare/v3.8.1...v3.9.0
[3.8.1]: https://github.com/Behat/Behat/compare/v3.8.0...v3.8.1
[3.8.0]: https://github.com/Behat/Behat/compare/v3.7.0...v3.8.0
[3.7.0]: https://github.com/Behat/Behat/compare/v3.6.1...v3.7.0
[3.6.1]: https://github.com/Behat/Behat/compare/v3.6.0...v3.6.1
[3.6.0]: https://github.com/Behat/Behat/compare/v3.5.0...v3.6.0
[3.5.0]: https://github.com/Behat/Behat/compare/v3.4.3...v3.5.0
[3.4.3]: https://github.com/Behat/Behat/compare/v3.4.2...v3.4.3
[3.4.2]: https://github.com/Behat/Behat/compare/v3.4.1...v3.4.2
[3.4.1]: https://github.com/Behat/Behat/compare/v3.4.0...v3.4.1
[3.4.0]: https://github.com/Behat/Behat/compare/v3.3.1...v3.4.0
[3.3.1]: https://github.com/Behat/Behat/compare/v3.3.0...v3.3.1
[3.3.0]: https://github.com/Behat/Behat/compare/v3.2.3...v3.3.0
[3.2.3]: https://github.com/Behat/Behat/compare/v3.2.2...v3.2.3
[3.2.2]: https://github.com/Behat/Behat/compare/v3.2.1...v3.2.2

View file

@ -1,12 +1,11 @@
![Behat](https://dl.dropboxusercontent.com/u/282797/behat/behat.png)
![Behat](https://github.com/Behat/logo/raw/master/logo.png)
Behat is a BDD framework for PHP to help you test business expectations.
[![Gitter chat](https://badges.gitter.im/Behat/Behat.svg)](https://gitter.im/Behat/Behat)
[![License](https://poser.pugx.org/behat/behat/license.svg)](https://packagist.org/packages/behat/behat)
[![Unix Status](https://travis-ci.org/Behat/Behat.svg?branch=master)](https://travis-ci.org/Behat/Behat)
[![Unix Status](https://github.com/Behat/Behat/workflows/Build/badge.svg)](https://github.com/Behat/Behat/actions?query=workflow%3ABuild)
[![Windows status](https://ci.appveyor.com/api/projects/status/9uc5sellmvbv02ei/branch/master?svg=true)](https://ci.appveyor.com/project/everzet/behat/branch/master)
[![HHVM Status](http://hhvm.h4cc.de/badge/behat/behat.svg?branch=master)](http://hhvm.h4cc.de/package/behat/behat)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Behat/Behat/badges/quality-score.png?s=ad84e95fc2405712f88a96d89b4f31dfe5c80fae)](https://scrutinizer-ci.com/g/Behat/Behat/)
Installing Behat
@ -15,8 +14,7 @@ Installing Behat
The easiest way to install Behat is by using [Composer](https://getcomposer.org):
```bash
$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar require behat/behat
$> composer require --dev behat/behat
```
After that you'll be able to run Behat via:
@ -31,8 +29,7 @@ Installing Development Version
Clone the repository and install dependencies via [Composer](https://getcomposer.org):
```bash
$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar install
$> composer install
```
After that you will be able to run development version of Behat via:

View file

@ -1,6 +1,6 @@
{
"name": "behat/behat",
"description": "Scenario-oriented BDD framework for PHP 5.3",
"description": "Scenario-oriented BDD framework for PHP",
"keywords": ["BDD", "ScenarioBDD", "StoryBDD", "Examples", "Scrum", "Agile", "User story", "Symfony", "business", "development", "testing", "documentation"],
"homepage": "http://behat.org/",
"type": "library",
@ -14,42 +14,49 @@
],
"require": {
"php": ">=5.3.3",
"php": "^7.2 || ^8.0",
"ext-mbstring": "*",
"behat/gherkin": "^4.4.4",
"behat/transliterator": "~1.0",
"symfony/console": "~2.5||~3.0",
"symfony/config": "~2.3||~3.0",
"symfony/dependency-injection": "~2.1||~3.0",
"symfony/event-dispatcher": "~2.1||~3.0",
"symfony/translation": "~2.3||~3.0",
"symfony/yaml": "~2.1||~3.0",
"symfony/class-loader": "~2.1||~3.0",
"container-interop/container-interop": "^1.1"
"behat/gherkin": "^4.9.0",
"behat/transliterator": "^1.2",
"symfony/console": "^4.4 || ^5.0 || ^6.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
"symfony/translation": "^4.4 || ^5.0 || ^6.0",
"symfony/yaml": "^4.4 || ^5.0 || ^6.0",
"psr/container": "^1.0"
},
"require-dev": {
"symfony/process": "~2.5|~3.0",
"phpunit/phpunit": "~4.5",
"herrera-io/box": "~1.6.1"
"symfony/process": "^4.4 || ^5.0 || ^6.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"herrera-io/box": "~1.6.1",
"container-interop/container-interop": "^1.2",
"vimeo/psalm": "^4.8"
},
"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"
"ext-dom": "Needed to output test results in JUnit format."
},
"autoload": {
"psr-0": {
"Behat\\Behat": "src/",
"Behat\\Testwork": "src/"
"psr-4": {
"Behat\\Behat\\": "src/Behat/Behat/",
"Behat\\Testwork\\": "src/Behat/Testwork/",
"Behat\\Step\\": "src/Behat/Step/",
"Behat\\Hook\\": "src/Behat/Hook/"
}
},
"autoload-dev": {
"psr-4": {
"Behat\\Tests\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "3.2.x-dev"
"dev-master": "3.x-dev"
}
},

View file

@ -1,217 +1,267 @@
<?php return array(
'en' => array(
'snippet_context_choice' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> suite has undefined steps. Please choose the context to generate snippets:</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> has missing steps. Define them with these snippets:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Use <snippet_keyword>--snippets-for</snippet_keyword> CLI option to generate snippets for following <snippet_keyword>%1%</snippet_keyword> suite steps:</snippet_undefined>',
'snippet_context_choice' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> suite has undefined steps. Please choose the context to generate snippets:</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> has missing steps. Define them with these snippets:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Use <snippet_keyword>--snippets-for</snippet_keyword> CLI option to generate snippets for following <snippet_keyword>%count%</snippet_keyword> suite steps:</snippet_undefined>',
'skipped_scenarios_title' => 'Skipped scenarios:',
'failed_scenarios_title' => 'Failed scenarios:',
'failed_hooks_title' => 'Failed hooks:',
'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',
'scenarios_count' => '{0} No scenarios|{1} 1 scenario|]1,Inf] %count% scenarios',
'steps_count' => '{0} No steps|{1} 1 step|]1,Inf] %count% steps',
'passed_count' => '[1,Inf] %count% passed',
'failed_count' => '[1,Inf] %count% failed',
'pending_count' => '[1,Inf] %count% pending',
'undefined_count' => '[1,Inf] %count% undefined',
'skipped_count' => '[1,Inf] %count% skipped',
),
'bg' => array(
'snippet_context_choice' => 'В сет <snippet_undefined><snippet_keyword>%1%</snippet_keyword> има недекларирани стъпки. Изберете в кой Context да бъдат създадени:</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> има липсващи стъпки. Можете да ги създадете чрез:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Използвайте този снипет <snippet_keyword>--snippets-for</snippet_keyword> за да генерирате кода за следните стъпки <snippet_keyword>%1%</snippet_keyword> през конзолата:</snippet_undefined>',
'skipped_scenarios_title' => 'Пропуснати сценарии:',
'failed_scenarios_title' => 'Провалени сценарии:',
'failed_hooks_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% пропуснати',
),
'cs' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> obsahuje chybné kroky. Definujte je za použití následujícího kódu:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Snippety pro následující kroky v sadě <snippet_keyword>%1%</snippet_keyword> nebyly vygenerovány (zkontrolujte správnost konfigurace):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> obsahuje chybné kroky. Definujte je za použití následujícího kódu:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Snippety pro následující kroky v sadě <snippet_keyword>%count%</snippet_keyword> nebyly vygenerovány (zkontrolujte správnost konfigurace):</snippet_undefined>',
'failed_scenarios_title' => 'Chybné scénáře:',
'failed_hooks_title' => 'Chybné hooky:',
'failed_steps_title' => 'Chybné 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',
'scenarios_count' => '{0} Žádný scénář|{1} 1 scénář|{2,3,4} %count% scénáře|]4,Inf] %count% scénářů',
'steps_count' => '{0} Žádné kroky|{1} 1 krok|{2,3,4} %count% kroky|]4,Inf] %count% kroků',
'passed_count' => '{1} %count% prošel|{2,3,4} %count% prošly|]4,Inf] %count% prošlo',
'failed_count' => '{1} %count% selhal|{2,3,4} %count% selhaly|]4,Inf] %count% selhalo',
'pending_count' => '{1} %count% čeká|{2,3,4} %count% čekají|]4,Inf] %count% čeká',
'undefined_count' => '{1} %count% nedefinován|{2,3,4} %count% nedefinovány|]4,Inf] %count% nedefinováno',
'skipped_count' => '{1} %count% přeskočen|{2,3,4} %count% přeskočeny|]4,Inf] %count% přeskočeno',
),
'de' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> hat fehlende Schritte. Definiere diese mit den folgenden Snippets:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Snippets für die folgenden Schritte in der <snippet_keyword>%1%</snippet_keyword> Suite wurden nicht generiert (Konfiguration überprüfen):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> hat fehlende Schritte. Definiere diese mit den folgenden Snippets:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Snippets für die folgenden Schritte in der <snippet_keyword>%count%</snippet_keyword> Suite wurden nicht generiert (Konfiguration überprüfen):</snippet_undefined>',
'failed_scenarios_title' => 'Fehlgeschlagene Szenarien:',
'failed_hooks_title' => 'Fehlgeschlagene Hooks:',
'failed_steps_title' => 'Fehlgeschlagene Schritte:',
'pending_steps_title' => 'Ausstehende Schritte:',
'scenarios_count' => '{0} Kein Szenario|{1} 1 Szenario|]1,Inf] %1% Szenarien',
'steps_count' => '{0} Kein Schritt|{1} 1 Schritt|]1,Inf] %1% Schritte',
'passed_count' => '[1,Inf] %1% bestanden',
'failed_count' => '[1,Inf] %1% fehlgeschlagen',
'pending_count' => '[1,Inf] %1% ausstehend',
'undefined_count' => '[1,Inf] %1% nicht definiert',
'skipped_count' => '[1,Inf] %1% übersprungen',
'scenarios_count' => '{0} Kein Szenario|{1} 1 Szenario|]1,Inf] %count% Szenarien',
'steps_count' => '{0} Kein Schritt|{1} 1 Schritt|]1,Inf] %count% Schritte',
'passed_count' => '[1,Inf] %count% bestanden',
'failed_count' => '[1,Inf] %count% fehlgeschlagen',
'pending_count' => '[1,Inf] %count% ausstehend',
'undefined_count' => '[1,Inf] %count% nicht definiert',
'skipped_count' => '[1,Inf] %count% übersprungen',
),
'es' => array(
'snippet_proposal_title' => '<snippet_undefined>A <snippet_keyword>%1%</snippet_keyword> le faltan pasos. Defínelos con estos pasos:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Las plantillas para los siguientes pasos en <snippet_keyword>%1%</snippet_keyword> no fueron generadas (revisa tu configuración):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined>A <snippet_keyword>%count%</snippet_keyword> le faltan pasos. Defínelos con estos pasos:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Las plantillas para los siguientes pasos en <snippet_keyword>%count%</snippet_keyword> no fueron generadas (revisa tu configuración):</snippet_undefined>',
'failed_scenarios_title' => 'Escenarios fallidos:',
'failed_hooks_title' => 'Hooks fallidos:',
'failed_steps_title' => 'Pasos fallidos:',
'pending_steps_title' => 'Pasos pendientes:',
'scenarios_count' => '{0} Ningún escenario|{1} 1 escenario|]1,Inf] %1% escenarios',
'steps_count' => '{0} Ningún paso|{1} 1 paso|]1,Inf] %1% pasos',
'passed_count' => '[1,Inf] %1% pasaron',
'failed_count' => '[1,Inf] %1% fallaron',
'pending_count' => '[1,Inf] %1% pendientes',
'undefined_count' => '[1,Inf] %1% por definir',
'skipped_count' => '[1,Inf] %1% saltadas',
'scenarios_count' => '{0} Ningún escenario|{1} 1 escenario|]1,Inf] %count% escenarios',
'steps_count' => '{0} Ningún paso|{1} 1 paso|]1,Inf] %count% pasos',
'passed_count' => '[1,Inf] %count% pasaron',
'failed_count' => '[1,Inf] %count% fallaron',
'pending_count' => '[1,Inf] %count% pendientes',
'undefined_count' => '[1,Inf] %count% por definir',
'skipped_count' => '[1,Inf] %count% saltadas',
),
'fr' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> a des étapes manquantes. Définissez-les avec les modèles suivants :</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Les modèles des étapes de la suite <snippet_keyword>%1%</snippet_keyword> n\'ont pas été générés (vérifiez votre configuration):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> a des étapes manquantes. Définissez-les avec les modèles suivants :</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Les modèles des étapes de la suite <snippet_keyword>%count%</snippet_keyword> n\'ont pas été générés (vérifiez votre configuration):</snippet_undefined>',
'failed_scenarios_title' => 'Scénarios échoués:',
'failed_hooks_title' => 'Hooks échoués:',
'failed_steps_title' => 'Etapes échouées:',
'pending_steps_title' => 'Etapes en attente:',
'scenarios_count' => '{0} Pas de scénario|{1} 1 scénario|]1,Inf] %1% scénarios',
'steps_count' => '{0} Pas d\'é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% indéfinis',
'skipped_count' => '[1,Inf] %1% ignorés',
'scenarios_count' => '{0} Pas de scénario|{1} 1 scénario|]1,Inf] %count% scénarios',
'steps_count' => '{0} Pas d\'étape|{1} 1 étape|]1,Inf] %count% étapes',
'passed_count' => '[1,Inf] %count% succès',
'failed_count' => '[1,Inf] %count% échecs',
'pending_count' => '[1,Inf] %count% en attente',
'undefined_count' => '[1,Inf] %count% indéfinis',
'skipped_count' => '[1,Inf] %count% ignorés',
),
'hu' => array(
'snippet_context_choice' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> sorozat meghatározatlan lépéseket tartalmaz. Válaszd ki a környezetet kódrészlet készítéséhez:</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> lépései hiányosak. Hozd létre az alábbi kódrészletekkel:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Használd a <snippet_keyword>--snippets-for</snippet_keyword> parancssori kapcsolót kódrészletek készítéséhez a <snippet_keyword>%count%</snippet_keyword> sorozat lépéseihez:</snippet_undefined>',
'skipped_scenarios_title' => 'Kihagyott forgatókönyvek:',
'failed_scenarios_title' => 'Sikertelen forgatókönyvek:',
'failed_hooks_title' => 'Sikertelen kampók:',
'failed_steps_title' => 'Sikertelen lépések:',
'pending_steps_title' => 'Elintézendő lépések:',
'scenarios_count' => '{0} Nem volt forgatókönyv|{1} 1 forgatókönyv|]1,Inf] %count% forgatókönyv',
'steps_count' => '{0} Nem volt lépés|{1} 1 lépés|]1,Inf] %count% lépés',
'passed_count' => '[1,Inf] %count% sikeres',
'failed_count' => '[1,Inf] %count% sikertelen',
'pending_count' => '[1,Inf] %count% elintézendő',
'undefined_count' => '[1,Inf] %count% meghatározatlan',
'skipped_count' => '[1,Inf] %count% kihagyott',
),
'it' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> ha dei passaggi mancanti. Definiscili con questi snippet:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Gli snippet per i seguenti passaggi della suite <snippet_keyword>%1%</snippet_keyword> non sono stati generati (verifica la configurazione):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> ha dei passaggi mancanti. Definiscili con questi snippet:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Gli snippet per i seguenti passaggi della suite <snippet_keyword>%count%</snippet_keyword> non sono stati generati (verifica la configurazione):</snippet_undefined>',
'failed_scenarios_title' => 'Scenari falliti:',
'failed_hooks_title' => 'Hook falliti:',
'failed_steps_title' => 'Passaggi falliti:',
'pending_steps_title' => 'Passaggi in sospeso:',
'scenarios_count' => '{0} Nessuno scenario|{1} 1 scenario|]1,Inf] %1% scenari',
'steps_count' => '{0} Nessun passaggio|{1} 1 passaggio|]1,Inf] %1% passaggi',
'passed_count' => '{1} 1 superato|]1,Inf] %1% superati',
'failed_count' => '{1} 1 fallito|]1,Inf] %1% falliti',
'pending_count' => '[1,Inf] %1% in sospeso',
'undefined_count' => '{1} 1 non definito|]1,Inf] %1% non definiti',
'skipped_count' => '{1} 1 ignorato|]1,Inf] %1% ignorati',
'scenarios_count' => '{0} Nessuno scenario|{1} 1 scenario|]1,Inf] %count% scenari',
'steps_count' => '{0} Nessun passaggio|{1} 1 passaggio|]1,Inf] %count% passaggi',
'passed_count' => '{1} 1 superato|]1,Inf] %count% superati',
'failed_count' => '{1} 1 fallito|]1,Inf] %count% falliti',
'pending_count' => '[1,Inf] %count% in sospeso',
'undefined_count' => '{1} 1 non definito|]1,Inf] %count% non definiti',
'skipped_count' => '{1} 1 ignorato|]1,Inf] %count% ignorati',
),
'ja' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> のステップが見つかりません。 次のスニペットで定義できます:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>以下のステップのスニペットは<snippet_keyword>%1%</snippet_keyword>スイートに生成されませんでした(設定を確認してください):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> のステップが見つかりません。 次のスニペットで定義できます:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>以下のステップのスニペットは<snippet_keyword>%count%</snippet_keyword>スイートに生成されませんでした(設定を確認してください):</snippet_undefined>',
'skipped_scenarios_title' => 'スキップした シナリオ:',
'failed_scenarios_title' => '失敗した シナリオ:',
'failed_hooks_title' => '失敗した フック:',
'failed_steps_title' => '失敗した ステップ:',
'pending_steps_title' => '保留中のステップ:',
'scenarios_count' => '{0} No scenarios|{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% 個スキップ',
'scenarios_count' => '{0} No scenarios|{1} 1 個のシナリオ|]1,Inf] %count% 個のシナリオ',
'steps_count' => '{0} ステップがありません|{1} 1 個のステップ|]1,Inf] %count% 個のステップ',
'passed_count' => '[1,Inf] %count% 個成功',
'failed_count' => '[1,Inf] %count% 個失敗',
'pending_count' => '[1,Inf] %count% 個保留',
'undefined_count' => '[1,Inf] %count% 個未定義',
'skipped_count' => '[1,Inf] %count% 個スキップ',
),
'ko' => array(
'snippet_proposal_title' => '<snippet_keyword>%1%</snippet_keyword> <snippet_undefined> 정의가 되지 않았습니다. 스니펫을 생성할 컨텍스트를 선택하십시오:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> 단계가 누락되었습니다. 스니펫을 정의해주세요:</snippet_undefined>',
'skipped_scenarios_title' => '건너뛴 시나리오:',
'failed_scenarios_title' => '실패한 시나리오:',
'failed_hooks_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(
'snippet_proposal_title' => '<snippet_undefined>Ontbrekende stappen in <snippet_keyword>%1%</snippet_keyword>. Definieer ze met de volgende fragmenten:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Fragmenten voor de volgende stappen in de <snippet_keyword>%1%</snippet_keyword> suite werden niet gegenereerd (controleer de configuratie):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined>Ontbrekende stappen in <snippet_keyword>%count%</snippet_keyword>. Definieer ze met de volgende fragmenten:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Fragmenten voor de volgende stappen in de <snippet_keyword>%count%</snippet_keyword> suite werden niet gegenereerd (controleer de configuratie):</snippet_undefined>',
'failed_scenarios_title' => 'Gefaalde scenario\'s:',
'failed_hooks_title' => 'Gefaalde hooks:',
'failed_steps_title' => 'Gefaalde stappen:',
'pending_steps_title' => 'Onafgewerkte 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% geslaagd',
'failed_count' => '[1,Inf] %1% gefaald',
'pending_count' => '[1,Inf] %1% wachtende',
'undefined_count' => '[1,Inf] %1% niet gedefinieerd',
'skipped_count' => '[1,Inf] %1% overgeslagen',
'scenarios_count' => '{0} Geen scenario\'s|{1} 1 scenario|]1,Inf] %count% scenario\'s',
'steps_count' => '{0} Geen stappen|{1} 1 stap|]1,Inf] %count% stappen',
'passed_count' => '[1,Inf] %count% geslaagd',
'failed_count' => '[1,Inf] %count% gefaald',
'pending_count' => '[1,Inf] %count% wachtende',
'undefined_count' => '[1,Inf] %count% niet gedefinieerd',
'skipped_count' => '[1,Inf] %count% overgeslagen',
),
'no' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> mangler steg. Definer dem med disse snuttene:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Snutter for de følgende stegene i <snippet_keyword>%1%</snippet_keyword>-samlingen ble ikke laget. (Sjekk konfigurasjonen din.):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> mangler steg. Definer dem med disse snuttene:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Snutter for de følgende stegene i <snippet_keyword>%count%</snippet_keyword>-samlingen ble ikke laget. (Sjekk konfigurasjonen din.):</snippet_undefined>',
'failed_scenarios_title' => 'Feilende scenarier:',
'failed_hooks_title' => 'Feilende hooks:',
'failed_steps_title' => 'Feilende steg:',
'pending_steps_title' => 'Ikke implementerte steg:',
'scenarios_count' => '{0} Ingen scenarier|{1} 1 scenario|]1,Inf] %1% scenarier',
'steps_count' => '{0} Ingen steg|{1} 1 steg|]1,Inf] %1% steg',
'passed_count' => '[1,Inf] %1% ok',
'failed_count' => '[1,Inf] %1% feilet',
'pending_count' => '[1,Inf] %1% ikke implementert',
'undefined_count' => '[1,Inf] %1% ikke definert',
'skipped_count' => '[1,Inf] %1% hoppet over',
'scenarios_count' => '{0} Ingen scenarier|{1} 1 scenario|]1,Inf] %count% scenarier',
'steps_count' => '{0} Ingen steg|{1} 1 steg|]1,Inf] %count% steg',
'passed_count' => '[1,Inf] %count% ok',
'failed_count' => '[1,Inf] %count% feilet',
'pending_count' => '[1,Inf] %count% ikke implementert',
'undefined_count' => '[1,Inf] %count% ikke definert',
'skipped_count' => '[1,Inf] %count% hoppet over',
),
'pl' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> zawiera brakujące kroki. Utwórz je korzystając z tych fragmentów kodu:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Fragmenty kodu dla następujących kroków <snippet_keyword>%1%</snippet_keyword> nie zostały wygenerowane (sprawdź swoją konfigurację):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> zawiera brakujące kroki. Utwórz je korzystając z tych fragmentów kodu:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Fragmenty kodu dla następujących kroków <snippet_keyword>%count%</snippet_keyword> nie zostały wygenerowane (sprawdź swoją konfigurację):</snippet_undefined>',
'failed_scenarios_title' => 'Nieudane scenariusze:',
'failed_hooks_title' => 'Nieudane hooki:',
'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',
'scenarios_count' => '{0} Brak scenariuszy|{1} 1 scenariusz|{2,3,4,22,23,24,32,33,34,42,43,44} %count% scenariusze|]4,Inf] %count% scenariuszy',
'steps_count' => '{0} Brak kroków|{1} 1 krok|{2,3,4,22,23,24,32,33,34,42,43,44} %count% kroki|]4,Inf] %count% kroków',
'passed_count' => '{1} %count% udany|{2,3,4,22,23,24,32,33,34,42,43,44} %count% udane|]4,Inf] %count% udanych',
'failed_count' => '{1} %count% nieudany|{2,3,4,22,23,24,32,33,34,42,43,44} %count% nieudane|]4,Inf] %count% nieudanych',
'pending_count' => '{1} %count% oczekujący|{2,3,4,22,23,24,32,33,34,42,43,44} %count% oczekujące|]4,Inf] %count% oczekujących',
'undefined_count' => '{1} %count% niezdefiniowany|{2,3,4,22,23,24,32,33,34,42,43,44} %count% niezdefiniowane|]4,Inf] %count% niezdefiniowanych',
'skipped_count' => '{1} %count% pominięty|{2,3,4,22,23,24,32,33,34,42,43,44} %count% pominięte|]4,Inf] %count% pominiętych',
),
'pt' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> contém definições em falta. Defina-as com estes exemplos:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Os exemplos para as seguintes definições da suite <snippet_keyword>%1%</snippet_keyword> não foram gerados (verifique a configuração):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> contém definições em falta. Defina-as com estes exemplos:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Os exemplos para as seguintes definições da suite <snippet_keyword>%count%</snippet_keyword> não foram gerados (verifique a configuração):</snippet_undefined>',
'failed_scenarios_title' => 'Cenários que falharam:',
'failed_hooks_title' => 'Hooks que falharam:',
'failed_steps_title' => 'Definições que falharam:',
'pending_steps_title' => 'Definições por definir:',
'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %1% cenários',
'steps_count' => '{0} Nenhuma definição|{1} 1 definição|]1,Inf] %1% definições',
'passed_count' => '{1} passou|]1,Inf] %1% passaram',
'failed_count' => '{1} falhou|]1,Inf] %1% falharam',
'pending_count' => '[1,Inf] %1% por definir',
'undefined_count' => '{1} indefinido|]1,Inf] %1% indefinidos',
'skipped_count' => '{1} omitido|]1,Inf] %1% omitidos',
'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %count% cenários',
'steps_count' => '{0} Nenhuma definição|{1} 1 definição|]1,Inf] %count% definições',
'passed_count' => '{1} passou|]1,Inf] %count% passaram',
'failed_count' => '{1} falhou|]1,Inf] %count% falharam',
'pending_count' => '[1,Inf] %count% por definir',
'undefined_count' => '{1} indefinido|]1,Inf] %count% indefinidos',
'skipped_count' => '{1} omitido|]1,Inf] %count% omitidos',
),
'pt-BR' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> possue etapas faltando. Defina elas com esse(s) trecho(s) de código:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Trecho de códigos para as seguintes etapas em <snippet_keyword>%1%</snippet_keyword> suite não foram geradas (verique sua configuração):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> possue etapas faltando. Defina elas com esse(s) trecho(s) de código:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Trecho de códigos para as seguintes etapas em <snippet_keyword>%count%</snippet_keyword> suite não foram geradas (verique sua configuração):</snippet_undefined>',
'failed_scenarios_title' => 'Cenários falhados:',
'failed_hooks_title' => 'Hooks falhados:',
'failed_steps_title' => 'Etapas falhadas:',
'pending_steps_title' => 'Etapas pendentes:',
'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %1% cenários',
'steps_count' => '{0} Nenhuma etapa|{1} 1 etapa|]1,Inf] %1% etapas',
'passed_count' => '[1,Inf] %1% passou',
'failed_count' => '[1,Inf] %1% falhou',
'pending_count' => '[1,Inf] %1% pendente',
'undefined_count' => '[1,Inf] %1% indefinido',
'skipped_count' => '[1,Inf] %1% pulado',
'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %count% cenários',
'steps_count' => '{0} Nenhuma etapa|{1} 1 etapa|]1,Inf] %count% etapas',
'passed_count' => '[1,Inf] %count% passou',
'failed_count' => '[1,Inf] %count% falhou',
'pending_count' => '[1,Inf] %count% pendente',
'undefined_count' => '[1,Inf] %count% indefinido',
'skipped_count' => '[1,Inf] %count% pulado',
),
'ro' => array(
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%1%</snippet_keyword> are pași lipsa. Puteți implementa pașii cu ajutorul acestor fragmente de cod:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Fragmentele de cod pentru urmatorii pași din suita <snippet_keyword>%1%</snippet_keyword> nu au fost generate (contextul tau implementeaza interfata SnippetAcceptingContext?):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_undefined><snippet_keyword>%count%</snippet_keyword> are pași lipsa. Puteți implementa pașii cu ajutorul acestor fragmente de cod:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Fragmentele de cod pentru urmatorii pași din suita <snippet_keyword>%count%</snippet_keyword> nu au fost generate (contextul tau implementeaza interfata SnippetAcceptingContext?):</snippet_undefined>',
'skipped_scenarios_title' => 'Scenarii omise:',
'failed_scenarios_title' => 'Scenarii eșuate:',
'failed_hooks_title' => 'Hook-uri eșuate:',
'failed_steps_title' => 'Pași esuați:',
'pending_steps_title' => 'Pași in așteptare:',
'scenarios_count' => '{0} Niciun scenariu|{1} 1 scenariu|]1,Inf] %1% scenarii',
'steps_count' => '{0} Niciun pas|{1} 1 pas|]1,Inf] %1% pasi',
'passed_count' => '[1,Inf] %1% cu succes',
'failed_count' => '[1,Inf] %1% fara success',
'pending_count' => '[1,Inf] %1% in așteptare',
'undefined_count' => '[1,Inf] %1% fara implementare',
'skipped_count' => '{1} %1% omis|]1,Inf] %1% omiși',
'scenarios_count' => '{0} Niciun scenariu|{1} 1 scenariu|]1,Inf] %count% scenarii',
'steps_count' => '{0} Niciun pas|{1} 1 pas|]1,Inf] %count% pasi',
'passed_count' => '[1,Inf] %count% cu succes',
'failed_count' => '[1,Inf] %count% fara success',
'pending_count' => '[1,Inf] %count% in așteptare',
'undefined_count' => '[1,Inf] %count% fara implementare',
'skipped_count' => '{1} %count% omis|]1,Inf] %count% omiși',
),
'ru' => array(
'snippet_proposal_title' => '<snippet_keyword>%1%</snippet_keyword> <snippet_undefined>не содержит необходимых определений. Вы можете добавить их используя шаблоны:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Шаблоны для следующих шагов в среде <snippet_keyword>%1%</snippet_keyword> не были сгенерированы (проверьте ваши настройки):</snippet_undefined>',
'snippet_proposal_title' => '<snippet_keyword>%count%</snippet_keyword> <snippet_undefined>не содержит необходимых определений. Вы можете добавить их используя шаблоны:</snippet_undefined>',
'snippet_missing_title' => '<snippet_undefined>Шаблоны для следующих шагов в среде <snippet_keyword>%count%</snippet_keyword> не были сгенерированы (проверьте ваши настройки):</snippet_undefined>',
'skipped_scenarios_title' => 'Пропущенные сценарии:',
'failed_scenarios_title' => 'Проваленные сценарии:',
'failed_hooks_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% пропущено',
'scenarios_count' => '{0} Нет сценариев|{1,21,31} %count% сценарий|{2,3,4,22,23,24} %count% сценария|]4,Inf] %count% сценариев',
'steps_count' => '{0} Нет шагов|{1,21,31} %count% шаг|{2,3,4,22,23,24} %count% шага|]4,Inf] %count% шагов',
'passed_count' => '{1,21,31} %count% пройден|]1,Inf] %count% пройдено',
'failed_count' => '{1,21,31} %count% провален|]1,Inf] %count% провалено',
'pending_count' => '[1,Inf] %count% в ожидании',
'undefined_count' => '{1,21,31} %count% не определен|]1,Inf] %count% не определено',
'skipped_count' => '{1,21,31} %count% пропущен|]1,Inf] %count% пропущено',
),
);

View file

@ -46,7 +46,7 @@ use Behat\Testwork\Translator\ServiceContainer\TranslatorExtension;
*/
final class ApplicationFactory extends BaseFactory
{
const VERSION = '3.3.0';
public const VERSION = '3.8.1';
/**
* {@inheritdoc}
@ -110,19 +110,23 @@ final class ApplicationFactory extends BaseFactory
*/
protected function getConfigPath()
{
$cwd = rtrim(getcwd(), DIRECTORY_SEPARATOR);
$paths = 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'
$cwd = rtrim(getcwd(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$configDir = $cwd . 'config' . DIRECTORY_SEPARATOR;
$paths = array(
$cwd . 'behat.yaml',
$cwd . 'behat.yml',
$cwd . 'behat.yaml.dist',
$cwd . 'behat.yml.dist',
$configDir . 'behat.yaml',
$configDir . 'behat.yml',
$configDir . 'behat.yaml.dist',
$configDir . 'behat.yml.dist',
);
if (count($paths)) {
return current($paths);
foreach ($paths as $path) {
if (is_file($path)) {
return $path;
}
}
return null;

View file

@ -18,6 +18,8 @@ use Behat\Testwork\Suite\Suite;
* @see ContextEnvironmentHandler
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*
* @deprecated and will be removed in 4.0. Use CompositeArgumentResolverFactory instead
*/
final class CompositeFactory implements SuiteScopedResolverFactory
{

View file

@ -10,6 +10,7 @@
namespace Behat\Behat\Context\Argument;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\Suite\Suite;
/**
@ -19,7 +20,7 @@ use Behat\Testwork\Suite\Suite;
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
final class NullFactory implements SuiteScopedResolverFactory
final class NullFactory implements ArgumentResolverFactory, SuiteScopedResolverFactory
{
/**
* {@inheritdoc}
@ -28,4 +29,12 @@ final class NullFactory implements SuiteScopedResolverFactory
{
return array();
}
/**
* {@inheritdoc}
*/
public function createArgumentResolvers(Environment $environment)
{
return array();
}
}

View file

@ -18,6 +18,8 @@ use Behat\Testwork\Suite\Suite;
* @see ContextEnvironmentHandler
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*
* @deprecated since 3.4. Use `ArgumentResolverFactory` instead
*/
interface SuiteScopedResolverFactory
{

View file

@ -17,12 +17,12 @@ use Behat\Behat\Context\Snippet\Generator\ContextSnippetGenerator;
use Behat\Behat\Context\Snippet\Generator\FixedContextIdentifier;
use Behat\Behat\Context\Snippet\Generator\FixedPatternIdentifier;
use Behat\Behat\Context\Snippet\Generator\AggregateContextIdentifier;
use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Testwork\Cli\Controller;
use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Configures which context snippets are generated for.

View file

@ -12,11 +12,11 @@ namespace Behat\Behat\Context\Cli;
use Behat\Behat\Context\Environment\ContextEnvironment;
use Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier;
use Behat\Behat\Definition\Translator\TranslatorInterface;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Interactive identifier that asks user for input.
@ -51,13 +51,13 @@ final class InteractiveContextIdentifier implements TargetContextIdentifier
$this->input = $input;
$this->output = $output;
}
/**
* {@inheritdoc}
*/
public function guessTargetContextClass(ContextEnvironment $environment)
{
if ($this->interactionIsNotSupported()) {
if (!$this->input->isInteractive()) {
return null;
}
@ -68,9 +68,9 @@ final class InteractiveContextIdentifier implements TargetContextIdentifier
return null;
}
$message = $this->translator->trans('snippet_context_choice', array('%1%' => $suiteName), 'output');
$message = $this->translator->trans('snippet_context_choice', array('%count%' => $suiteName), 'output');
$choices = array_values(array_merge(array('None'), $contextClasses));
$default = current($contextClasses);
$default = 1;
$answer = $this->askQuestion('>> ' . $message, $choices, $default);
@ -94,21 +94,4 @@ final class InteractiveContextIdentifier implements TargetContextIdentifier
return $helper->ask($this->input, $this->output, $question);
}
/**
* Checks if interactive mode is supported.
*
* @return Boolean
*
* @deprecated there is a better way to do it - `InputInterface::isInteractive()` method.
* Sadly, this doesn't work properly prior Symfony\Console 2.7 and as we need
* to support 2.5+ until the next major, we are forced to do a more explicit
* check for the CLI option. This should be reverted back to proper a
* `InputInterface::isInteractive()` call as soon as we bump dependencies
* to Symfony\Console 3.x in Behat 4.x.
*/
private function interactionIsNotSupported()
{
return $this->input->hasParameterOption('--no-interaction');
}
}

View file

@ -28,7 +28,7 @@ interface ClassGenerator
* @param Suite $suite
* @param string $contextClass
*
* @return Boolean
* @return bool
*/
public function supportsSuiteAndClass(Suite $suite, $contextClass);

View file

@ -26,7 +26,7 @@ interface ClassResolver
*
* @param string $contextString
*
* @return Boolean
* @return bool
*/
public function supportsClass($contextString);

View file

@ -10,6 +10,7 @@
namespace Behat\Behat\Context;
use Behat\Testwork\Argument\Validator;
use Behat\Behat\Context\Argument\ArgumentResolver;
use Behat\Behat\Context\Initializer\ContextInitializer;
use Behat\Testwork\Argument\ArgumentOrganiser;
@ -34,6 +35,10 @@ final class ContextFactory
* @var ContextInitializer[]
*/
private $contextInitializers = array();
/**
* @var Validator
*/
private $validator;
/**
* Initialises factory.
@ -43,6 +48,7 @@ final class ContextFactory
public function __construct(ArgumentOrganiser $argumentOrganiser)
{
$this->argumentOrganiser = $argumentOrganiser;
$this->validator = new Validator();
}
/**
@ -96,17 +102,21 @@ final class ContextFactory
*/
private function resolveArguments(ReflectionClass $reflection, array $arguments, array $resolvers)
{
$newArguments = $arguments;
foreach ($resolvers as $resolver) {
$arguments = $resolver->resolveArguments($reflection, $arguments);
$newArguments = $resolver->resolveArguments($reflection, $newArguments);
}
if (!$reflection->hasMethod('__construct') || !count($arguments)) {
return $arguments;
if (!$reflection->hasMethod('__construct')) {
return $newArguments;
}
$constructor = $reflection->getConstructor();
$newArguments = $this->argumentOrganiser->organiseArguments($constructor, $newArguments);
$this->validator->validateArguments($constructor, $newArguments);
return $this->argumentOrganiser->organiseArguments($constructor, $arguments);
return $newArguments;
}
/**
@ -120,7 +130,7 @@ final class ContextFactory
private function createInstance(ReflectionClass $reflection, array $arguments)
{
if (count($arguments)) {
return $reflection->newInstanceArgs($arguments);
return $reflection->newInstanceArgs(array_values($arguments));
}
return $reflection->newInstance();

View file

@ -25,7 +25,7 @@ interface ContextEnvironment extends Environment
/**
* Checks if environment has any contexts registered.
*
* @return Boolean
* @return bool
*/
public function hasContexts();
@ -41,7 +41,7 @@ interface ContextEnvironment extends Environment
*
* @param string $class
*
* @return Boolean
* @return bool
*/
public function hasContextClass($class);
}

View file

@ -11,6 +11,8 @@
namespace Behat\Behat\Context\Environment\Handler;
use Behat\Behat\Context\Argument\SuiteScopedResolverFactory;
use Behat\Behat\Context\Argument\SuiteScopedResolverFactoryAdapter;
use Behat\Behat\Context\Argument\ArgumentResolverFactory;
use Behat\Behat\Context\Argument\NullFactory;
use Behat\Behat\Context\ContextClass\ClassResolver;
use Behat\Behat\Context\ContextFactory;
@ -36,7 +38,7 @@ final class ContextEnvironmentHandler implements EnvironmentHandler
*/
private $contextFactory;
/**
* @var SuiteScopedResolverFactory
* @var ArgumentResolverFactory
*/
private $resolverFactory;
/**
@ -47,12 +49,17 @@ final class ContextEnvironmentHandler implements EnvironmentHandler
/**
* Initializes handler.
*
* @param ContextFactory $factory
* @param SuiteScopedResolverFactory $resolverFactory
* @param ContextFactory $factory
* @param ArgumentResolverFactory|SuiteScopedResolverFactory $resolverFactory
*/
public function __construct(ContextFactory $factory, SuiteScopedResolverFactory $resolverFactory = null)
public function __construct(ContextFactory $factory, $resolverFactory = null)
{
$this->contextFactory = $factory;
if ($resolverFactory && !$resolverFactory instanceof ArgumentResolverFactory) {
$resolverFactory = new SuiteScopedResolverFactoryAdapter($resolverFactory);
}
$this->resolverFactory = $resolverFactory ?: new NullFactory();
}
@ -108,7 +115,7 @@ final class ContextEnvironmentHandler implements EnvironmentHandler
}
$environment = new InitializedContextEnvironment($uninitializedEnvironment->getSuite());
$resolvers = $this->resolverFactory->generateArgumentResolvers($uninitializedEnvironment->getSuite());
$resolvers = $this->resolverFactory->createArgumentResolvers($environment);
foreach ($uninitializedEnvironment->getContextClassesWithArguments() as $class => $arguments) {
$context = $this->contextFactory->createContext($class, $arguments, $resolvers);

View file

@ -13,8 +13,10 @@ namespace Behat\Behat\Context\Environment;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\Environment\Handler\ContextEnvironmentHandler;
use Behat\Behat\Context\Exception\ContextNotFoundException;
use Behat\Behat\HelperContainer\Environment\ServiceContainerEnvironment;
use Behat\Testwork\Call\Callee;
use Behat\Testwork\Suite\Suite;
use Psr\Container\ContainerInterface;
/**
* Context environment based on a list of instantiated context objects.
@ -23,12 +25,16 @@ use Behat\Testwork\Suite\Suite;
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
final class InitializedContextEnvironment implements ContextEnvironment
final class InitializedContextEnvironment implements ContextEnvironment, ServiceContainerEnvironment
{
/**
* @var string
*/
private $suite;
/**
* @var ContainerInterface
*/
private $serviceContainer;
/**
* @var Context[]
*/
@ -54,6 +60,14 @@ final class InitializedContextEnvironment implements ContextEnvironment
$this->contexts[get_class($context)] = $context;
}
/**
* {@inheritdoc}
*/
public function setServiceContainer(ContainerInterface $container = null)
{
$this->serviceContainer = $container;
}
/**
* {@inheritdoc}
*/
@ -117,6 +131,14 @@ final class InitializedContextEnvironment implements ContextEnvironment
return $this->contexts[$class];
}
/**
* {@inheritdoc}
*/
public function getServiceContainer()
{
return $this->serviceContainer;
}
/**
* {@inheritdoc}
*/

View file

@ -11,6 +11,7 @@
namespace Behat\Behat\Context\Reader;
use Behat\Behat\Context\Annotation\AnnotationReader;
use Behat\Behat\Context\Annotation\DocBlockHelper;
use Behat\Behat\Context\Environment\ContextEnvironment;
use Behat\Testwork\Call\Callee;
use ReflectionClass;
@ -24,7 +25,7 @@ use ReflectionMethod;
*/
final class AnnotatedContextReader implements ContextReader
{
const DOCLINE_TRIMMER_REGEX = '/^\/\*\*\s*|^\s*\*\s*|\s*\*\/$|\s*$/';
public const DOCLINE_TRIMMER_REGEX = '/^\/\*\*\s*|^\s*\*\s*|\s*\*\/$|\s*$/';
/**
* @var string[]
@ -42,6 +43,21 @@ final class AnnotatedContextReader implements ContextReader
*/
private $readers = array();
/**
* @var DocBlockHelper
*/
private $docBlockHelper;
/**
* Initializes reader.
*
* @param DocBlockHelper $docBlockHelper
*/
public function __construct(DocBlockHelper $docBlockHelper)
{
$this->docBlockHelper = $docBlockHelper;
}
/**
* Registers annotation reader.
*
@ -110,7 +126,7 @@ final class AnnotatedContextReader implements ContextReader
private function readDocBlockCallees($class, ReflectionMethod $method, $docBlock)
{
$callees = array();
$description = $this->readDescription($docBlock);
$description = $this->docBlockHelper->extractDescription($docBlock);
$docBlock = $this->mergeMultilines($docBlock);
foreach (explode("\n", $docBlock) as $docLine) {
@ -144,43 +160,12 @@ final class AnnotatedContextReader implements ContextReader
return preg_replace("#\\\\$\s*+\*\s*+([^\\\\$]++)#m", '$1', $docBlock);
}
/**
* Extracts a description from the provided docblock,
* with support for multiline descriptions.
*
* @param string $docBlock
*
* @return string
*/
private function readDescription($docBlock)
{
// Remove indentation
$description = preg_replace('/^[\s\t]*/m', '', $docBlock);
// Remove block comment syntax
$description = preg_replace('/^\/\*\*\s*|^\s*\*\s|^\s*\*\/$/m', '', $description);
// Remove annotations
$description = preg_replace('/^@.*$/m', '', $description);
// Ignore docs after a "--" separator
if (preg_match('/^--.*$/m', $description)) {
$descriptionParts = preg_split('/^--.*$/m', $description);
$description = array_shift($descriptionParts);
}
// Trim leading and trailing newlines
$description = trim($description, "\r\n");
return $description;
}
/**
* Checks if provided doc lien is empty.
*
* @param string $docLine
*
* @return Boolean
* @return bool
*/
private function isEmpty($docLine)
{
@ -192,7 +177,7 @@ final class AnnotatedContextReader implements ContextReader
*
* @param string $docLine
*
* @return Boolean
* @return bool
*/
private function isNotAnnotation($docLine)
{
@ -229,7 +214,7 @@ final class AnnotatedContextReader implements ContextReader
*
* @param string $docLine
*
* @return Boolean
* @return bool
*/
private function isIgnoredAnnotation($docLine)
{

View file

@ -39,20 +39,27 @@ final class ContextExtension implements Extension
/**
* Available services
*/
const FACTORY_ID = 'context.factory';
const CONTEXT_SNIPPET_GENERATOR_ID = 'snippet.generator.context';
const AGGREGATE_RESOLVER_FACTORY_ID = 'context.argument.aggregate_resolver_factory';
public const FACTORY_ID = 'context.factory';
public const CONTEXT_SNIPPET_GENERATOR_ID = 'snippet.generator.context';
public const AGGREGATE_RESOLVER_FACTORY_ID = 'context.argument.aggregate_resolver_factory';
private const ENVIRONMENT_HANDLER_ID = EnvironmentExtension::HANDLER_TAG . '.context';
private const ENVIRONMENT_READER_ID = EnvironmentExtension::READER_TAG . '.context';
private const SUITE_SETUP_ID = SuiteExtension::SETUP_TAG . '.suite_with_contexts';
private const ANNOTATED_CONTEXT_READER_ID = self::READER_TAG . '.annotated';
private const ATTRIBUTED_CONTEXT_READER_ID = self::READER_TAG . '.attributed';
/*
* Available extension points
*/
const CLASS_RESOLVER_TAG = 'context.class_resolver';
const ARGUMENT_RESOLVER_TAG = 'context.argument_resolver';
const INITIALIZER_TAG = 'context.initializer';
const READER_TAG = 'context.reader';
const ANNOTATION_READER_TAG = 'context.annotation_reader';
const CLASS_GENERATOR_TAG = 'context.class_generator';
const SUITE_SCOPED_RESOLVER_FACTORY_TAG = 'context.argument.suite_resolver_factory';
public const CLASS_RESOLVER_TAG = 'context.class_resolver';
public const ARGUMENT_RESOLVER_TAG = 'context.argument_resolver';
public const INITIALIZER_TAG = 'context.initializer';
public const READER_TAG = 'context.reader';
public const ANNOTATION_READER_TAG = 'context.annotation_reader';
public const ATTRIBUTE_READER_TAG = 'context.attribute_reader';
public const CLASS_GENERATOR_TAG = 'context.class_generator';
public const SUITE_SCOPED_RESOLVER_FACTORY_TAG = 'context.argument.suite_resolver_factory';
public const DOC_BLOCK_HELPER_ID = 'context.docblock_helper';
/**
* @var ServiceProcessor
@ -106,6 +113,7 @@ final class ContextExtension implements Extension
$this->loadSnippetsController($container);
$this->loadDefaultClassGenerators($container);
$this->loadDefaultContextReaders($container);
$this->loadDocblockHelper($container);
}
/**
@ -120,6 +128,7 @@ final class ContextExtension implements Extension
$this->processContextReaders($container);
$this->processClassGenerators($container);
$this->processAnnotationReaders($container);
$this->processAttributeReaders($container);
}
/**
@ -142,7 +151,7 @@ final class ContextExtension implements Extension
*/
private function loadArgumentResolverFactory(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Argument\CompositeFactory');
$definition = new Definition('Behat\Behat\Context\Argument\CompositeArgumentResolverFactory');
$container->setDefinition(self::AGGREGATE_RESOLVER_FACTORY_ID, $definition);
}
@ -158,7 +167,7 @@ final class ContextExtension implements Extension
new Reference(self::AGGREGATE_RESOLVER_FACTORY_ID)
));
$definition->addTag(EnvironmentExtension::HANDLER_TAG, array('priority' => 50));
$container->setDefinition(self::getEnvironmentHandlerId(), $definition);
$container->setDefinition(self::ENVIRONMENT_HANDLER_ID, $definition);
}
/**
@ -170,7 +179,7 @@ final class ContextExtension implements Extension
{
$definition = new Definition('Behat\Behat\Context\Environment\Reader\ContextEnvironmentReader');
$definition->addTag(EnvironmentExtension::READER_TAG, array('priority' => 50));
$container->setDefinition(self::getEnvironmentReaderId(), $definition);
$container->setDefinition(self::ENVIRONMENT_READER_ID, $definition);
}
/**
@ -185,7 +194,7 @@ final class ContextExtension implements Extension
new Reference(FilesystemExtension::LOGGER_ID)
));
$definition->addTag(SuiteExtension::SETUP_TAG, array('priority' => 20));
$container->setDefinition(self::getSuiteSetupId(), $definition);
$container->setDefinition(self::SUITE_SETUP_ID, $definition);
}
/**
@ -248,15 +257,57 @@ final class ContextExtension implements Extension
*/
private function loadDefaultContextReaders(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Reader\AnnotatedContextReader');
$container->setDefinition(self::getAnnotatedContextReaderId(), $definition);
$this->loadAnnotatedContextReader($container);
$this->loadAttributedContextReader($container);
$this->loadTranslatableContextReader($container);
}
/**
* Loads AnnotatedContextReader
*
* @param ContainerBuilder $container
*/
private function loadAnnotatedContextReader(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Reader\AnnotatedContextReader', array(
new Reference(self::DOC_BLOCK_HELPER_ID)
));
$container->setDefinition(self::ANNOTATED_CONTEXT_READER_ID, $definition);
$definition = new Definition('Behat\Behat\Context\Reader\ContextReaderCachedPerContext', array(
new Reference(self::getAnnotatedContextReaderId())
new Reference(self::ANNOTATED_CONTEXT_READER_ID)
));
$definition->addTag(self::READER_TAG, array('priority' => 50));
$container->setDefinition(self::getAnnotatedContextReaderId() . '.cached', $definition);
$container->setDefinition(self::ANNOTATED_CONTEXT_READER_ID . '.cached', $definition);
}
/**
* Loads AttributedContextReader
*
* @param ContainerBuilder $container
*/
private function loadAttributedContextReader(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Reader\AttributeContextReader');
$container->setDefinition(self::ATTRIBUTED_CONTEXT_READER_ID, $definition);
$definition = new Definition('Behat\Behat\Context\Reader\ContextReaderCachedPerContext', array(
new Reference(self::ATTRIBUTED_CONTEXT_READER_ID)
));
$definition->addTag(self::READER_TAG, array('priority' => 50));
$container->setDefinition(self::ATTRIBUTED_CONTEXT_READER_ID . '.cached', $definition);
return $definition;
}
/**
* Loads TranslatableContextReader
*
* @param ContainerBuilder $container
*/
private function loadTranslatableContextReader(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Reader\TranslatableContextReader', array(
new Reference(TranslatorExtension::TRANSLATOR_ID)
));
@ -269,6 +320,18 @@ final class ContextExtension implements Extension
$container->setDefinition(self::READER_TAG . '.translatable.cached', $definition);
}
/**
* Loads DocBlockHelper
*
* @param ContainerBuilder $container
*/
private function loadDocblockHelper(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Annotation\DocBlockHelper');
$container->setDefinition(self::DOC_BLOCK_HELPER_ID, $definition);
}
/**
* Processes all class resolvers.
*
@ -277,7 +340,7 @@ final class ContextExtension implements Extension
private function processClassResolvers(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::CLASS_RESOLVER_TAG);
$definition = $container->getDefinition(self::getEnvironmentHandlerId());
$definition = $container->getDefinition(self::ENVIRONMENT_HANDLER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerClassResolver', array($reference));
@ -337,7 +400,7 @@ final class ContextExtension implements Extension
private function processContextReaders(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::READER_TAG);
$definition = $container->getDefinition(self::getEnvironmentReaderId());
$definition = $container->getDefinition(self::ENVIRONMENT_READER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerContextReader', array($reference));
@ -352,7 +415,7 @@ final class ContextExtension implements Extension
private function processClassGenerators(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::CLASS_GENERATOR_TAG);
$definition = $container->getDefinition(self::getSuiteSetupId());
$definition = $container->getDefinition(self::SUITE_SETUP_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerClassGenerator', array($reference));
@ -367,7 +430,7 @@ final class ContextExtension implements Extension
private function processAnnotationReaders(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::ANNOTATION_READER_TAG);
$definition = $container->getDefinition(self::getAnnotatedContextReaderId());
$definition = $container->getDefinition(self::ANNOTATED_CONTEXT_READER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerAnnotationReader', array($reference));
@ -375,42 +438,17 @@ final class ContextExtension implements Extension
}
/**
* Returns context environment handler service id.
* Processes all attribute readers.
*
* @return string
* @param ContainerBuilder $container
*/
private static function getEnvironmentHandlerId()
private function processAttributeReaders(ContainerBuilder $container)
{
return EnvironmentExtension::HANDLER_TAG . '.context';
}
$references = $this->processor->findAndSortTaggedServices($container, self::ATTRIBUTE_READER_TAG);
$definition = $container->getDefinition(self::ATTRIBUTED_CONTEXT_READER_ID);
/**
* Returns context environment reader id.
*
* @return string
*/
private static function getEnvironmentReaderId()
{
return EnvironmentExtension::READER_TAG . '.context';
}
/**
* Returns context suite setup id.
*
* @return string
*/
private static function getSuiteSetupId()
{
return SuiteExtension::SETUP_TAG . '.suite_with_contexts';
}
/**
* Returns annotated context reader id.
*
* @return string
*/
private static function getAnnotatedContextReaderId()
{
return self::READER_TAG . '.annotated';
foreach ($references as $reference) {
$definition->addMethodCall('registerAttributeReader', array($reference));
}
}
}

View file

@ -25,7 +25,7 @@ final class ContextSnippetAppender implements SnippetAppender
/**
* @const PendingException class
*/
const PENDING_EXCEPTION_CLASS = 'Behat\Behat\Tester\Exception\PendingException';
public const PENDING_EXCEPTION_CLASS = 'Behat\Behat\Tester\Exception\PendingException';
/**
* @var FilesystemLogger
@ -81,7 +81,7 @@ final class ContextSnippetAppender implements SnippetAppender
* @param string $class
* @param string $contextFileContent
*
* @return Boolean
* @return bool
*/
private function isClassImported($class, $contextFileContent)
{

View file

@ -324,7 +324,7 @@ TPL;
*/
private function getAlreadyProposedMethods($contextClass)
{
return isset(self::$proposedMethods[$contextClass]) ? self::$proposedMethods[$contextClass] : array();
return self::$proposedMethods[$contextClass] ?? array();
}
/**

View file

@ -16,7 +16,7 @@ use Behat\Testwork\Filesystem\FilesystemLogger;
use Behat\Testwork\Suite\Exception\SuiteConfigurationException;
use Behat\Testwork\Suite\Setup\SuiteSetup;
use Behat\Testwork\Suite\Suite;
use Symfony\Component\ClassLoader\ClassLoader;
use Composer\Autoload\ClassLoader;
/**
* Generates classes for all contexts in the suite using autoloader.

View file

@ -26,6 +26,11 @@ final class PatternTransformer
*/
private $policies = array();
/**
* @var string[]
*/
private $patternToRegexpCache = array();
/**
* Registers pattern policy.
*
@ -34,6 +39,7 @@ final class PatternTransformer
public function registerPatternPolicy(PatternPolicy $policy)
{
$this->policies[] = $policy;
$this->patternToRegexpCache = array();
}
/**
@ -67,6 +73,22 @@ final class PatternTransformer
* @throws UnknownPatternException
*/
public function transformPatternToRegex($pattern)
{
if (!isset($this->patternToRegexpCache[$pattern])) {
$this->patternToRegexpCache[$pattern] = $this->transformPatternToRegexWithSupportedPolicy($pattern);
}
return $this->patternToRegexpCache[$pattern];
}
/**
* @param string $pattern
*
* @return string
*
* @throws UnknownPatternException
*/
private function transformPatternToRegexWithSupportedPolicy($pattern)
{
foreach ($this->policies as $policy) {
if ($policy->supportsPattern($pattern)) {

View file

@ -27,7 +27,7 @@ interface PatternPolicy
*
* @param string $type
*
* @return Boolean
* @return bool
*/
public function supportsPatternType($type);
@ -45,7 +45,7 @@ interface PatternPolicy
*
* @param string $pattern
*
* @return Boolean
* @return bool
*/
public function supportsPattern($pattern);

View file

@ -65,7 +65,7 @@ final class RegexPatternPolicy implements PatternPolicy
{
if (false === @preg_match($pattern, 'anything')) {
$error = error_get_last();
$errorMessage = isset($error['message']) ? $error['message'] : '';
$errorMessage = $error['message'] ?? '';
throw new InvalidPatternException(sprintf('The regex `%s` is invalid: %s', $pattern, $errorMessage));
}

View file

@ -21,11 +21,11 @@ use Behat\Transliterator\Transliterator;
*/
final class TurnipPatternPolicy implements PatternPolicy
{
const TOKEN_REGEX = "[\"']?(?P<%s>(?<=\")[^\"]*(?=\")|(?<=')[^']*(?=')|\-?[\w\.\,]+)['\"]?";
public const TOKEN_REGEX = "[\"']?(?P<%s>(?<=\")[^\"]*(?=\")|(?<=')[^']*(?=')|\-?[\w\.\,]+)['\"]?";
const PLACEHOLDER_REGEXP = "/\\\:(\w+)/";
const OPTIONAL_WORD_REGEXP = '/(\s)?\\\\\(([^\\\]+)\\\\\)(\s)?/';
const ALTERNATIVE_WORD_REGEXP = '/(\w+)\\\\\/(\w+)/';
public const PLACEHOLDER_REGEXP = "/\\\:(\w+)/";
public const OPTIONAL_WORD_REGEXP = '/(\s)?\\\\\(([^\\\]+)\\\\\)(\s)?/';
public const ALTERNATIVE_WORD_REGEXP = '/(\w+)\\\\\/(\w+)/';
/**
* @var string[]
@ -100,7 +100,7 @@ final class TurnipPatternPolicy implements PatternPolicy
$regex = $this->replaceTurnipOptionalEndingWithRegex($regex);
$regex = $this->replaceTurnipAlternativeWordsWithRegex($regex);
return '/^' . $regex . '$/i';
return '/^' . $regex . '$/iu';
}
/**

View file

@ -131,6 +131,17 @@ final class ConsoleDefinitionInformationPrinter extends ConsoleDefinitionPrinter
)
);
if ($this->isVerbose()) {
$lines[] = strtr(
'{space}<def_dimmed>|</def_dimmed> on `{filepath}[{start}:{end}]`', array(
'{space}' => str_pad('', mb_strlen($suite->getName(), 'utf8') + 1),
'{filepath}' => $definition->getReflection()->getFileName(),
'{start}' => $definition->getReflection()->getStartLine(),
'{end}' => $definition->getReflection()->getEndLine()
)
);
}
return $lines;
}
}

View file

@ -110,4 +110,14 @@ abstract class ConsoleDefinitionPrinter implements DefinitionPrinter
{
return $this->translator->translateDefinition($suite, $definition);
}
/**
* Returns whether verbosity is verbose (-v).
*
* @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
*/
final protected function isVerbose()
{
return $this->output->isVerbose();
}
}

View file

@ -47,7 +47,7 @@ final class SearchResult
/**
* Checks if result contains a match.
*
* @return Boolean
* @return bool
*/
public function hasMatch()
{

View file

@ -35,17 +35,18 @@ final class DefinitionExtension implements Extension
/*
* Available services
*/
const FINDER_ID = 'definition.finder';
const REPOSITORY_ID = 'definition.repository';
const PATTERN_TRANSFORMER_ID = 'definition.pattern_transformer';
const WRITER_ID = 'definition.writer';
const DEFINITION_TRANSLATOR_ID = 'definition.translator';
public const FINDER_ID = 'definition.finder';
public const REPOSITORY_ID = 'definition.repository';
public const PATTERN_TRANSFORMER_ID = 'definition.pattern_transformer';
public const WRITER_ID = 'definition.writer';
public const DEFINITION_TRANSLATOR_ID = 'definition.translator';
/*
* Available extension points
*/
const SEARCH_ENGINE_TAG = 'definition.search_engine';
const PATTERN_POLICY_TAG = 'definition.pattern_policy';
public const SEARCH_ENGINE_TAG = 'definition.search_engine';
public const PATTERN_POLICY_TAG = 'definition.pattern_policy';
public const DOC_BLOCK_HELPER_ID = 'definition.doc_block_helper';
/**
* @var ServiceProcessor
@ -97,8 +98,10 @@ final class DefinitionExtension implements Extension
$this->loadDefaultSearchEngines($container);
$this->loadDefaultPatternPolicies($container);
$this->loadAnnotationReader($container);
$this->loadAttributeReader($container);
$this->loadDefinitionPrinters($container);
$this->loadController($container);
$this->loadDocblockHelper($container);
}
/**
@ -217,6 +220,20 @@ final class DefinitionExtension implements Extension
$container->setDefinition(ContextExtension::ANNOTATION_READER_TAG . '.definition', $definition);
}
/**
* Loads definition Attribute reader.
*
* @param ContainerBuilder $container
*/
private function loadAttributeReader(ContainerBuilder $container)
{
$definition = new Definition('\Behat\Behat\Definition\Context\Attribute\DefinitionAttributeReader', array(
new Reference(self::DOC_BLOCK_HELPER_ID)
));
$definition->addTag(ContextExtension::ATTRIBUTE_READER_TAG, array('priority' => 50));
$container->setDefinition(ContextExtension::ATTRIBUTE_READER_TAG . '.definition', $definition);
}
/**
* Loads definition printers.
*
@ -258,6 +275,18 @@ final class DefinitionExtension implements Extension
$container->setDefinition(CliExtension::CONTROLLER_TAG . '.available_definitions', $definition);
}
/**
* Loads DocBlockHelper
*
* @param ContainerBuilder $container
*/
private function loadDocblockHelper(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Annotation\DocBlockHelper');
$container->setDefinition(self::DOC_BLOCK_HELPER_ID, $definition);
}
/**
* Processes all search engines in the container.
*

View file

@ -12,7 +12,6 @@ namespace Behat\Behat\Definition\Translator;
use Behat\Behat\Definition\Definition;
use Behat\Testwork\Suite\Suite;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Translates definitions using translator component.

View file

@ -18,6 +18,7 @@ use Behat\Testwork\EventDispatcher\Event\AfterExerciseAborted;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteAborted;
use Behat\Testwork\EventDispatcher\Event\ExerciseCompleted;
use Behat\Testwork\EventDispatcher\Event\SuiteTested;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\Interpretation\ResultInterpretation;
use Behat\Testwork\Tester\Result\Interpretation\SoftInterpretation;
use Behat\Testwork\Tester\Result\Interpretation\StrictInterpretation;
@ -100,8 +101,8 @@ final class StopOnFailureController implements Controller
return;
}
$this->eventDispatcher->dispatch(SuiteTested::AFTER, new AfterSuiteAborted($event->getEnvironment()));
$this->eventDispatcher->dispatch(ExerciseCompleted::AFTER, new AfterExerciseAborted());
$this->eventDispatcher->dispatch(new AfterSuiteAborted($event->getEnvironment()), SuiteTested::AFTER);
$this->eventDispatcher->dispatch(new AfterExerciseAborted(), ExerciseCompleted::AFTER);
exit(1);
}

View file

@ -86,7 +86,7 @@ final class AfterStepSetup extends StepTested implements AfterSetup
/**
* Checks if step call, setup or teardown produced any output (stdOut or exception).
*
* @return Boolean
* @return bool
*/
public function hasOutput()
{

View file

@ -111,7 +111,7 @@ final class AfterStepTested extends StepTested implements AfterTested
/**
* Checks if step call, setup or teardown produced any output (stdOut or exception).
*
* @return Boolean
* @return bool
*/
public function hasOutput()
{
@ -121,7 +121,7 @@ final class AfterStepTested extends StepTested implements AfterTested
/**
* Checks if step teardown has output.
*
* @return Boolean
* @return bool
*/
private function teardownHasOutput()
{
@ -131,7 +131,7 @@ final class AfterStepTested extends StepTested implements AfterTested
/**
* Checks if result has produced exception.
*
* @return Boolean
* @return bool
*/
private function resultHasException()
{
@ -141,7 +141,7 @@ final class AfterStepTested extends StepTested implements AfterTested
/**
* Checks if result is executed and call result has produced exception or stdOut.
*
* @return Boolean
* @return bool
*/
private function resultCallHasOutput()
{

View file

@ -21,10 +21,10 @@ use Behat\Testwork\EventDispatcher\Event\LifecycleEvent;
*/
abstract class BackgroundTested extends LifecycleEvent implements ScenarioLikeTested
{
const BEFORE = 'tester.background_tested.before';
const AFTER_SETUP = 'tester.background_tested.after_setup';
const BEFORE_TEARDOWN = 'tester.background_tested.before_teardown';
const AFTER = 'tester.background_tested.after';
public const BEFORE = 'tester.background_tested.before';
public const AFTER_SETUP = 'tester.background_tested.after_setup';
public const BEFORE_TEARDOWN = 'tester.background_tested.before_teardown';
public const AFTER = 'tester.background_tested.after';
/**
* Returns background node.

View file

@ -93,7 +93,7 @@ final class BeforeStepTeardown extends StepTested implements BeforeTeardown
/**
* Checks if step call produced any output (stdOut or exception).
*
* @return Boolean
* @return bool
*/
public function hasOutput()
{
@ -103,7 +103,7 @@ final class BeforeStepTeardown extends StepTested implements BeforeTeardown
/**
* Checks if result has produced exception.
*
* @return Boolean
* @return bool
*/
private function resultHasException()
{
@ -113,7 +113,7 @@ final class BeforeStepTeardown extends StepTested implements BeforeTeardown
/**
* Checks if result is executed and call result has produced exception or stdOut.
*
* @return Boolean
* @return bool
*/
private function resultCallHasOutput()
{

View file

@ -17,8 +17,8 @@ namespace Behat\Behat\EventDispatcher\Event;
*/
interface ExampleTested
{
const BEFORE = 'tester.example_tested.before';
const AFTER_SETUP = 'tester.example_tested.after_setup';
const BEFORE_TEARDOWN = 'tester.example_tested.before_teardown';
const AFTER = 'tester.example_tested.after';
public const BEFORE = 'tester.example_tested.before';
public const AFTER_SETUP = 'tester.example_tested.after_setup';
public const BEFORE_TEARDOWN = 'tester.example_tested.before_teardown';
public const AFTER = 'tester.example_tested.after';
}

View file

@ -21,10 +21,10 @@ use Behat\Testwork\EventDispatcher\Event\LifecycleEvent;
*/
abstract class FeatureTested extends LifecycleEvent implements GherkinNodeTested
{
const BEFORE = 'tester.feature_tested.before';
const AFTER_SETUP = 'tester.feature_tested.after_setup';
const BEFORE_TEARDOWN = 'tester.feature_tested.before_teardown';
const AFTER = 'tester.feature_tested.after';
public const BEFORE = 'tester.feature_tested.before';
public const AFTER_SETUP = 'tester.feature_tested.after_setup';
public const BEFORE_TEARDOWN = 'tester.feature_tested.before_teardown';
public const AFTER = 'tester.feature_tested.after';
/**
* Returns feature.

View file

@ -22,10 +22,10 @@ use Behat\Testwork\EventDispatcher\Event\LifecycleEvent;
*/
abstract class OutlineTested extends LifecycleEvent implements GherkinNodeTested
{
const BEFORE = 'tester.outline_tested.before';
const AFTER_SETUP = 'tester.outline_tested.after_setup';
const BEFORE_TEARDOWN = 'tester.outline_tested.before_teardown';
const AFTER = 'tester.outline_tested.after';
public const BEFORE = 'tester.outline_tested.before';
public const AFTER_SETUP = 'tester.outline_tested.after_setup';
public const BEFORE_TEARDOWN = 'tester.outline_tested.before_teardown';
public const AFTER = 'tester.outline_tested.after';
/**
* Returns feature.

View file

@ -19,10 +19,10 @@ use Behat\Testwork\EventDispatcher\Event\LifecycleEvent;
*/
abstract class ScenarioTested extends LifecycleEvent implements ScenarioLikeTested
{
const BEFORE = 'tester.scenario_tested.before';
const AFTER_SETUP = 'tester.scenario_tested.after_setup';
const BEFORE_TEARDOWN = 'tester.scenario_tested.before_teardown';
const AFTER = 'tester.scenario_tested.after';
public const BEFORE = 'tester.scenario_tested.before';
public const AFTER_SETUP = 'tester.scenario_tested.after_setup';
public const BEFORE_TEARDOWN = 'tester.scenario_tested.before_teardown';
public const AFTER = 'tester.scenario_tested.after';
/**
* {@inheritdoc}

View file

@ -21,10 +21,10 @@ use Behat\Testwork\EventDispatcher\Event\LifecycleEvent;
*/
abstract class StepTested extends LifecycleEvent implements GherkinNodeTested
{
const BEFORE = 'tester.step_tested.before';
const AFTER_SETUP = 'tester.step_tested.after_setup';
const BEFORE_TEARDOWN = 'tester.step_tested.before_teardown';
const AFTER = 'tester.step_tested.after';
public const BEFORE = 'tester.step_tested.before';
public const AFTER_SETUP = 'tester.step_tested.after_setup';
public const BEFORE_TEARDOWN = 'tester.step_tested.before_teardown';
public const AFTER = 'tester.step_tested.after';
/**
* Returns feature.

View file

@ -156,20 +156,18 @@ class EventDispatcherExtension extends BaseExtension
}
/**
* Loads ticking step tester.
* This method used in the past to load the TickingStepTester to work around
* a bug with the scope of declare(ticks) in PHP < 7.1. Since we don't
* support those PHP versions anymore loading the TickingStepTester is
* no longer needed. This method is left here to prevent breaking BC.
*
* @todo Remove this method in next major
*
* @deprecated
*
* @param ContainerBuilder $container
*/
protected function loadTickingStepTester(ContainerBuilder $container)
{
if (!function_exists('pcntl_signal')) {
return;
}
$definition = new Definition('Behat\Behat\EventDispatcher\Tester\TickingStepTester', array(
new Reference(TesterExtension::STEP_TESTER_ID)
));
$definition->addTag(TesterExtension::STEP_TESTER_WRAPPER_TAG, array('priority' => 9999));
$container->setDefinition(TesterExtension::STEP_TESTER_WRAPPER_TAG . '.ticking', $definition);
}
}

View file

@ -18,6 +18,7 @@ use Behat\Behat\EventDispatcher\Event\BeforeBackgroundTested;
use Behat\Behat\Tester\BackgroundTester;
use Behat\Gherkin\Node\FeatureNode;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@ -55,12 +56,14 @@ final class EventDispatchingBackgroundTester implements BackgroundTester
public function setUp(Environment $env, FeatureNode $feature, $skip)
{
$event = new BeforeBackgroundTested($env, $feature, $feature->getBackground());
$this->eventDispatcher->dispatch($event::BEFORE, $event);
$this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $skip);
$event = new AfterBackgroundSetup($env, $feature, $feature->getBackground(), $setup);
$this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@ -79,12 +82,14 @@ final class EventDispatchingBackgroundTester implements BackgroundTester
public function tearDown(Environment $env, FeatureNode $feature, $skip, TestResult $result)
{
$event = new BeforeBackgroundTeardown($env, $feature, $feature->getBackground(), $result);
$this->eventDispatcher->dispatch(BackgroundTested::BEFORE_TEARDOWN, $event);
$this->eventDispatcher->dispatch($event, BackgroundTested::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $skip, $result);
$event = new AfterBackgroundTested($env, $feature, $feature->getBackground(), $result, $teardown);
$this->eventDispatcher->dispatch(BackgroundTested::AFTER, $event);
$this->eventDispatcher->dispatch($event, BackgroundTested::AFTER);
return $teardown;
}

View file

@ -15,6 +15,7 @@ use Behat\Behat\EventDispatcher\Event\AfterFeatureTested;
use Behat\Behat\EventDispatcher\Event\BeforeFeatureTeardown;
use Behat\Behat\EventDispatcher\Event\BeforeFeatureTested;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Behat\Testwork\Tester\SpecificationTester;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@ -53,12 +54,14 @@ final class EventDispatchingFeatureTester implements SpecificationTester
public function setUp(Environment $env, $feature, $skip)
{
$event = new BeforeFeatureTested($env, $feature);
$this->eventDispatcher->dispatch($event::BEFORE, $event);
$this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $skip);
$event = new AfterFeatureSetup($env, $feature, $setup);
$this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@ -77,12 +80,14 @@ final class EventDispatchingFeatureTester implements SpecificationTester
public function tearDown(Environment $env, $feature, $skip, TestResult $result)
{
$event = new BeforeFeatureTeardown($env, $feature, $result);
$this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
$this->eventDispatcher->dispatch($event, $event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $skip, $result);
$event = new AfterFeatureTested($env, $feature, $result, $teardown);
$this->eventDispatcher->dispatch($event::AFTER, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}

View file

@ -18,6 +18,7 @@ use Behat\Behat\Tester\OutlineTester;
use Behat\Gherkin\Node\FeatureNode;
use Behat\Gherkin\Node\OutlineNode;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@ -55,12 +56,14 @@ final class EventDispatchingOutlineTester implements OutlineTester
public function setUp(Environment $env, FeatureNode $feature, OutlineNode $outline, $skip)
{
$event = new BeforeOutlineTested($env, $feature, $outline);
$this->eventDispatcher->dispatch($event::BEFORE, $event);
$this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $outline, $skip);
$event = new AfterOutlineSetup($env, $feature, $outline, $setup);
$this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@ -79,12 +82,14 @@ final class EventDispatchingOutlineTester implements OutlineTester
public function tearDown(Environment $env, FeatureNode $feature, OutlineNode $outline, $skip, TestResult $result)
{
$event = new BeforeOutlineTeardown($env, $feature, $outline, $result);
$this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
$this->eventDispatcher->dispatch( $event,$event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $outline, $skip, $result);
$event = new AfterOutlineTested($env, $feature, $outline, $result, $teardown);
$this->eventDispatcher->dispatch($event::AFTER, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}

View file

@ -18,6 +18,7 @@ use Behat\Behat\Tester\ScenarioTester;
use Behat\Gherkin\Node\FeatureNode;
use Behat\Gherkin\Node\ScenarioInterface as Scenario;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@ -85,12 +86,14 @@ final class EventDispatchingScenarioTester implements ScenarioTester
public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario, $skip)
{
$event = new BeforeScenarioTested($env, $feature, $scenario);
$this->eventDispatcher->dispatch($this->beforeEventName, $event);
$this->eventDispatcher->dispatch($event, $this->beforeEventName);
$setup = $this->baseTester->setUp($env, $feature, $scenario, $skip);
$event = new AfterScenarioSetup($env, $feature, $scenario, $setup);
$this->eventDispatcher->dispatch($this->afterSetupEventName, $event);
$this->eventDispatcher->dispatch($event, $this->afterSetupEventName);
return $setup;
}
@ -109,12 +112,14 @@ final class EventDispatchingScenarioTester implements ScenarioTester
public function tearDown(Environment $env, FeatureNode $feature, Scenario $scenario, $skip, TestResult $result)
{
$event = new BeforeScenarioTeardown($env, $feature, $scenario, $result);
$this->eventDispatcher->dispatch($this->beforeTeardownEventName, $event);
$this->eventDispatcher->dispatch($event, $this->beforeTeardownEventName);
$teardown = $this->baseTester->tearDown($env, $feature, $scenario, $skip, $result);
$event = new AfterScenarioTested($env, $feature, $scenario, $result, $teardown);
$this->eventDispatcher->dispatch($this->afterEventName, $event);
$this->eventDispatcher->dispatch($event, $this->afterEventName);
return $teardown;
}

View file

@ -19,6 +19,7 @@ use Behat\Behat\Tester\StepTester;
use Behat\Gherkin\Node\FeatureNode;
use Behat\Gherkin\Node\StepNode;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
@ -55,12 +56,14 @@ final class EventDispatchingStepTester implements StepTester
public function setUp(Environment $env, FeatureNode $feature, StepNode $step, $skip)
{
$event = new BeforeStepTested($env, $feature, $step);
$this->eventDispatcher->dispatch($event::BEFORE, $event);
$this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $step, $skip);
$event = new AfterStepSetup($env, $feature, $step, $setup);
$this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@ -79,12 +82,14 @@ final class EventDispatchingStepTester implements StepTester
public function tearDown(Environment $env, FeatureNode $feature, StepNode $step, $skip, StepResult $result)
{
$event = new BeforeStepTeardown($env, $feature, $step, $result);
$this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
$this->eventDispatcher->dispatch($event, $event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $step, $skip, $result);
$event = new AfterStepTested($env, $feature, $step, $result, $teardown);
$this->eventDispatcher->dispatch($event::AFTER, $event);
$this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}

View file

@ -21,6 +21,11 @@ use Behat\Testwork\Environment\Environment;
* to handle an interupt (on PHP7)
*
* @see Behat\Testwork\EventDispatcher\Cli\SigintController
*
* @deprecated Since the way signals are handled changed to use pcntl_signal_dispatch
* this class is no longer needed.
*
* @todo Remove this class in the next major version
*
* @author Peter Mitchell <peterjmit@gmail.com>
*/

View file

@ -10,6 +10,7 @@
namespace Behat\Behat\Gherkin\Cli;
use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Gherkin\Keywords\KeywordsDumper;
use Behat\Testwork\Cli\Controller;
use Symfony\Component\Console\Command\Command;
@ -17,7 +18,6 @@ use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Prints example of the feature to present all available syntax keywords.

View file

@ -35,14 +35,14 @@ final class GherkinExtension implements Extension
/*
* Available services
*/
const MANAGER_ID = 'gherkin';
const KEYWORDS_DUMPER_ID = 'gherkin.keywords_dumper';
const KEYWORDS_ID = 'gherkin.keywords';
public const MANAGER_ID = 'gherkin';
public const KEYWORDS_DUMPER_ID = 'gherkin.keywords_dumper';
public const KEYWORDS_ID = 'gherkin.keywords';
/*
* Available extension points
*/
const LOADER_TAG = 'gherkin.loader';
public const LOADER_TAG = 'gherkin.loader';
/**
* @var ServiceProcessor
@ -225,6 +225,7 @@ final class GherkinExtension implements Extension
}
$definition->addMethodCall('setCache', array($cacheDefinition));
$definition->addMethodCall('setBasePath', array('%paths.base%'));
$definition->addTag(self::LOADER_TAG, array('priority' => 50));
$container->setDefinition('gherkin.loader.gherkin_file', $definition);
}

View file

@ -84,7 +84,7 @@ final class LazyFeatureIterator implements SpecificationIterator
/**
* {@inheritdoc}
*/
public function rewind()
public function rewind(): void
{
$this->position = 0;
$this->moveToNextAvailableFeature();
@ -93,7 +93,7 @@ final class LazyFeatureIterator implements SpecificationIterator
/**
* {@inheritdoc}
*/
public function next()
public function next(): void
{
$this->moveToNextAvailableFeature();
}
@ -101,7 +101,7 @@ final class LazyFeatureIterator implements SpecificationIterator
/**
* {@inheritdoc}
*/
public function valid()
public function valid(): bool
{
return null !== $this->currentFeature;
}
@ -109,7 +109,7 @@ final class LazyFeatureIterator implements SpecificationIterator
/**
* {@inheritdoc}
*/
public function key()
public function key(): int
{
return $this->position;
}
@ -117,7 +117,7 @@ final class LazyFeatureIterator implements SpecificationIterator
/**
* {@inheritdoc}
*/
public function current()
public function current(): FeatureNode
{
return $this->currentFeature;
}

View file

@ -51,7 +51,7 @@ final class FilesystemRerunScenariosListLocator implements SpecificationLocator
*/
public function locateSpecifications(Suite $suite, $locator)
{
if (!is_file($locator) || 'rerun' !== pathinfo($locator, PATHINFO_EXTENSION)) {
if (null === $locator || !is_file($locator) || 'rerun' !== pathinfo($locator, PATHINFO_EXTENSION)) {
return new NoSpecificationsIterator($suite);
}

View file

@ -51,7 +51,7 @@ final class FilesystemScenariosListLocator implements SpecificationLocator
*/
public function locateSpecifications(Suite $suite, $locator)
{
if (!is_file($locator) || 'scenarios' !== pathinfo($locator, PATHINFO_EXTENSION)) {
if (null === $locator || !is_file($locator) || 'scenarios' !== pathinfo($locator, PATHINFO_EXTENSION)) {
return new NoSpecificationsIterator($suite);
}

View file

@ -97,7 +97,7 @@ final class SuiteWithPathsSetup implements SuiteSetup
*
* @param string $file A file path
*
* @return Boolean
* @return bool
*/
private function isAbsolutePath($file)
{

View file

@ -11,7 +11,8 @@
namespace Behat\Behat\HelperContainer\Argument;
use Behat\Behat\Context\Argument\ArgumentResolver;
use Interop\Container\ContainerInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use ReflectionClass;
/**
@ -40,6 +41,8 @@ final class ServicesResolver implements ArgumentResolver
/**
* {@inheritdoc}
*
* @throws ContainerExceptionInterface
*/
public function resolveArguments(ReflectionClass $classReflection, array $arguments)
{
@ -55,10 +58,12 @@ final class ServicesResolver implements ArgumentResolver
* @param mixed $value
*
* @return mixed
*
* @throws ContainerExceptionInterface
*/
private function resolveArgument($value)
{
if ('@' === mb_substr($value, 0, 1)) {
if (is_string($value) && 0 === mb_strpos($value, '@')) {
return $this->container->get(mb_substr($value, 1));
}

View file

@ -10,13 +10,17 @@
namespace Behat\Behat\HelperContainer\Argument;
use Behat\Behat\Context\Argument\ArgumentResolver;
use Behat\Behat\HelperContainer\Environment\ServiceContainerEnvironment;
use Behat\Behat\Context\Argument\ArgumentResolverFactory;
use Behat\Behat\Context\Argument\SuiteScopedResolverFactory;
use Behat\Behat\HelperContainer\BuiltInServiceContainer;
use Behat\Behat\HelperContainer\Exception\WrongContainerClassException;
use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException;
use Behat\Behat\HelperContainer\ServiceContainer\HelperContainerExtension;
use Behat\Testwork\Environment\Environment;
use Behat\Testwork\Suite\Suite;
use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\TaggedContainerInterface;
/**
@ -26,7 +30,7 @@ use Symfony\Component\DependencyInjection\TaggedContainerInterface;
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
final class ServicesResolverFactory implements SuiteScopedResolverFactory
final class ServicesResolverFactory implements SuiteScopedResolverFactory, ArgumentResolverFactory
{
/**
* @var TaggedContainerInterface
@ -45,16 +49,50 @@ final class ServicesResolverFactory implements SuiteScopedResolverFactory
/**
* {@inheritdoc}
*
* @deprecated as part of SuiteScopedResolverFactory deprecation. Would be removed in 4.0
*
* @throws WrongServicesConfigurationException
* @throws WrongContainerClassException
*/
public function generateArgumentResolvers(Suite $suite)
{
@trigger_error(
'SuiteScopedResolverFactory::generateArgumentResolvers() was deprecated and will be removed in 4.0',
E_USER_DEPRECATED
);
if (!$suite->hasSetting('services')) {
return array();
}
$container = $this->createContainer($suite->getSetting('services'));
return array($this->createArgumentResolver($container));
return $this->createResolvers($container, false);
}
/**
* {@inheritdoc}
*
* @throws WrongServicesConfigurationException
* @throws WrongContainerClassException
*/
public function createArgumentResolvers(Environment $environment)
{
$suite = $environment->getSuite();
if (!$suite->hasSetting('services')) {
return array();
}
$container = $this->createContainer($suite->getSetting('services'));
$autowire = $suite->hasSetting('autowire') && $suite->getSetting('autowire');
if ($environment instanceof ServiceContainerEnvironment) {
$environment->setServiceContainer($container);
}
return $this->createResolvers($container, $autowire);
}
/**
@ -63,6 +101,8 @@ final class ServicesResolverFactory implements SuiteScopedResolverFactory
* @param string $settings
*
* @return mixed
*
* @throws WrongServicesConfigurationException
*/
private function createContainer($settings)
{
@ -85,10 +125,12 @@ final class ServicesResolverFactory implements SuiteScopedResolverFactory
* @param string $settings
*
* @return mixed
*
* @throws WrongServicesConfigurationException
*/
private function createContainerFromString($settings)
{
if ('@' === mb_substr($settings, 0, 1)) {
if (0 === mb_strpos($settings, '@')) {
return $this->loadContainerFromContainer(mb_substr($settings, 1));
}
@ -113,12 +155,14 @@ final class ServicesResolverFactory implements SuiteScopedResolverFactory
* @param string $name
*
* @return mixed
*
* @throws WrongServicesConfigurationException
*/
private function loadContainerFromContainer($name)
{
$services = $this->container->findTaggedServiceIds(HelperContainerExtension::HELPER_CONTAINER_TAG);
if (!in_array($name, array_keys($services))) {
if (!array_key_exists($name, $services)) {
throw new WrongServicesConfigurationException(
sprintf('Service container `@%s` was not found.', $name)
);
@ -138,7 +182,7 @@ final class ServicesResolverFactory implements SuiteScopedResolverFactory
{
$constructor = explode('::', $classSpec);
if (2 == count($constructor)) {
if (2 === count($constructor)) {
return call_user_func($constructor);
}
@ -149,21 +193,28 @@ final class ServicesResolverFactory implements SuiteScopedResolverFactory
* Checks if container implements the correct interface and creates resolver using it.
*
* @param mixed $container
* @param bool $autowire
*
* @return ServicesResolver
* @return ArgumentResolver[]
*
* @throws WrongContainerClassException
*/
private function createArgumentResolver($container)
private function createResolvers($container, $autowire)
{
if (!$container instanceof ContainerInterface) {
throw new WrongContainerClassException(
sprintf(
'Service container is expected to implement `Interop\Container\ContainerInterface`, but `%s` does not.',
'Service container is expected to implement `Psr\Container\ContainerInterface`, but `%s` does not.',
get_class($container)
),
get_class($container)
);
}
return new ServicesResolver($container);
if ($autowire) {
return array(new ServicesResolver($container), new AutowiringResolver($container));
}
return array(new ServicesResolver($container));
}
}

View file

@ -12,7 +12,6 @@ namespace Behat\Behat\HelperContainer;
use Behat\Behat\HelperContainer\Exception\ServiceNotFoundException;
use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException;
use Interop\Container\ContainerInterface;
use ReflectionClass;
use ReflectionMethod;
@ -47,7 +46,7 @@ final class BuiltInServiceContainer implements ContainerInterface
*/
public function has($id)
{
return isset($this->schema[$id]);
return array_key_exists($id, $this->schema);
}
/**
@ -62,7 +61,7 @@ final class BuiltInServiceContainer implements ContainerInterface
);
}
return $this->instances[$id] = isset($this->instances[$id]) ? $this->instances[$id] : $this->createInstance($id);
return $this->instances[$id] = $this->instances[$id] ?? $this->createInstance($id);
}
/**
@ -99,6 +98,10 @@ final class BuiltInServiceContainer implements ContainerInterface
{
$schema = $this->schema[$id];
if (null === $schema) {
$schema = array('class' => $id);
}
if (is_string($schema)) {
$schema = array('class' => $schema);
}
@ -120,10 +123,7 @@ final class BuiltInServiceContainer implements ContainerInterface
private function getAndValidateClass($id, array $schema)
{
if (!isset($schema['class'])) {
throw new WrongServicesConfigurationException(sprintf(
'All services of the built-in `services` must have `class` option set, but `%s` does not.',
$id
));
$schema['class'] = $id;
}
return $schema['class'];

View file

@ -11,7 +11,6 @@
namespace Behat\Behat\HelperContainer\Exception;
use Behat\Testwork\Environment\Exception\EnvironmentException;
use Interop\Container\Exception\ContainerException;
/**
* All HelperContainer exceptions implement this interface.

View file

@ -10,7 +10,6 @@
namespace Behat\Behat\HelperContainer\Exception;
use Interop\Container\Exception\NotFoundException;
use InvalidArgumentException;
/**

View file

@ -12,12 +12,14 @@ namespace Behat\Behat\HelperContainer\ServiceContainer;
use Behat\Behat\Context\ServiceContainer\ContextExtension;
use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException;
use Behat\Testwork\Call\ServiceContainer\CallExtension;
use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use Behat\Testwork\ServiceContainer\ServiceProcessor;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
/**
* Behat helper container extension.
@ -31,7 +33,7 @@ final class HelperContainerExtension implements Extension
/*
* Available extension points
*/
const HELPER_CONTAINER_TAG = 'helper_container.container';
public const HELPER_CONTAINER_TAG = 'helper_container.container';
/**
* @var ServiceProcessor
@ -75,9 +77,15 @@ final class HelperContainerExtension implements Extension
*/
public function load(ContainerBuilder $container, array $config)
{
$definition = new Definition('Behat\Behat\HelperContainer\Argument\ServicesResolverFactory', array($container));
$definition = new Definition('Behat\Behat\HelperContainer\Argument\ServicesResolverFactory', array(
new Reference('service_container')
));
$definition->addTag(ContextExtension::SUITE_SCOPED_RESOLVER_FACTORY_TAG, array('priority' => 0));
$container->setDefinition(ContextExtension::SUITE_SCOPED_RESOLVER_FACTORY_TAG . '.helper_container', $definition);
$definition = new Definition('Behat\Behat\HelperContainer\Call\Filter\ServicesResolver');
$definition->addTag(CallExtension::CALL_FILTER_TAG, array('priority' => 0));
$container->setDefinition(CallExtension::CALL_FILTER_TAG . '.helper_container', $definition);
}
/**
@ -88,31 +96,11 @@ final class HelperContainerExtension implements Extension
$references = $this->processor->findAndSortTaggedServices($container, self::HELPER_CONTAINER_TAG);
foreach ($references as $reference) {
if ($this->isDefinitionShared($container->getDefinition((string) $reference))) {
if ($container->getDefinition((string) $reference)->isShared()) {
throw new WrongServicesConfigurationException(sprintf(
'Container services must not be configured as shared, but `@%s` is.', $reference
));
}
}
}
/**
* Checks if provided definition is shared.
*
* @param Definition $definition
*
* @return bool
*
* @todo Remove after upgrading to Symfony 2.8+
*/
private function isDefinitionShared(Definition $definition)
{
if (method_exists($definition, 'isShared')) {
return $definition->isShared();
} else if (method_exists($definition, 'getScope')) {
return $definition->getScope() !== ContainerBuilder::SCOPE_PROTOTYPE;
}
return false;
}
}

View file

@ -68,7 +68,7 @@ abstract class RuntimeFeatureHook extends RuntimeFilterableHook
* @param FeatureNode $feature
* @param string $filterString
*
* @return Boolean
* @return bool
*/
private function isMatch(FeatureNode $feature, $filterString)
{
@ -89,7 +89,7 @@ abstract class RuntimeFeatureHook extends RuntimeFilterableHook
* @param FeatureNode $feature
* @param string $filterString
*
* @return Boolean
* @return bool
*/
private function isMatchTagFilter(FeatureNode $feature, $filterString)
{
@ -104,7 +104,7 @@ abstract class RuntimeFeatureHook extends RuntimeFilterableHook
* @param FeatureNode $feature
* @param string $filterString
*
* @return Boolean
* @return bool
*/
private function isMatchNameFilter(FeatureNode $feature, $filterString)
{

View file

@ -48,7 +48,7 @@ abstract class RuntimeScenarioHook extends RuntimeFilterableHook
* @param ScenarioInterface $scenario
* @param string $filterString
*
* @return Boolean
* @return bool
*/
protected function isMatch(FeatureNode $feature, ScenarioInterface $scenario, $filterString)
{
@ -70,16 +70,12 @@ abstract class RuntimeScenarioHook extends RuntimeFilterableHook
* @param ScenarioInterface $scenario
* @param string $filterString
*
* @return Boolean
* @return bool
*/
protected function isMatchTagFilter(FeatureNode $feature, ScenarioInterface $scenario, $filterString)
{
$filter = new TagFilter($filterString);
if ($filter->isFeatureMatch($feature)) {
return true;
}
return $filter->isScenarioMatch($feature, $scenario);
}
@ -89,7 +85,7 @@ abstract class RuntimeScenarioHook extends RuntimeFilterableHook
* @param ScenarioInterface $scenario
* @param string $filterString
*
* @return Boolean
* @return bool
*/
protected function isMatchNameFilter(ScenarioInterface $scenario, $filterString)
{

View file

@ -55,7 +55,7 @@ abstract class RuntimeStepHook extends RuntimeFilterableHook
* @param StepNode $step
* @param string $filterString
*
* @return Boolean
* @return bool
*/
private function isStepMatch(StepNode $step, $filterString)
{

View file

@ -57,7 +57,7 @@ final class HookAnnotationReader implements AnnotationReader
$type = strtolower($match[1]);
$class = self::$classes[$type];
$pattern = isset($match[2]) ? $match[2] : null;
$pattern = $match[2] ?? null;
$callable = array($contextClass, $method->getName());
return new $class($pattern, $callable, $description);

View file

@ -20,8 +20,8 @@ use Behat\Testwork\Hook\Scope\HookScope;
*/
interface FeatureScope extends HookScope
{
const BEFORE = 'feature.before';
const AFTER = 'feature.after';
public const BEFORE = 'feature.before';
public const AFTER = 'feature.after';
/**
* Returns scope feature.

View file

@ -21,8 +21,8 @@ use Behat\Testwork\Hook\Scope\HookScope;
*/
interface ScenarioScope extends HookScope
{
const BEFORE = 'scenario.before';
const AFTER = 'scenario.after';
public const BEFORE = 'scenario.before';
public const AFTER = 'scenario.after';
/**
* Returns scope feature.

View file

@ -21,8 +21,8 @@ use Behat\Testwork\Hook\Scope\HookScope;
*/
interface StepScope extends HookScope
{
const BEFORE = 'step.before';
const AFTER = 'step.after';
public const BEFORE = 'step.before';
public const AFTER = 'step.after';
/**
* Returns scope feature.

View file

@ -11,6 +11,7 @@
namespace Behat\Behat\Hook\ServiceContainer;
use Behat\Behat\Context\ServiceContainer\ContextExtension;
use Behat\Behat\Definition\ServiceContainer\DefinitionExtension;
use Behat\Behat\Tester\ServiceContainer\TesterExtension;
use Behat\Testwork\Hook\ServiceContainer\HookExtension as BaseExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -32,6 +33,7 @@ final class HookExtension extends BaseExtension
parent::load($container, $config);
$this->loadAnnotationReader($container);
$this->loadAttributeReader($container);
}
/**
@ -85,4 +87,18 @@ final class HookExtension extends BaseExtension
$definition->addTag(ContextExtension::ANNOTATION_READER_TAG, array('priority' => 50));
$container->setDefinition(ContextExtension::ANNOTATION_READER_TAG . '.hook', $definition);
}
/**
* Loads hook attribute reader.
*
* @param ContainerBuilder $container
*/
private function loadAttributeReader(ContainerBuilder $container)
{
$definition = new Definition('\Behat\Behat\Hook\Context\Attribute\HookAttributeReader', array(
new Reference(DefinitionExtension::DOC_BLOCK_HELPER_ID)
));
$definition->addTag(ContextExtension::ATTRIBUTE_READER_TAG, array('priority' => 50));
$container->setDefinition(ContextExtension::ATTRIBUTE_READER_TAG . '.hook', $definition);
}
}

View file

@ -15,9 +15,9 @@ use Behat\Behat\EventDispatcher\Event\AfterFeatureTested;
use Behat\Behat\EventDispatcher\Event\FeatureTested;
use Behat\Behat\Output\Node\Printer\FeaturePrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens to feature events and calls appropriate printers.

View file

@ -22,9 +22,9 @@ use Behat\Behat\Output\Node\Printer\OutlinePrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Gherkin\Node\ExampleNode;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens to expanded outline events and calls appropriate printers.

View file

@ -24,10 +24,10 @@ use Behat\Behat\Output\Node\Printer\OutlineTablePrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Tester\Result\StepResult;
use Behat\Gherkin\Node\OutlineNode;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Behat\Testwork\Tester\Setup\Setup;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens to outline table events and calls appropriate printers.
@ -61,7 +61,7 @@ final class OutlineTableListener implements EventListener
*/
private $exampleSetup;
/**
* @var Boolean
* @var bool
*/
private $headerPrinted = false;
/**

View file

@ -13,11 +13,11 @@ namespace Behat\Behat\Output\Node\EventListener\AST;
use Behat\Behat\EventDispatcher\Event\ScenarioLikeTested;
use Behat\Behat\Output\Node\Printer\ScenarioPrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSetup;
use Behat\Testwork\EventDispatcher\Event\AfterTested;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens to scenario events and calls appropriate printers (header/footer).

View file

@ -18,9 +18,9 @@ use Behat\Behat\EventDispatcher\Event\ScenarioTested;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Gherkin\Node\ScenarioLikeInterface;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens to step events and call appropriate printers.

View file

@ -11,11 +11,11 @@
namespace Behat\Behat\Output\Node\EventListener\AST;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteSetup;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteTested;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Behat suite listener.

View file

@ -10,9 +10,9 @@
namespace Behat\Behat\Output\Node\EventListener\Flow;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Behat fire only siblings listener.
@ -37,7 +37,7 @@ class FireOnlySiblingsListener implements EventListener
*/
private $descendant;
/**
* @var Boolean
* @var bool
*/
private $inContext = false;

View file

@ -15,9 +15,9 @@ use Behat\Behat\EventDispatcher\Event\ExampleTested;
use Behat\Behat\EventDispatcher\Event\FeatureTested;
use Behat\Behat\EventDispatcher\Event\OutlineTested;
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Behat first background fires first listener.
@ -34,7 +34,7 @@ class FirstBackgroundFiresFirstListener implements EventListener
*/
private $descendant;
/**
* @var Boolean
* @var bool
*/
private $firstBackgroundEnded = false;
/**
@ -103,7 +103,7 @@ class FirstBackgroundFiresFirstListener implements EventListener
*
* @param Event $event
*
* @return Boolean
* @return bool
*/
private function isEventDelayedUntilFirstBackgroundPrinted(Event $event)
{

View file

@ -14,9 +14,9 @@ use Behat\Behat\EventDispatcher\Event\AfterStepSetup;
use Behat\Behat\EventDispatcher\Event\AfterStepTested;
use Behat\Behat\EventDispatcher\Event\BackgroundTested;
use Behat\Behat\EventDispatcher\Event\FeatureTested;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Behat only first background fires listener.
@ -36,15 +36,15 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*/
private $descendant;
/**
* @var Boolean
* @var bool
*/
private $firstBackgroundEnded = false;
/**
* @var Boolean
* @var bool
*/
private $inBackground = false;
/**
* @var Boolean
* @var bool
*/
private $stepSetupHadOutput = false;
@ -125,7 +125,7 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*
* @param Event $event
*
* @return Boolean
* @return bool
*/
private function isSkippableEvent(Event $event)
{
@ -141,7 +141,7 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*
* @param Event $event
*
* @return Boolean
* @return bool
*/
private function isNonFailingConsequentBackgroundStep(Event $event)
{
@ -157,7 +157,7 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*
* @param Event $event
*
* @return Boolean
* @return bool
*/
private function isStepEventWithOutput(Event $event)
{
@ -169,7 +169,7 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*
* @param Event $event
*
* @return Boolean
* @return bool
*/
private function isBeforeStepEventWithOutput(Event $event)
{
@ -187,7 +187,7 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*
* @param Event $event
*
* @return Boolean
* @return bool
*/
private function isAfterStepWithOutput(Event $event)
{

View file

@ -22,10 +22,10 @@ use Behat\Behat\Output\Node\Printer\JUnit\JUnitScenarioPrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Gherkin\Node\FeatureNode;
use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSetup;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens to feature, scenario and step events and calls appropriate printers.

View file

@ -14,11 +14,11 @@ use Behat\Behat\EventDispatcher\Event\BeforeOutlineTested;
use Behat\Behat\Output\Node\Printer\SuitePrinter;
use Behat\Gherkin\Node\ExampleNode;
use Behat\Gherkin\Node\OutlineNode;
use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteTested;
use Behat\Testwork\EventDispatcher\Event\BeforeSuiteTested;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens for Outline events store the current one

View file

@ -13,6 +13,7 @@ namespace Behat\Behat\Output\Node\EventListener\Statistics;
use Behat\Behat\Output\Statistics\HookStat;
use Behat\Behat\Output\Statistics\Statistics;
use Behat\Testwork\Call\CallResult;
use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSetup;
use Behat\Testwork\EventDispatcher\Event\AfterTested;
use Behat\Testwork\Exception\ExceptionPresenter;
@ -20,7 +21,6 @@ use Behat\Testwork\Hook\Tester\Setup\HookedSetup;
use Behat\Testwork\Hook\Tester\Setup\HookedTeardown;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens and records hook stats.

View file

@ -15,9 +15,9 @@ use Behat\Behat\EventDispatcher\Event\AfterScenarioTested;
use Behat\Behat\EventDispatcher\Event\BeforeFeatureTested;
use Behat\Behat\Output\Statistics\ScenarioStat;
use Behat\Behat\Output\Statistics\Statistics;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens and records scenario events to the statistics.

View file

@ -12,10 +12,10 @@ namespace Behat\Behat\Output\Node\EventListener\Statistics;
use Behat\Behat\Output\Node\Printer\StatisticsPrinter;
use Behat\Behat\Output\Statistics\Statistics;
use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\ExerciseCompleted;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Symfony\Component\EventDispatcher\Event;
/**
* Collects general suite stats such as time and memory during its execution and prints it afterwards.

View file

@ -17,16 +17,15 @@ use Behat\Behat\EventDispatcher\Event\FeatureTested;
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
use Behat\Behat\Output\Statistics\StepStatV2;
use Behat\Behat\Output\Statistics\Statistics;
use Behat\Behat\Output\Statistics\StepStat;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Tester\Result\ExecutedStepResult;
use Behat\Behat\Tester\Result\StepResult;
use Behat\Testwork\Event\Event;
use Behat\Testwork\Exception\ExceptionPresenter;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Behat\Testwork\Tester\Result\ExceptionResult;
use Exception;
use Symfony\Component\EventDispatcher\Event;
/**
* Listens and records step events to statistics.

View file

@ -10,9 +10,9 @@
namespace Behat\Behat\Output\Node\Printer;
use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Testwork\Output\Printer\OutputPrinter;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Behat counter printer.
@ -64,12 +64,12 @@ final class CounterPrinter
$style = $this->resultConverter->convertResultCodeToString($resultCode);
$transId = $style . '_count';
$message = $this->translator->transChoice($transId, $count, array('%1%' => $count), 'output');
$message = $this->translator->trans($transId, array('%count%' => $count), 'output');
$detailedStats[] = sprintf('{+%s}%s{-%s}', $style, $message, $style);
}
$message = $this->translator->transChoice($intro, $totalCount, array('%1%' => $totalCount), 'output');
$message = $this->translator->trans($intro, array('%count%' => $totalCount), 'output');
$printer->write($message);
if (count($detailedStats)) {

View file

@ -79,7 +79,7 @@ final class WidthCalculator
$header = sprintf('%s%s', $indentText, $scenario->getTitle());
} else {
$title = $scenario->getTitle();
$lines = explode("\n", $title);
$lines = explode("\n", $title ?? '');
$header = sprintf('%s%s: %s', $indentText, $scenario->getKeyword(), array_shift($lines));
}

View file

@ -10,6 +10,7 @@
namespace Behat\Behat\Output\Node\Printer\JUnit;
use Behat\Behat\Output\Node\EventListener\JUnit\JUnitDurationListener;
use Behat\Behat\Output\Node\Printer\FeaturePrinter;
use Behat\Behat\Output\Statistics\PhaseStatistics;
use Behat\Behat\Tester\Result\StepResult;
@ -30,9 +31,15 @@ final class JUnitFeaturePrinter implements FeaturePrinter
*/
private $statistics;
public function __construct(PhaseStatistics $statistics)
/**
* @var JUnitDurationListener|null
*/
private $durationListener;
public function __construct(PhaseStatistics $statistics, JUnitDurationListener $durationListener = null)
{
$this->statistics = $statistics;
$this->durationListener = $durationListener;
}
/**
@ -57,6 +64,7 @@ final class JUnitFeaturePrinter implements FeaturePrinter
'skipped' => $stats[TestResult::SKIPPED],
'failures' => $stats[TestResult::FAILED],
'errors' => $stats[TestResult::PENDING] + $stats[StepResult::UNDEFINED],
'time' => $this->durationListener ? $this->durationListener->getFeatureDuration($feature) : '',
));
$this->statistics->reset();
}

View file

@ -11,6 +11,7 @@
namespace Behat\Behat\Output\Node\Printer\JUnit;
use Behat\Behat\Output\Node\EventListener\JUnit\JUnitOutlineStoreListener;
use Behat\Behat\Output\Node\EventListener\JUnit\JUnitDurationListener;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Gherkin\Node\ExampleNode;
use Behat\Gherkin\Node\FeatureNode;
@ -47,10 +48,16 @@ final class JUnitScenarioPrinter
*/
private $outlineStepCount;
public function __construct(ResultToStringConverter $resultConverter, JUnitOutlineStoreListener $outlineListener)
/**
* @var JUnitDurationListener|null
*/
private $durationListener;
public function __construct(ResultToStringConverter $resultConverter, JUnitOutlineStoreListener $outlineListener, JUnitDurationListener $durationListener = null)
{
$this->resultConverter = $resultConverter;
$this->outlineStoreListener = $outlineListener;
$this->durationListener = $durationListener;
}
/**
@ -71,7 +78,9 @@ final class JUnitScenarioPrinter
$outputPrinter->addTestcase(array(
'name' => $name,
'status' => $this->resultConverter->convertResultToString($result)
'classname' => $feature->getTitle(),
'status' => $this->resultConverter->convertResultToString($result),
'time' => $this->durationListener ? $this->durationListener->getDuration($scenario) : ''
));
}

View file

@ -10,6 +10,7 @@
namespace Behat\Behat\Output\Node\Printer;
use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Behat\Output\Statistics\HookStat;
use Behat\Behat\Output\Statistics\ScenarioStat;
@ -18,7 +19,6 @@ use Behat\Behat\Output\Statistics\StepStat;
use Behat\Testwork\Exception\ExceptionPresenter;
use Behat\Testwork\Output\Printer\OutputPrinter;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Behat list printer.

View file

@ -110,7 +110,7 @@ final class PrettyScenarioPrinter implements ScenarioPrinter
*/
private function printTitle(OutputPrinter $printer, $longTitle)
{
$description = explode("\n", $longTitle);
$description = explode("\n", $longTitle ?? '');
$title = array_shift($description);
if ('' !== $title) {
@ -126,7 +126,7 @@ final class PrettyScenarioPrinter implements ScenarioPrinter
*/
private function printDescription(OutputPrinter $printer, $longTitle)
{
$lines = explode("\n", $longTitle);
$lines = explode("\n", $longTitle ?? '');
array_shift($lines);
foreach ($lines as $line) {

View file

@ -56,8 +56,8 @@ final class PrettySetupPrinter implements SetupPrinter
* @param ResultToStringConverter $resultConverter
* @param ExceptionPresenter $exceptionPresenter
* @param integer $indentation
* @param Boolean $newlineBefore
* @param Boolean $newlineAfter
* @param bool $newlineBefore
* @param bool $newlineAfter
*/
public function __construct(
ResultToStringConverter $resultConverter,

View file

@ -129,7 +129,7 @@ final class PrettySkippedStepPrinter implements StepPrinter
* Returns argument string for provided argument.
*
* @param ArgumentInterface $argument
* @param Boolean $collapse
* @param bool $collapse
*
* @return string
*/

View file

@ -180,7 +180,7 @@ final class PrettyStepPrinter implements StepPrinter
* Returns argument string for provided argument.
*
* @param ArgumentInterface $argument
* @param Boolean $collapse
* @param bool $collapse
*
* @return string
*/

View file

@ -19,7 +19,7 @@ use Symfony\Component\Console\Formatter\OutputFormatter as BaseOutputFormatter;
*/
final class ConsoleFormatter extends BaseOutputFormatter
{
const CUSTOM_PATTERN = '/{\+([a-z-_]+)}(.*?){\-\\1}/si';
public const CUSTOM_PATTERN = '/{\+([a-z-_]+)}(.*?){\-\\1}/si';
/**
* Formats a message according to the given styles.
@ -28,7 +28,7 @@ final class ConsoleFormatter extends BaseOutputFormatter
*
* @return string The styled message
*/
public function format($message)
public function format($message): string
{
return preg_replace_callback(self::CUSTOM_PATTERN, array($this, 'replaceStyle'), $message);
}

View file

@ -27,8 +27,8 @@ final class JUnitFormatterFactory implements FormatterFactory
/*
* Available services
*/
const ROOT_LISTENER_ID = 'output.node.listener.junit';
const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
public const ROOT_LISTENER_ID = 'output.node.listener.junit';
public const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
/**
* {@inheritdoc}
@ -73,12 +73,14 @@ final class JUnitFormatterFactory implements FormatterFactory
$definition = new Definition('Behat\Behat\Output\Node\Printer\JUnit\JUnitFeaturePrinter', array(
new Reference('output.junit.statistics'),
new Reference('output.node.listener.junit.duration')
));
$container->setDefinition('output.node.printer.junit.feature', $definition);
$definition = new Definition('Behat\Behat\Output\Node\Printer\JUnit\JUnitScenarioPrinter', array(
new Reference(self::RESULT_TO_STRING_CONVERTER_ID),
new Reference('output.node.listener.junit.outline'),
new Reference('output.node.listener.junit.duration')
));
$container->setDefinition('output.node.printer.junit.scenario', $definition);
@ -109,9 +111,15 @@ final class JUnitFormatterFactory implements FormatterFactory
);
$container->setDefinition('output.node.listener.junit.outline', $definition);
$definition = new Definition(
'Behat\Behat\Output\Node\EventListener\JUnit\JUnitDurationListener'
);
$container->setDefinition('output.node.listener.junit.duration', $definition);
$definition = new Definition('Behat\Testwork\Output\Node\EventListener\ChainEventListener', array(
array(
new Reference('output.node.listener.junit.duration'),
new Reference('output.node.listener.junit.outline'),
new Definition('Behat\Behat\Output\Node\EventListener\JUnit\JUnitFeatureElementListener', array(
new Reference('output.node.printer.junit.feature'),

View file

@ -38,13 +38,13 @@ class PrettyFormatterFactory implements FormatterFactory
/*
* Available services
*/
const ROOT_LISTENER_ID = 'output.node.listener.pretty';
const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
public const ROOT_LISTENER_ID = 'output.node.listener.pretty';
public const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
/*
* Available extension points
*/
const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.pretty.wrapper';
public const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.pretty.wrapper';
/**
* Initializes extension.

View file

@ -34,13 +34,13 @@ class ProgressFormatterFactory implements FormatterFactory
/*
* Available services
*/
const ROOT_LISTENER_ID = 'output.node.listener.progress';
const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
public const ROOT_LISTENER_ID = 'output.node.listener.progress';
public const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
/*
* Available extension points
*/
const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.progress.wrapper';
public const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.progress.wrapper';
/**
* Initializes extension.

View file

@ -112,9 +112,8 @@ final class AggregateSnippet
}
return array_unique(
call_user_func_array(
'array_merge',
array_map(
array_merge(
...array_map(
function (Snippet $snippet) {
if (!$snippet instanceof ContextSnippet) {
return array();

View file

@ -27,7 +27,7 @@ interface SnippetAppender
*
* @param AggregateSnippet $snippet
*
* @return Boolean
* @return bool
*/
public function supportsSnippet(AggregateSnippet $snippet);

View file

@ -30,7 +30,7 @@ interface SnippetGenerator
* @param Environment $environment
* @param StepNode $step
*
* @return Boolean
* @return bool
*/
public function supportsEnvironmentAndStep(Environment $environment, StepNode $step);

View file

@ -10,11 +10,11 @@
namespace Behat\Behat\Snippet\Printer;
use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Snippet\AggregateSnippet;
use Behat\Gherkin\Node\StepNode;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Behat console-based snippet printer.
@ -57,7 +57,7 @@ class ConsoleSnippetPrinter implements SnippetPrinter
*/
public function printSnippets($targetName, array $snippets)
{
$message = $this->translator->trans('snippet_proposal_title', array('%1%' => $targetName), 'output');
$message = $this->translator->trans('snippet_proposal_title', array('%count%' => $targetName), 'output');
$this->output->writeln('--- ' . $message . PHP_EOL);
@ -74,7 +74,7 @@ class ConsoleSnippetPrinter implements SnippetPrinter
*/
public function printUndefinedSteps($suiteName, array $steps)
{
$message = $this->translator->trans('snippet_missing_title', array('%1%' => $suiteName), 'output');
$message = $this->translator->trans('snippet_missing_title', array('%count%' => $suiteName), 'output');
$this->output->writeln('--- ' . $message . PHP_EOL);

Some files were not shown because too many files have changed in this diff Show more