Skip to content

Commit

Permalink
Use Laravel db handling if trait is imported
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Apr 13, 2015
1 parent d33827b commit d1415d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Extensions/Selenium.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ public function snap($destination = null)
*/
protected function seeRowsWereReturned($table, $data)
{
// If the user has imported the Laravel application trait, we can use Laravel to
// work with the database.

if (in_array('Laracasts\Integrated\Services\Laravel\Application', class_uses($this))) {
return $this->app['db']->table($table)->where($data)->count();
}

// Otherwise, we'll default to the database adapter that Integrated provides.

return $this->getDbAdapter()->table($table)->whereExists($data);
}

Expand Down

0 comments on commit d1415d3

Please sign in to comment.