drupol/phpspec-annotation

PHPSpec extension that allows you to use annotated methods for tests.

1.0.0 2018-02-09 13:25 UTC

README

A PHPSpec extension that allows you to use annotated methods for tests.

Installation

composer require drupol/phpspec-annotation --dev

Usage

Enable extension in phpspec.yml (or phpspec.yml.dist) file:

extensions:
  drupol\PhpspecAnnotation\PhpspecAnnotation: ~

Then, you can use the annotation @name in the documentation block of your spec methods.

Example, instead of writing:

public function it_can_read_an_xml_file_with_specific_settings() {
  // test code here
}

You can now write:

/**
 * @name It can read an xml file with specific settings.
 */
public function readXmlFile() {
  // test code here
}

Contributing

Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)