parentRoleHelper = self::$container->get(ParentRoleHelper::class); } public function testGetReachableRoles() { // this test will be valid until the role hierarchy for person is changed. // this is not perfect but spare us a mock $parentRoles = $this->parentRoleHelper->getParentRoles(PersonVoter::SEE); $this->assertCount(3, $parentRoles); $this->assertContains(PersonVoter::CREATE, $parentRoles); $this->assertContains(PersonVoter::UPDATE, $parentRoles); $this->assertContains(PersonVoter::SEE, $parentRoles); } public function testIsRoleReached() { $this->assertTrue($this->parentRoleHelper->isRoleReached(PersonVoter::SEE, PersonVoter::CREATE)); $this->assertFalse($this->parentRoleHelper->isRoleReached(PersonVoter::SEE, 'foo')); } }