Download the PHP package ahrmerd/laravel-test-generator without Composer

On this page you can find all versions of the php package ahrmerd/laravel-test-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-test-generator

Ahrmerd/TestGenerator

Ahrmerd/TestGenerator is a command-line tool for generating test files for Laravel models. It helps you quickly generate feature tests for your Eloquent models to facilitate automated testing in your Laravel application.

Features

Installation

You can install Ahrmerd/TestGenerator via Composer using the following command:

the tests generated by the package requires the Pest's Laravel plugin to work. To start using Pest's Laravel plugin, you need to require this plugin via Composer.

Once installed, run the following Artisan command to publish the configuration file:

Compatibility

This package is compatible with Laravel 10 and above.

Configuration

You can configure the behavior of the TestGenerator package using the laravel-TestGenerator.php config file. Here are the available options:

- ignore_models

An array of models that should be ignored when generating tests when --all option is passed. Models listed in this array will not have tests generated for them. by default, it ignores creating test test for the user model. For example:

default

The default type of tests to generate. You can specify either 'api', 'web', 'both', or null (default). If set to 'api', only API tests will be generated by default. If set to 'web', only web tests will be generated by default. If set to 'both', both API and web tests will be generated by default.

Usage

Once installed, you can use Ahrmerd/TestGenerator via the command-line interface (CLI). Here are some examples:

- Generate tests for a specific model:

This command will generate test files for the ModelName model in your Laravel application. The test files will contain test methods for common CRUD operations such as create, read, update, and delete, based on the --api or --web options provided (default is --api). You can also add custom test methods in the generated test files.

- Generate tests for all models:

This command will generate test files for all models in your Laravel application. Each test file will contain test methods for common CRUD operations, based on the --api or --web options provided (default is --api), as well as a template for writing custom test methods for additional testing scenarios.

- Overwrite existing test files:

By default, Ahrmerd/TestGenerator will not overwrite existing test files. However, you can use the --force flag to overwrite existing test files if needed. Please use this option with caution, as it will overwrite any existing test files for the specified model.

- Specify type of tests to generate:

This command will generate test files for the ModelName model with test methods specifically for testing API routes and functionality. You can also use the --web option to generate test methods for testing web routes and functionality (default will generate for both api and web).

Note:

-You can use any combination of options (--api, --web, --force) to customize the generated test files as per your requirements. -You can customize the generated test methods or add your own custom test methods in the generated test files to suit your specific testing needs. -Pest PHP is required for the generated tests to work. Make sure you have Pest PHP installed and configured in your Laravel project before running the generate:tests command

Contributing

Contributions to Ahrmerd/TestGenerator are welcome! If you would like to contribute, please follow the standard GitHub Fork & Pull Request workflow.


All versions of laravel-test-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ahrmerd/laravel-test-generator contains the following files

Loading the files please wait ....