vancodx/php-testing
最新稳定版本:1.7.0
Composer 安装命令:
composer require --dev vancodx/php-testing
包简介
VanCodX PHP Testing
README 文档
README
Installation
Install this package with the following command:
composer require --dev vancodx/php-testing
Create ".phpstan.neon.dist" file in the root directory of your project with the following contents:
includes: - vendor/vancodx/php-testing/phpstan-extension/extension.php parameters: level: 10 paths: - src - tests
Create "phpunit.xml.dist" file in the root directory of your project with the following contents:
<?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"> <testsuites> <testsuite name="unit"> <directory>tests/Unit</directory> </testsuite> </testsuites> <source> <include> <directory suffix=".php">src</directory> </include> </source> <coverage> <report> <text outputFile="php://stdout" showOnlySummary="true"/> </report> </coverage> </phpunit>
Add the following lines into "composer.json" file of your project:
{
"scripts": {
"test": [
"phpstan analyze",
"phpunit"
]
}
}
Add the following lines into your ".gitignore" file:
.phpstan.neon
.phpunit.result.cache
phpunit.xml
Usage
Use the following command:
composer test
Running tests
Use the following command for running the tests inside a Docker container:
docker compose up --build tests
统计信息
- 总下载量: 39
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-08