Skip to content

Commit

Permalink
Test suite updates
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte committed Dec 3, 2023
1 parent 978cf24 commit 8ab6bb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
</testsuites>
<php>
<env name="CACHE_DRIVER" value="array"/>
<env name="APP_KEY" value="base64:W99w+5JYz8SVGf5sx17gmPR6uoNCtWiEVc+9qu8iGEg="/> <!-- Required for Passport client -->
<ini name="memory_limit" value="512M" />
<!-- APP_KEY required for Passport client -->
<env name="APP_KEY" value="base64:W99w+5JYz8SVGf5sx17gmPR6uoNCtWiEVc+9qu8iGEg="/>
<ini name="memory_limit" value="512M"/>
</php>
</phpunit>
8 changes: 4 additions & 4 deletions tests/RoleWithNestingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class RoleWithNestingTest extends TestCase
protected $useCustomModels = true;

/** @var Role[] */
protected $parent_roles = [];
protected array $parent_roles = [];

/** @var Role[] */
protected $child_roles = [];
protected array $child_roles = [];

protected function setUp(): void
{
Expand Down Expand Up @@ -67,7 +67,7 @@ public function it_returns_correct_withCount_of_nested_roles($role_group, $index
$role = $this->$role_group[$index];
$count_field_name = sprintf('%s_count', $relation);

$actualCount = intval(Role::withCount($relation)->find($role->getKey())->$count_field_name);
$actualCount = (int)Role::withCount($relation)->find($role->getKey())->$count_field_name;

$this->assertSame(
$expectedCount,
Expand All @@ -76,7 +76,7 @@ public function it_returns_correct_withCount_of_nested_roles($role_group, $index
);
}

public function roles_list()
public static function roles_list()
{
return [
['parent_roles', 'has_no_children', 'children', 0],
Expand Down

0 comments on commit 8ab6bb1

Please sign in to comment.