https://github.com/akeneo/phpspecskipexampleextension
Skip your PhpSpec examples through annotations
https://github.com/akeneo/phpspecskipexampleextension
annotation extension php phpspec
Last synced: 10 months ago
JSON representation
Skip your PhpSpec examples through annotations
- Host: GitHub
- URL: https://github.com/akeneo/phpspecskipexampleextension
- Owner: akeneo
- License: mit
- Created: 2014-03-10T22:07:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T15:17:12.000Z (about 5 years ago)
- Last Synced: 2025-07-28T12:13:13.288Z (11 months ago)
- Topics: annotation, extension, php, phpspec
- Language: PHP
- Size: 29.3 KB
- Stars: 33
- Watchers: 49
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PhpSpec Skip Example Extension
This PhpSpec extension allows to skip example through user-friendly annotations.
[](https://travis-ci.org/akeneo/PhpSpecSkipExampleExtension)
## Installation
Once you have installed PhpSpec (following the documentation on [the official website](http://www.phpspec.net)), add the extension requirement to your `composer.json`:
Using phpspec 4.x,
```json
{
"require": {
"akeneo/phpspec-skip-example-extension": "^3.0"
}
}
```
Using phpspec 5.x,
```json
{
"require": {
"akeneo/phpspec-skip-example-extension": "^4.0"
}
}
```
And run composer update:
```bash
$ php composer.phar update akeneo/phpspec-skip-example-extension
```
## Configuration
You can now activate the extension by creating a `phpspec.yml` file at the root of your project:
``` yaml
extensions:
Akeneo\SkipExampleExtension: ~
```
## Usage
### @require
Skips all the spec example if the class or interface is not available
```php
/**
* @require Vendor\Builder\ToolInterface
*/
class BridgeBuilderSpec extends ObjectBehavior
{
// Will be skipped if the Vendor\Builder\ToolInterface interface does not exist
function it_builds_a_brige()
{
}
// Will be skipped if the Vendor\Builder\ToolInterface interface does not exist
function it_builds_the_road()
{
}
//...
}
```
## Contributions
Feel free to contribute to this extension if you find some interesting ways to improve it!