drupol/phpspec-annotation

此包已被废弃,不再维护。未建议替代包。

PHPSpec 扩展,允许您在测试中使用注释方法。

1.2.0 2018-08-20 11:31 UTC

This package is auto-updated.

Last update: 2022-03-21 10:52:25 UTC


README

一个PHPSpec扩展,允许您在测试中使用注释方法。

安装

composer require drupol/phpspec-annotation --dev

用法

phpspec.yml(或phpspec.yml.dist)文件中启用扩展

extensions:
  drupol\PhpspecAnnotation\PhpspecAnnotation: ~

然后,您可以在您的spec方法的文档块中使用注释@name

例如,您现在可以写

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

而不是写

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

贡献

请随时通过发送Github pull requests来为此库做出贡献。我反应很快哦:-)