codexpertmy / tests
Collection of utility PHP unit testing
1.0
2022-01-19 17:09 UTC
Requires
- php: ^7.2 || ^8.0
- laravie/codex: ^5.1
- php-http/multipart-stream-builder: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.4
- laravie/codex-common: ^1.5
- laravie/parser: ^2.0
- mockery/mockery: ^1.3
- php-http/guzzle7-adapter: ^0.1.1
- phpstan/phpstan: ^1.3
- phpunit/phpunit: ^7.5 || ^8.4 || ^9.0
This package is not auto-updated.
Last update: 2024-11-22 04:50:58 UTC
README
This package is used to packaging collection of utility for unit testing in PHP
Installation
You can install the package via composer:
composer require codexpertmy/tests
Usage basic
<?php use Codexpert\Faker\HttpFaker; use PHPUnit\Framework\TestCase as PHPUnit; class DemoTest extends PHPUnit { public function test_should_create_task() { $expected = HttpFaker::create()->shouldResponseJson(200,[],'{"status":200,"data":{}}'); //this will return guzzle client interface $expected->faker(); $response = $expected->faker()->post('/tasks'); echo $response->getBody(); echo $response->getStatusCode(); } }
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email tajulasri@codexpert.my instead of using the issue tracker.