Skip to content

codexpertmy/tests

Repository files navigation

Common PHP unit utility for testing

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.

About

Set of utility for handle PHP unit

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages