Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

Namek opened this issue Apr 26, 2016 · 1 comment

Comments

@Namek
Copy link

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
Fix for #3028 for Laravel 5 module in master branch.
@janhenkgerritsen
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants