spawnia/phpunit-assert-directory
最新稳定版本:v2.2.0
Composer 安装命令:
composer require spawnia/phpunit-assert-directory
包简介
PHPUnit extension with assert methods for directories
README 文档
README
PHPUnit extension with assert methods for directories
Installation
Install through composer.
composer require --dev spawnia/phpunit-assert-directory
Usage
Use the trait AssertDirectory in your test method.
namespace Foo\Tests; use PHPUnit\Framework\TestCase; +use Spawnia\PHPUnitAssertFiles\AssertDirectory; final class FooTest extends TestCase { + use AssertDirectory; }
You can then proceed the use the additional assertions just like you would
use PHPUnit's built-in methods, such as assertSame.
assertDirectoryEquals
/** * Assert that two directories contain the same files with the same contents. * * @param string $expected Path to the expected directory * @param string $actual Path to the actual directory * @param string $message Optional error message in case of failure * * @throws ExpectationFailedException */ public static function assertDirectoryEquals(string $expected, string $actual, string $message = ''): void
assertDirectoryContains
/** * Assert a directory contains at least the same files as another directory. * * @param string $expected Path to the expected directory * @param string $actual Path to the actual directory * @param string $message Optional error message in case of failure * @return void * * @throws ExpectationFailedException */ public static function assertDirectoryContains(string $expected, string $actual, string $message = ''): void
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
License
This package is licensed using the MIT License.
统计信息
- 总下载量: 16.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-11