Collection of utility PHP unit testing

1.0 2022-01-19 17:09 UTC

This package is not auto-updated.

Last update: 2024-11-22 04:50:58 UTC


README

tests

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.