예제 #1
0
 /**
  * @dataProvider constructor_provider
  */
 public function test_it_should_set_some_properties_when_we_construct_it($name, $status, $parsed)
 {
     $permission = new Permission($name, $status);
     $this->assertEquals($name, $permission->getName());
     $this->assertEquals($status, $permission->getStatus());
     $this->assertEquals($parsed, $permission->getParsedStatus());
 }
예제 #2
0
 public function findInPermissions(Permission $permission)
 {
     $this->is_baned = false;
     $simplified = $permission->simplifyPermission();
     foreach ($this->permissions as $stored_permission) {
         $stored_permission_simplified = $stored_permission->simplifyPermission();
         if ($simplified['name'] == $stored_permission_simplified['name']) {
             $this->is_baned = true;
             return true;
         }
     }
     return false;
 }