public function testLoadPoliciesForUser()
{
$this->insertDatabaseFixture(__DIR__ . '/../../../../Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php');
$handler = $this->getUserHandler();
$policies = $handler->loadPoliciesByUserId(10);
// Anonymous user
// Verify, that we received an array of Policy objects
$this->assertTrue(array_reduce(array_map(function ($policy) {
return $policy instanceof Persistence\User\Policy;
}, $policies), function ($a, $b) {
return $a && $b;
}, true));
$this->assertEquals(8, count($policies));
}