/**
* @dataProvider roleProvider
*/
public function testMatchIdentityRoles(array $rolesConfig, array $identityRoles, array $rolesToCheck, $doesMatch)
{
$identity = $this->getMock('ZfcRbac\\Identity\\IdentityInterface');
$identity->expects($this->once())->method('getRoles')->will($this->returnValue($identityRoles));
$identityProvider = $this->getMock('ZfcRbac\\Identity\\IdentityProviderInterface');
$identityProvider->expects($this->any())->method('getIdentity')->will($this->returnValue($identity));
$roleService = new RoleService($identityProvider, new InMemoryRoleProvider($rolesConfig), new RecursiveRoleIteratorStrategy());
$this->assertEquals($doesMatch, $roleService->matchIdentityRoles($rolesToCheck));
}