Skip to content

Commit

Permalink
Merge branch 'master' into feature/te-7001/master-symfony-5-support
Browse files Browse the repository at this point in the history
  • Loading branch information
stereomon committed Sep 30, 2020
2 parents 7e78e74 + d3193c9 commit 874e6ae
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions tests/SprykerTest/Zed/Acl/Business/AclTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testAddGroup(): void

$this->assertInstanceOf('\Generated\Shared\Transfer\GroupTransfer', $transfer);
$this->assertNotNull($transfer->getIdAclGroup());
$this->assertEquals($data['name'], $transfer->getName());
$this->assertSame($data['name'], $transfer->getName());
}

/**
Expand All @@ -169,7 +169,7 @@ public function testFindGroupReturnsTransferWithCorrectData(): void
$foundGroupTransfer = $this->facade->findGroup($groupCriteriaTransfer);

//Assert
$this->assertEquals($groupTransfer->getReference(), $foundGroupTransfer->getReference());
$this->assertSame($groupTransfer->getReference(), $foundGroupTransfer->getReference());
}

/**
Expand Down Expand Up @@ -204,7 +204,7 @@ public function testUpdateGroup(): void
$this->assertInstanceOf('\Generated\Shared\Transfer\GroupTransfer', $dto2);
$this->assertNotNull($groupDto->getIdAclGroup());
$this->assertNotEquals($groupData2['name'], $groupDto->getName());
$this->assertEquals($groupData2['name'], $dto2->getName());
$this->assertSame($groupData2['name'], $dto2->getName());
}

/**
Expand All @@ -223,8 +223,8 @@ public function testGetGroupById(): void

$this->assertInstanceOf('\Generated\Shared\Transfer\GroupTransfer', $groupDto);
$this->assertNotNull($groupDto->getIdAclGroup());
$this->assertEquals($id, $groupDto->getIdAclGroup());
$this->assertEquals($groupData['name'], $groupDto->getName());
$this->assertSame($id, $groupDto->getIdAclGroup());
$this->assertSame($groupData['name'], $groupDto->getName());
}

/**
Expand Down Expand Up @@ -257,7 +257,7 @@ public function testAddRole(): void

$this->assertInstanceOf('\Generated\Shared\Transfer\RoleTransfer', $roleDto);
$this->assertNotNull($roleDto->getIdAclRole());
$this->assertEquals($roleData['name'], $roleDto->getName());
$this->assertSame($roleData['name'], $roleDto->getName());
}

/**
Expand Down Expand Up @@ -345,7 +345,7 @@ public function testAddRoleAndIsPresentInGroup(): void

$this->assertInstanceOf('\Generated\Shared\Transfer\RoleTransfer', $transferRole);
$this->assertNotNull($transferRole->getIdAclRole());
$this->assertEquals($roleData['name'], $transferRole->getName());
$this->assertSame($roleData['name'], $transferRole->getName());
}

/**
Expand All @@ -370,11 +370,11 @@ public function testAddRuleAndAddToRole(): void

$this->assertInstanceOf('\Generated\Shared\Transfer\RuleTransfer', $ruleDto);
$this->assertNotNull($ruleDto->getIdAclRule());
$this->assertEquals($current['bundle'], $ruleDto->getBundle());
$this->assertEquals($current['controller'], $ruleDto->getController());
$this->assertEquals($current['action'], $ruleDto->getAction());
$this->assertEquals($current['type'], $ruleDto->getType());
$this->assertEquals($roleDto->getIdAclRole(), $ruleDto->getFkAclRole());
$this->assertSame($current['bundle'], $ruleDto->getBundle());
$this->assertSame($current['controller'], $ruleDto->getController());
$this->assertSame($current['action'], $ruleDto->getAction());
$this->assertSame($current['type'], $ruleDto->getType());
$this->assertSame($roleDto->getIdAclRole(), $ruleDto->getFkAclRole());
}
}

Expand All @@ -396,11 +396,11 @@ public function testGetRulesFromRoles(): void
$index = 0;
foreach ($rulesCollectionDto->getRules() as $current) {
$currentData = $ruleData[$index];
$this->assertEquals($currentData['bundle'], $current->getBundle());
$this->assertEquals($currentData['controller'], $current->getController());
$this->assertEquals($currentData['action'], $current->getAction());
$this->assertEquals($currentData['type'], $current->getType());
$this->assertEquals($roleDto->getIdAclRole(), $current->getFkAclRole());
$this->assertSame($currentData['bundle'], $current->getBundle());
$this->assertSame($currentData['controller'], $current->getController());
$this->assertSame($currentData['action'], $current->getAction());
$this->assertSame($currentData['type'], $current->getType());
$this->assertSame($roleDto->getIdAclRole(), $current->getFkAclRole());
$index++;
}
}
Expand All @@ -425,11 +425,11 @@ public function testGetRulesFromGroup(): void
$index = 0;
foreach ($rulesCollectionDto->getRules() as $current) {
$currentData = $ruleData[$index];
$this->assertEquals($currentData['bundle'], $current->getBundle());
$this->assertEquals($currentData['controller'], $current->getController());
$this->assertEquals($currentData['action'], $current->getAction());
$this->assertEquals($currentData['type'], $current->getType());
$this->assertEquals($roleDto->getIdAclRole(), $current->getFkAclRole());
$this->assertSame($currentData['bundle'], $current->getBundle());
$this->assertSame($currentData['controller'], $current->getController());
$this->assertSame($currentData['action'], $current->getAction());
$this->assertSame($currentData['type'], $current->getType());
$this->assertSame($roleDto->getIdAclRole(), $current->getFkAclRole());
$index++;
}
}
Expand Down Expand Up @@ -473,7 +473,7 @@ public function testAddUserToGroup(): void
$userDto = $this->mockAddUser($userData);

$added = $this->facade->addUserToGroup($userDto->getIdUser(), $groupDto->getIdAclGroup());
$this->assertEquals($added, 1);
$this->assertSame(1, $added);
}

/**
Expand All @@ -494,15 +494,15 @@ public function testGetUserGroups(): void
$userDto = $this->mockAddUser($userData);

$added = $this->facade->addUserToGroup($userDto->getIdUser(), $groupDto->getIdAclGroup());
$this->assertEquals($added, 1);
$this->assertSame(1, $added);

$userGroupDto = $this->facade->getUserGroups($userDto->getIdUser());
$this->assertInstanceOf('\Generated\Shared\Transfer\GroupsTransfer', $userGroupDto);

$groups = $userGroupDto->toArray();
$group = $groups['groups'][0];
$this->assertNotNull($group['id_acl_group']);
$this->assertEquals($groupData['name'], $group['name']);
$this->assertSame($groupData['name'], $group['name']);
}

/**
Expand All @@ -525,7 +525,7 @@ public function testCheckPermissionSimple(): void
$userDto = $this->mockAddUser($userData);

$added = $this->facade->addUserToGroup($userDto->getIdUser(), $groupDto->getIdAclGroup());
$this->assertEquals($added, 1);
$this->assertSame(1, $added);

foreach ($ruleData as $current) {
$ruleTransfer = new RuleTransfer();
Expand All @@ -537,7 +537,7 @@ public function testCheckPermissionSimple(): void
$canAccess = $this->facade
->checkAccess($userDto, $current['bundle'], $current['controller'], $current['action']);

$this->assertEquals($shouldAllow, $canAccess);
$this->assertSame($shouldAllow, $canAccess);
}
}

Expand All @@ -559,7 +559,7 @@ public function testCheckPermissionSimpleHasNoAccess(): void
$userDto = $this->mockAddUser($userData);

$added = $this->facade->addUserToGroup($userDto->getIdUser(), $groupDto->getIdAclGroup());
$this->assertEquals($added, 1);
$this->assertSame(1, $added);

foreach ($ruleData as $current) {
$ruleTransfer = new RuleTransfer();
Expand All @@ -569,7 +569,7 @@ public function testCheckPermissionSimpleHasNoAccess(): void
$canAccess = $this->facade
->checkAccess($userDto, rand(100, 999), rand(100, 999), rand(100, 999));

$this->assertEquals(false, $canAccess);
$this->assertFalse($canAccess);
}
}

Expand All @@ -593,7 +593,7 @@ public function testCheckPermissionWildcards(): void
$userDto = $this->mockAddUser($userData);

$added = $this->facade->addUserToGroup($userDto->getIdUser(), $groupDto->getIdAclGroup());
$this->assertEquals($added, 1);
$this->assertSame(1, $added);

foreach ($ruleData as $current) {
$ruleTransfer = new RuleTransfer();
Expand All @@ -607,7 +607,7 @@ public function testCheckPermissionWildcards(): void
$canAccess = $this->facade
->checkAccess($userDto, $current['bundle'], $current['controller'], $current['action']);

$this->assertEquals($shouldAllow, $canAccess);
$this->assertSame($shouldAllow, $canAccess);
}
}

Expand Down Expand Up @@ -644,10 +644,10 @@ public function testPermissionsWithSystemUserShouldNotAllow(): void
$this->assertInstanceOf('\Generated\Shared\Transfer\UserTransfer', $user);

$hasAccess = $this->facade->checkAccess($user, rand(100, 999), rand(100, 999), rand(100, 999));
$this->assertEquals(false, $hasAccess);
$this->assertFalse($hasAccess);

$hasAccess = $this->facade->checkAccess($user, rand(100, 999), rand(100, 999), rand(100, 999));
$this->assertEquals(false, $hasAccess);
$this->assertFalse($hasAccess);
}
}

Expand Down

0 comments on commit 874e6ae

Please sign in to comment.