public function testBatchApplyUserAttributes() { list($lw, $con, $um) = $this->getConnectorAndLdapMock(); $access = new Access($con, $lw, $um); $mapperMock = $this->getMockBuilder('\\OCA\\User_LDAP\\Mapping\\UserMapping')->disableOriginalConstructor()->getMock(); $userMock = $this->getMockBuilder('\\OCA\\user_ldap\\lib\\user\\User')->disableOriginalConstructor()->getMock(); $access->setUserMapper($mapperMock); $data = array(array('dn' => 'foobar', $con->ldapUserDisplayName => 'barfoo'), array('dn' => 'foo', $con->ldapUserDisplayName => 'bar'), array('dn' => 'raboof', $con->ldapUserDisplayName => 'oofrab')); $userMock->expects($this->exactly(count($data)))->method('processAttributes'); $um->expects($this->exactly(count($data)))->method('get')->will($this->returnValue($userMock)); $access->batchApplyUserAttributes($data); }