edisonlabs / gherphalizer
Provides a composer plugin that finds and transforms Gherkin files into PHP classes.
Installs: 1 156 797
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 15
Forks: 1
Open Issues: 0
Type:composer-plugin
Requires
- composer-plugin-api: ^2.0
- behat/gherkin: ^4.9
- jawira/case-converter: ^3.5
- nategood/commando: ^0.4
- nette/php-generator: ^4.0
- symfony/finder: ^6
Requires (Dev)
- composer/composer: dev-master
- phpunit/phpunit: ^8.4
This package is auto-updated.
Last update: 2024-10-22 13:11:07 UTC
README
The Gherphalizer
Overview
Provides a composer plugin that finds and transforms Gherkin files into PHP classes.
Installation
Configure the plugin in your composer.json file using for example:
"extra": {
"gherphalizer": {
"files": [
"*"
],
"locations": [
"app/modules",
"app/profiles"
],
"output-dir": "NOT-PUBLIC-FOLDER"
}
}
Where:
files
: List of filenames (without the feature extension) to scan for.locations
: List of paths to scan for Gherkin feature files.output-dir
: The directory where the PHP files will be placed.
How does it work
Every time you run composer install
or composer update
, the plugin will scan the locations for Gherkin feature files, generating PHP classes for them into the output directory.
Command
You can also use the command composer gherphalizer
to run the process.
Use the option --config
to specify a config.json file to override the config defined in the composer.json
: composer gherphalizer --config=config.json
.
The content of the configuration file passed in needs to be in this format:
{
"files": [
"*"
],
"locations": [
"app/modules",
"app/profiles"
],
"output-dir": "NOT-PUBLIC-FOLDER"
}
Contributing
Clone the repository and install all dependencies:
$ composer install
To run the tests simply:
$ ./vendor/bin/phpunit
Notes
- Code formatting in your IDE might have an impact on the tests (how the fixture is formatted vs. the test output)
Automated Tests and Code Sniffer
This repository integrates with Travis CI to perform tests and detect PHP standards violations.