lain/laravel-test-generator

Laravel package for generating api test automatically

v1.0.3 2022-10-18 09:58 UTC

This package is auto-updated.

Last update: 2024-09-18 14:23:11 UTC


README

Laravel package for generating api test automatically.

tests PHP Version Require Latest Stable Version

Installation

$ composer require lain/laravel-test-generator

Configuration

Copy the package config to your local config with the publish command:

$ php artisan vendor:publish --tag=test-generator

This will add a new config to config/test-generator.php:

return [
    'get_token' => 'app(Helper::class)->getAccessTokenForEmailToOrg()',
];

Usage

Create test-swagger.json in your project root directory, It contains the api tests that need to be created, Please make sure it conforms to OpenAPI format (swaager 3.0).

To do so, simply run php artisan test:generate TEST_FILE_NAME in your project root. This will write all the test cases into the file based on test-swagger json.