firstruner/phpunit_firstruner
最新稳定版本:1.0.0
Composer 安装命令:
composer require firstruner/phpunit_firstruner
包简介
This is an PHPUnit extension to have a newer CLI result prompting and also add alert on memory and time consuming
README 文档
README
Hi, I'm Christophe and I got tired of having a display that was too reductive with PHPUnit. So I build an extension for PHPUnit that give a result about unit test more beautifull, but also take some parameters for have a checking on the memory consuming and time elapsed.
How Use
Call reference
Simply ! You must call the reference to "Doctrine\Common\Annotations\UnitTestAnnotation" like this :
use Doctrine\Common\Annotations\UnitTestAnnotation;
Parameters
name
name is a required field, it give a name to your class or method
description
description is an optional fiels, it give you a description in your test results
item
item is a name of the tested POO object, like the class name
element
element is a name of the tested POO function, property, ...
memoryLimit
memoryLimit fixe a limit about consumption limit for a class or method (not implemented for a method) The value is expressed in octets
executionTimeLimit
executionTimeLimit fixe a limit for execute all assertion in a test or in class test The value is expressed in seconds
Parameter a test class
Just add UnitTestAnnotation to your class and herits of TestCase_Firstruner instead of TestCase, like this :
/**
* @UnitTestAnnotation(
* name="Annotation",
* description="Test des annotations",
* item="Annotation",
* element="Class",
* memoryLimit=8000000,
* executionTimeLimit=1)
*/
class AnnotationTest extends TestCase_Firstruner
{
...[Your tests codes]...
}
Parameter a test
Just add UnitTestAnnotation to your test function, like this :
/**
* @UnitTestAnnotation(
* name="This is a test",
* description="Annotation about method",
* item="Annotation",
* element="Function",
* executionTimeLimit=2)
*/
class AnnotationTest extends TestCase_Firstruner
{
...[Your tests codes]...
}
How run test
Like PHPUnit but with some change :
php "phpunit_firstruner/phpunit_firstruner" [..Your common parameters, files, directories..]
Result
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2023-12-24