Skip to content

Commit

Permalink
make some tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
recursivetree committed Aug 21, 2024
1 parent 3f2c58f commit 0896b6b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Http/Composers/CharacterFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ public function compose(View $view)
// work with raw arrays since the filter code requires an array of objects, and laravel collections don't like to give us that
$newrules = [];
foreach ($rules as $rule) {
// convert route names to urls, but keep arrays with hardcoded options
if(is_string($rule['src'])){
$rule['src'] = route($rule['src']);
}

$newrules[] = (object) $rule;

}

$view->with('characterFilterRules', $newrules);
Expand Down
6 changes: 6 additions & 0 deletions tests/Acl/AlliancePolicyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public function testAlliancePermissionsAsWildcard()
*/
public function testAlliancePermissionsAsDelegatedCharacter()
{
// make sure this doesn't generate observer events that trigger the squads logic
CharacterAffiliation::unsetEventDispatcher();

$permissions = array_keys(require __DIR__ . '/../../src/Config/Permissions/alliance.php');

$user = User::factory()->create();
Expand Down Expand Up @@ -199,6 +202,9 @@ public function testAlliancePermissionsAsDelegatedCharacter()
*/
public function testAlliancePermissionsAsDelegatedCorporation()
{
// make sure this doesn't generate observer events that trigger the squads logic
CharacterAffiliation::unsetEventDispatcher();

$permissions = array_keys(require __DIR__ . '/../../src/Config/Permissions/alliance.php');

$user = User::factory()->create();
Expand Down
6 changes: 6 additions & 0 deletions tests/Acl/CharacterPolicyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ public function testCharacterPermissionsAsDelegatedCharacter()
*/
public function testCharacterPermissionsAsDelegatedCorporation()
{
// make sure this doesn't generate observer events that trigger the squads logic
CharacterAffiliation::unsetEventDispatcher();

$permissions = array_keys(require __DIR__ . '/../../src/Config/Permissions/character.php');

$user = User::factory()->create();
Expand Down Expand Up @@ -313,6 +316,9 @@ public function testCharacterPermissionsAsDelegatedCorporation()
*/
public function testCharacterPermissionsAsDelegatedAlliance()
{
// make sure this doesn't generate observer events that trigger the squads logic
CharacterAffiliation::unsetEventDispatcher();

$permissions = array_keys(require __DIR__ . '/../../src/Config/Permissions/character.php');

$user = User::factory()->create();
Expand Down
3 changes: 3 additions & 0 deletions tests/Acl/CorporationPolicyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ public function testCorporationPermissionsAsWildcard()
*/
public function testCorporationPermissionsAsDelegatedCharacter()
{
// make sure this doesn't generate observer events that trigger the squads logic
CharacterAffiliation::unsetEventDispatcher();

$permissions = array_keys(require __DIR__ . '/../../src/Config/Permissions/corporation.php');

$user = User::factory()->create();
Expand Down

0 comments on commit 0896b6b

Please sign in to comment.