This package is used to packaging collection of utility for unit testing in PHP
You can install the package via composer:
composer require codexpertmy/tests
<?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();
}
}
composer test
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email tajulasri@codexpert.my instead of using the issue tracker.