定制 usernam3/phpunit_stopwatch_annotations 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

usernam3/phpunit_stopwatch_annotations

Composer 安装命令:

composer require usernam3/phpunit_stopwatch_annotations

包简介

phpunit test case with support for execution time and memory usage assertion in annotations

README 文档

README

PHPUnit stopwatch annotations is a PHPUnit test case with support for execution time and memory usage assertion in annotations. It uses symfony/Stopwatch component for tracking time and memory usage of tests.

Installation

Via Composer

	composer require --dev "usernam3/phpunit_stopwatch_annotations:dev-master"

Usage

To add support of @executionTime and @memoryUsage annotations you need to extend your test case class from \StopwatchAnnotations\TestCase.

@executionTime value is measured in milliseconds @memoryUsage in bytes.

Example of test case:

class ExampleTest extends \StopwatchAnnotations\TestCase {
    /**
     * @test
     * @executionTime 1999
     */
    public function executionTimeFailed()
    {
        sleep(2);
    }
    
    /**
    * @test
    * @memoryUsage 2000000
    */
    public function memoryUsageFailed()
    {
    
    }
}

统计信息

  • 总下载量: 543
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-02