narrowspark / testing-helper
此包已被弃用且不再维护。没有建议的替代包。
提供测试助手。
8.0.2
2019-10-15 08:34 UTC
Requires
- php: ^7.2
- phpunit/phpunit: ^8.0
- psr/container: ^1.0.0
- psr/http-factory: ^1.0.0
- psr/http-message: ^1.0.0
- psr/http-server-middleware: ^1.0.0
Requires (Dev)
- ext-json: *
- fzaninotto/faker: ^1.8.0
- guzzlehttp/psr7: ^1.6.1
- mockery/mockery: ^1.2.3
- narrowspark/coding-standard: ^3.1.0
- slam/phpstan-extensions: ^3.6
Suggests
- fzaninotto/faker: Required to use the FakerTrait (^1.6)
- mockery/mockery: Required to use the MockeryTestCase (^0.9)
- nyholm/nsa: Required to test your private/protected methods/properties (^1.1).
- dev-master
- 8.0.2
- 8.0.1
- 8.0.0
- v7.0.0
- v6.0.0
- v5.0.0
- v4.0.1
- v4.0.0
- v3.0.0
- v2.1.0
- v2.0.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- dev-renovate/configure
- dev-dependabot/add-v2-config-file
- dev-dependabot/composer/psr/container-tw-1.0.0or-tw-2.0.0
- dev-dependabot/composer/slam/phpstan-extensions-tw-3.6or-tw-4.0
This package is auto-updated.
Last update: 2023-03-26 11:08:03 UTC
README
安装
通过 Composer
$ composer require narrowspark/testing-helper
用法
use Narrowspark\TestingHelper\Traits\AssertArrayTrait; class ModelTest extends \PHPUnit_Framework_TestCase { use AssertArrayTrait; // Now you can do something like this. public function testIfArrayContainIrix() { $haystack = ['Mac', 'NT', 'Irix', 'Linux']; self::assertInArray('Irix', $haystack); } // or public function testAssertArraySubsetThrowsExceptionForInvalidSubset(): void { $this->expectException(ExpectationFailedException::class); $this->assertArraySubset([6, 7], [1, 2, 3, 4, 5, 6]); } }
测试
你需要运行
$ phpunit
贡献
注意:请注意,本项目以贡献者行为准则发布。通过参与本项目,你同意遵守其条款。
致谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件。