Skip to content

Commit

Permalink
Add tests for tap usages on DatabaseEngine (#622)
Browse files Browse the repository at this point in the history
* Add tests for `tap` usages on `DatabaseEngine`

* wip

* Update DatabaseEngineTest.php
  • Loading branch information
crynobone authored May 5, 2022
1 parent 7b97c85 commit 162aea8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Feature/DatabaseEngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,15 @@ public function test_limit_is_applied()
$models = SearchableUserDatabaseModel::search('laravel')->take(1)->get();
$this->assertCount(1, $models);
}

public function test_tap_is_applied()
{
$models = SearchableUserDatabaseModel::search('laravel')->get();
$this->assertCount(2, $models);

$models = SearchableUserDatabaseModel::search('laravel')->tap(function ($query) {
return $query->take(1);
})->get();
$this->assertCount(1, $models);
}
}

0 comments on commit 162aea8

Please sign in to comment.