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

Closed
Namek opened this Issue Apr 26, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@Namek

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()) {
    $this->app['db']->rollback();
}

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

@janhenkgerritsen

This comment has been minimized.

Show comment
Hide comment
@janhenkgerritsen

janhenkgerritsen Apr 29, 2016

Contributor

Issue is fixed by #3049 and #3048.

Contributor

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