/** * @depends testConstruct */ function testGetPrincipalsByPrefix() { $pdo = $this->getPDO(); $backend = new PDO($pdo); $expected = array(array('uri' => 'principals/user', '{http://sabredav.org/ns}email-address' => '*****@*****.**', '{DAV:}displayname' => 'User'), array('uri' => 'principals/group', '{http://sabredav.org/ns}email-address' => '*****@*****.**', '{DAV:}displayname' => 'Group')); $this->assertEquals($expected, $backend->getPrincipalsByPrefix('principals')); $this->assertEquals(array(), $backend->getPrincipalsByPrefix('foo')); }
/** * @depends testConstruct */ function testGetPrincipalsByPrefix() { $pdo = $this->getPDO(); $backend = new PDO($pdo); $expected = [['uri' => 'principals/admin', '{http://sabredav.org/ns}email-address' => '*****@*****.**', '{DAV:}displayname' => 'Administrator'], ['uri' => 'principals/user', '{http://sabredav.org/ns}email-address' => '*****@*****.**', '{DAV:}displayname' => 'User'], ['uri' => 'principals/group', '{http://sabredav.org/ns}email-address' => '*****@*****.**', '{DAV:}displayname' => 'Group']]; $this->assertEquals($expected, $backend->getPrincipalsByPrefix('principals')); $this->assertEquals([], $backend->getPrincipalsByPrefix('foo')); }