Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
recursivetree committed Nov 3, 2023
1 parent 8da7326 commit 1ea6b4d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.env.php
.env
.idea/
vendor/
2 changes: 1 addition & 1 deletion src/Models/Filterable.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private function applyGroup(Builder $query, stdClass $group): void
$this->applyRule($query_group, $rule);
} else {
// this is a nested group
$query->where(function ($group_query) use ($rule) {
$query_group->where(function ($group_query) use ($rule) {
$this->applyGroup($group_query, $rule);
});
}
Expand Down
14 changes: 8 additions & 6 deletions tests/Squads/NoRulesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Orchestra\Testbench\TestCase;
use Seat\Eveapi\Models\Character\CharacterInfo;
use Seat\Eveapi\Models\RefreshToken;
use Seat\Web\Exceptions\InvalidFilterException;
use Seat\Web\Models\Squads\Squad;
use Seat\Web\Models\User;
use Seat\Web\WebServiceProvider;
Expand Down Expand Up @@ -72,10 +73,10 @@ protected function setUp(): void

Event::fake();

CharacterInfo::factory(50)
CharacterInfo::factory(5)
->create();

User::factory(10)
User::factory(1)
->create()
->each(function ($user) {
CharacterInfo::whereDoesntHave('refresh_token')->get()
Expand All @@ -99,11 +100,12 @@ public function testUserWithNoRules()
]);

// pickup users
$users = User::all();
$user = User::first();

$this->expectException(InvalidFilterException::class);

// ensure no users are eligible
foreach ($users as $user) {
$this->assertTrue($squad->isEligible($user));
}
$squad->isEligible($user);

}
}

0 comments on commit 1ea6b4d

Please sign in to comment.