Download the PHP package lukeraymonddowning/pest-plugin-larastrap without Composer

On this page you can find all versions of the php package lukeraymonddowning/pest-plugin-larastrap. 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 pest-plugin-larastrap

Pest Larastrap Plugin

This is currently a highly experimental project and is subject to large pre-release changes.

Pest PHP is an awesome PHP testing framework. It already has amazing support for Laravel via the Laravel plugin! Occasionally however, you'll come across some quirks when working with Pest and Laravel due to the fact that Laravel hasn't been booted during the Pest compile stage. Take a look at the following example, using Higher Order Tests:

If you try to run this out of the box, it will fail; we're trying to make use of Laravel's route and config helpers, but they require the Laravel application to be booted.

Enter Larastrap. After installing this plugin, the above test will run without issue, and you can carry on testing without any headaches!

Installation

You can install Larastrap via composer:

It will be automatically registered, so you can start using it right away!

Prerequisites

The only prerequisite for using Larastrap is having a CreatesApplication trait in your application's tests folder. You almost certainly already have this, as it ships out of the box with Laravel. This trait should have a createApplication method inside it. If you don't know what we're talking about, it likely means everything is good to go and you can skip this section.

Common use cases

We've already highlighted that Larastrap is super useful in higher order tests.

Somewhere else it comes in handy is datasets. Traditionally, you wouldn't be able to make use of Laravel in your datasets. With Larastrap, however, you have the full power of Laravel at your fingertips. For example, perhaps you want to check that all service providers are present in your app.php config file:

Now, we have access to a dynamically updated array of provider strings that we can make use of in any test.

Perhaps we want a dataset of the middleware registered on a certain route:

You can see how powerful this concept is; it opens up the possibility of completely dynamic datasets that grow with your application automatically.

Caveats

There are a few caveats and limitations you should be aware of when using Larastrap:

You shouldn't use the database outside of the test

Because Larastrap is basically booting its own laravel instance prior to any of your tests running, the database will be reset before your test is run. As such, you should still perform database queries inside each test.


All versions of pest-plugin-larastrap with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1 || ^8.2
pestphp/pest-plugin Version ^2.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 lukeraymonddowning/pest-plugin-larastrap contains the following files

Loading the files please wait ....