matusstafura/pest-plugin-fileloader
Composer 安装命令:
composer require --dev matusstafura/pest-plugin-fileloader
包简介
A PHP Pest plugin to load file
README 文档
README
This Pest plugin simplifies loading file for testing.
If you want to test a response, save it as json, load a file and test:
use function MatusStafura\PestPluginFileLoader\fileLoader; test('response', function () { $json = fileLoader()->json('tests/response_dump.json'); expect($json)->toBeArray() ->and($json['id'])->toBe(1) ->and($json['title'])->toBe('Shirt Black'); });
Available methods:
json(string $filepath): array // $json = fileLoader()->json('response.json'); plaintext(string $filepath): string // fileLoader()->plaintext('response.txt'); xmlToArray(string $filepath): array // fileLoader()->json('response.xml');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 67
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-20