babdev/phpspec-skip-example-extension

此软件包已被放弃且不再维护。未建议替代软件包。

通过注解跳过 PhpSpec 示例

安装: 226

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 0

分支: 9

开放问题: 0

类型:phpspec-extension

v1.0.0 2021-11-06 15:33 UTC

This package is auto-updated.

Last update: 2022-01-18 03:06:07 UTC


README

此 PhpSpec 扩展允许通过用户友好的注解跳过示例。Run Tests

安装

安装 PhpSpec(参考官方网站上的文档)后,您可以使用以下Composer命令安装此扩展

composer require babdev/phpspec-skip-example-extension

配置

现在您可以在项目根目录创建一个 phpspec.yml 文件来激活此扩展

extensions:
    Akeneo\SkipExampleExtension: ~

使用方法

@require

@require 注解可以用在 spec 类或任何示例方法上。如果 spec 中缺少要求,则所有示例都将被跳过。如果示例中缺少要求,则仅跳过该示例。

/**
 * @require Vendor\Builder\ToolInterface
 */
class BridgeBuilderSpec extends ObjectBehavior
{
    // Will be skipped if the Vendor\Builder\ToolInterface interface does not exist
    function it_builds_a_bridge()
    {
    }

    /**
     * @require Vendor\Builder\ConcreteTruck
     */
    // Will be skipped if the Vendor\Builder\ToolInterface interface or Vendor\Builder\ConcreteTruck class does not exist
    function it_builds_the_road()
    {
    }

    //...
}

贡献

如果您发现一些改进此扩展的有趣方式,请随时为此扩展做出贡献!