Download the PHP package score-labs/laravel-event-fake without Composer

On this page you can find all versions of the php package score-labs/laravel-event-fake. 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-event-fake

Laravel Event Fake

Enhanced Laravel Event Fake for testing

Have you ever wanted more versatility when you're testing your Laravel events? If you're like me, you're uncomfortable with the idea of just testing the listeners in isolation, but leaving all of the events unfaked makes your tests a mess. Well fret no further kindred spirit! Score Labs' Laravel Event Fake is here!

So how's it work?

Score Labs' Laravel Event Fake adds two new methods to the already great Event facade.

Installation

In your test classes, just import the new Event facade

Methods

Fake Except

There are two ways to call Event::fakeExcept:

Will fake every event except for EventThatIWantToFire. That event and all of its listeners will fire normally.

Will fake every event except for EventThatIWantToFire and will spy every listener except for `TheOnlyListenerIWantToFire. This usage is great for when you want to isolate a single listener, but you still want to test that the event setup is working as expected.

Once you've passed listeners to spy, you can still assert that they were fired without their code running by using

:point_up: You can also pass arrays of class names for either argument to allow through multiple events/listeners at once!

Fake Except Models

If you want to fake all events, but you still want events that you manually added in your models boot method to fire, just use

This way you can fake all events as usual, but still let your models get any necessary information they may need during a creating or saving event.

But what about all of the great existing features of Event::fake?

They are all still there! This is just a drop in enhancement and will be compatible with all usages of Event::fake in Laravel 5.5+


This code is MIT Licensed and open to all contributors. For pull requests, please try to mimic the existing code style.


All versions of laravel-event-fake with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
illuminate/support Version ^5.6
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 score-labs/laravel-event-fake contains the following files

Loading the files please wait ....