vendredi 19 février 2016

Test containing $this->expectsEvents() always passes

The following test always passes in my Laravel 5.2 app upgraded from 5.1:

<?php

use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class EventTest extends TestCase
{
    public function tearDown()
    {
        Mockery::close();
    }

    public function testExample()
    {
        $this->expectsEvents(App\Events\Foo::class);
    }
}

This is despite the App\Events\Foo class not even existing. I've tested the same test in a fresh 5.2 install and it fails as expected. I've looked over the upgrade guide and all relevant non-core code to see whether there's something I've missed that's changed between 5.1 and 5.2 but I can't figure it out. Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire