All Projects β†’ stephenjude β†’ api-test-helper

stephenjude / api-test-helper

Licence: MIT License
A collection of helper methods for testing and debugging API endpoints.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to api-test-helper

sagittarius
🎯 A set of javascript most used utilsπŸ“‘
Stars: ✭ 42 (-16%)
Mutual labels:  helpers
sitemap
A simple sitemap generator for Laravel Framework.
Stars: ✭ 32 (-36%)
Mutual labels:  laravel-framework
ComoFazerUmaPerguntaPT
πŸ€” Farto de fazer perguntas e nΓ£o ser respondido? Aprenda agora a melhor forma de fazer uma pergunta πŸ”₯
Stars: ✭ 28 (-44%)
Mutual labels:  helpers
API-Testing-Automation-Framework
It is Data-Driven and Keyword-Driven framework to test REST/SOAP webservices automatically
Stars: ✭ 24 (-52%)
Mutual labels:  api-testing
csv
No description or website provided.
Stars: ✭ 47 (-6%)
Mutual labels:  laravel-framework
http-rider
Simple and Powerful desktop client for working with JSON APIs
Stars: ✭ 27 (-46%)
Mutual labels:  api-testing
LaraSible
A complete ansible playbook for create a hosting envorinment with Nginx, PHP-FPM, Redis and MariaDB for Laravel Framework on Linux
Stars: ✭ 15 (-70%)
Mutual labels:  laravel-framework
urley
πŸ“¦ An easy cross-platform utility library to work with URLs in Javascript.
Stars: ✭ 14 (-72%)
Mutual labels:  helpers
laravel-first-steps
Sample Laravel project which will help you create the first pipeline
Stars: ✭ 27 (-46%)
Mutual labels:  laravel-framework
apitest
Apitest is declarative api testing tool with JSON-like DSL.
Stars: ✭ 88 (+76%)
Mutual labels:  api-testing
eloquent-traits
Traits for laravel eloquent models
Stars: ✭ 18 (-64%)
Mutual labels:  helpers
Larahelp
Supercharge your Laravel projects with more than 25 useful global helpers.
Stars: ✭ 48 (-4%)
Mutual labels:  helpers
ploi-php-sdk
Ploi's PHP SDK API wrapper
Stars: ✭ 45 (-10%)
Mutual labels:  laravel-framework
Base62
PHP Base62 encoder and decoder for integers and big integers with Laravel 5 support.
Stars: ✭ 16 (-68%)
Mutual labels:  laravel-framework
mapos
Sistema de Controle de Ordens de Serviço
Stars: ✭ 24 (-52%)
Mutual labels:  laravel-framework
artillery-plugin-expect
βœ… Add checks and assertions to your HTTP tests for functional testing with Artillery
Stars: ✭ 27 (-46%)
Mutual labels:  api-testing
pretty-routes
Display your Laravel routes in the console, but make it pretty. 😎
Stars: ✭ 627 (+1154%)
Mutual labels:  laravel-framework
super-powered-api-testing
Comparisons of powerful API testing tools
Stars: ✭ 25 (-50%)
Mutual labels:  api-testing
advance-blog-in-laravel-5.5-in-tdd
build blog with cool feature like Activity feed, Filter post, post subscription, mentioned user, notification, search with Algolia
Stars: ✭ 11 (-78%)
Mutual labels:  laravel-framework
header libraries
Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc
Stars: ✭ 14 (-72%)
Mutual labels:  helpers

Laravel API Test Helpers

Latest Version on Packagist Build Status Total Downloads

This is a collection of helper methods for testing and debugging API endpoints.

Installation

You can install the package via composer:

composer require stephenjude/api-test-helper --dev

Usage

namespace Tests\Apis;

use App\Models\User;
use Tests\TestCase;
use Stephenjude\ApiTestHelper\WithApiHelper;

class UserApiTest extends TestCase
{
    use WithApiHelper;

    /*
    * @test
    */
    public function testGetAllUsers()
    {
        $actualUsers = User::all();

        $this->response = $this->getJson('/users');

        // Assert response is 200
        $this->response->assertOk();

        // Dump api data to the console
        $this->dumpApiData();

        // Write api data to the log file
        $this->logApiData();

        // Return a decoded api response data
        $responseData = $this->decodeApiResponse();

        // Assert API data is a collection 
        $this->assertApiResponseCollection($actualUsers);
    }
}

Available Helper Methods

Method Description
decodeApiResponse() Returns a decoded api response data.
dumpApiData() Dump api response data to the console.
logApiData() Write api response data to the log file.
assertApiSuccess() Assert api response data is successful: [success => true].
assertApiResponse($actualData) Assert api response data is same actual data item.
assertApiResponseCollection($actualData) Assert api response data is same actual collection items.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].