/** * @expectedException \OC\User\NoUserException */ public function testGetHomeDeletedUser() { $access = $this->getAccessMock(); $backend = new UserLDAP($access, $this->getMock('\\OCP\\IConfig')); $this->prepareMockForUserExists($access); $access->connection->expects($this->any())->method('__get')->will($this->returnCallback(function ($name) { if ($name === 'homeFolderNamingRule') { return 'attr:testAttribute'; } return null; })); $access->expects($this->any())->method('readAttribute')->will($this->returnValue([])); $userMapper = $this->getMockBuilder('\\OCA\\User_LDAP\\Mapping\\UserMapping')->disableOriginalConstructor()->getMock(); $access->expects($this->any())->method('getUserMapper')->will($this->returnValue($userMapper)); $this->configMock->expects($this->any())->method('getUserValue')->will($this->returnValue(true)); //no path at all – triggers OC default behaviour $result = $backend->getHome('newyorker'); $this->assertFalse($result); }