lundi 28 mars 2016

Is there a Laravel-way of testing how many times an event has fired?

I am using the base PHPUnit config file with the default TestCase.php file.

I am seeking a way to check if an event is fired multiple times during a test. Current code looks like:

function test_fires_multiple_events()
{
    $this->expectsEvents(SomeEvent::class);
}

Ideally, I would want:

function test_fires_multiple_events()
{
    $this->expectsEvents(SomeEvent::class)->times(3);
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire