Exemplo n.º 1
0
 /**
  * @covers \BjyAuthorize\Provider\Role\ZendDb::getRoles
  */
 public function testGetRolesWithInheritance()
 {
     $this->tableGateway->expects($this->any())->method('selectWith')->will($this->returnValue(array(array('id' => 1, 'role_id' => 'guest', 'is_default' => 1, 'parent_id' => null), array('id' => 2, 'role_id' => 'user', 'is_default' => 0, 'parent_id' => 1))));
     $this->serviceLocator->expects($this->any())->method('get')->will($this->returnValue($this->tableGateway));
     $provider = new ZendDb(array(), $this->serviceLocator);
     $this->assertEquals($provider->getRoles(), array(new Role('guest'), new Role('user', 'guest')));
 }