Lumen-framework: PHPUnit fails when running all tests

Created on 6 Jul 2016  路  2Comments  路  Source: laravel/lumen-framework

Dear All,

I'm having a problem with PHPUnit and the use of 'App\Tests\TestCase'.

It seems, when running all tests, PHPUnit shows failures but when running the failed tests individually it passes.

I can get all the tests to pass just by using the standard 'PHPUnit_Framework_TestCase', however, one of the tests I want to check for events.

Errors are like:

ReflectionException: Class files does not exist
Illuminate\Contracts\Container\BindingResolutionException: Target [Psr\Log\LoggerInterface] is not instantiable.

etc...

I am on Lumen 5.1.* using composer.

Most helpful comment

@GrahamCampbell A comment on why this issue was closed could help future readers.

All 2 comments

Hi,
same for me. Calling single test is OK. But when I run all suite, first test passes and all other fails.

Using Lumen 5.2.*

1) NagiosCheckTest::it_should_be_ok
ReflectionException: Class request does not exist

/home/literat/Work/os/os-customers/vendor/illuminate/container/Container.php:734
/home/literat/Work/os/os-customers/vendor/illuminate/container/Container.php:629
/home/literat/Work/os/os-customers/vendor/laravel/lumen-framework/src/Application.php:205
/home/literat/Work/os/os-customers/vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php:106
/home/literat/Work/os/os-customers/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:391
/home/literat/Work/os/os-customers/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:323
/home/literat/Work/os/os-customers/vendor/laravel/lumen-framework/src/Testing/Concerns/MakesHttpRequests.php:334
/home/literat/Work/os/os-customers/vendor/laravel/lumen-framework/src/Testing/Concerns/MakesHttpRequests.php:62
/home/literat/Work/os/os-customers/tests/acceptance/NagiosCheckTest.php:10
class NagiosCheckTest extends TestCase
{
    /** @test */
    public function it_should_be_ok()
    {
        $this->get('/nagios-check');

        $this->assertEquals(200, $this->response->status());
        $this->assertEquals($this->response->getContent(), 'OK');
    }
}

@GrahamCampbell A comment on why this issue was closed could help future readers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gfazioli picture gfazioli  路  5Comments

concept47 picture concept47  路  3Comments

jampack picture jampack  路  3Comments

GGNB picture GGNB  路  5Comments

patrikengborg picture patrikengborg  路  3Comments