Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Namek committed Apr 26, 2016
1 parent 80a1513 commit 9e74be8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/Laravel4.php
Expand Up @@ -71,7 +71,7 @@ private function initialize()
// Store a reference to the database object
// so the database connection can be reused during tests
$oldDb = null;
if ($this->app['db'] && $this->app['db']->connection()) {
if (isset($this->app['db']) && $this->app['db']->connection()) {
$oldDb = $this->app['db'];
}

Expand Down
6 changes: 3 additions & 3 deletions src/Codeception/Module/Laravel4.php
Expand Up @@ -128,7 +128,7 @@ public function _before(TestCase $test)
{
$this->client = new LaravelConnector($this);

if ($this->app['db'] && $this->cleanupDatabase()) {
if (isset($this->app['db']) && $this->cleanupDatabase()) {
$this->app['db']->beginTransaction();
}

Expand All @@ -144,7 +144,7 @@ public function _before(TestCase $test)
*/
public function _after(TestCase $test)
{
if ($this->app['db'] && $this->cleanupDatabase()) {
if (isset($this->app['db']) && $this->cleanupDatabase()) {
$this->app['db']->rollback();
}

Expand All @@ -161,7 +161,7 @@ public function _after(TestCase $test)
}

// disconnect from DB to prevent "Too many connections" issue
if ($this->app['db']) {
if (isset($this->app['db'])) {
$this->app['db']->disconnect();
}
}
Expand Down

0 comments on commit 9e74be8

Please sign in to comment.