ogbitblt/unit-testing
最新稳定版本:v1.0.0
Composer 安装命令:
composer require ogbitblt/unit-testing
包简介
Lightweight minimal unit testing framework for PHP based projects.
README 文档
README
lightweight PHP unit testing framework
Installation
Use composer
composer require ogbitblt/unit-testing
Usage
// initialize a new test suite UnitTest::InitTestSuite("MyTestSuite"); // check if bool, float, int, or string values are equal // if they are the test passes, and fails otherwise UnitTest::BoolEqual(true,true,"does true equal true"); UnitTest::BoolEqual(true,false,"does true equal false"); UnitTest::FloatEqual(0,0,"does 0 float equal 0 float"); UnitTest::FloatEqual(0,1,"does 0 float equal 1 float"); UnitTest::FloatEqual(1.234567890,1.234567890,"how deep does your precision test"); UnitTest::FloatEqual(2.345678901,2.345678900,"how deep does your precision grow"); UnitTest::IntEqual(0,0,"does 0 int equal 0 int"); UnitTest::IntEqual(0,1,"does 0 int equal 1 int"); UnitTest::StringEqual("hello","hello","does hello equal hello"); UnitTest::StringEqual("hello","bye","does hello equal bye"); // show a test results summary UnitTest::ShowResults();
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-27