Laravel4 Connector: false assumption of 'db' existence #3028

Namek opened this Issue Apr 26, 2016 · 1 comment


None yet
2 participants

Namek commented Apr 26, 2016

Method _after(TestCase $test) in codeception\src\Codeception\Module\Laravel4.php contains following lines:

if ($this->app['db'] && $this->cleanupDatabase()) {

My project does not use Database Service (Elastic Search in place) so I have disabled DatabaseServiceProvider in Laravel config. That's why it fails on if($this->app['db']) part. From debugging step by step I know that instead of calling offsetExists it immediately invokes offsetGet in Illuminate\Container\Container:

public function offsetGet($key)
    return $this->make($key);

What I get is ReflectionException - "Class db does not exist" from Container::build()

Same thing happens inside function _before(TestCase $test).

I'm not sure what triggers this error: this module, Laravel, PHP engine or quantum physics.

Namek added a commit to Namek/Codeception that referenced this issue Apr 26, 2016

janhenkgerritsen added a commit that referenced this issue Apr 29, 2016

Merge pull request #3048 from janhenkgerritsen/master
Fix for #3028 for Laravel 5 module in master branch.

janhenkgerritsen added a commit that referenced this issue Apr 29, 2016


This comment has been minimized.

Show comment
Hide comment

janhenkgerritsen Apr 29, 2016


Issue is fixed by #3049 and #3048.


janhenkgerritsen commented Apr 29, 2016

Issue is fixed by #3049 and #3048.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment