示例#1
0
 /**
  * A method that does the common steps of test cases 1 and 2. The evaluation
  * is not happening here.
  *
  * @param string $dn
  * @param string $username
  * @param string $image
  */
 private function execFetchTest($dn, $username, $image)
 {
     $this->setJpegPhotoAttribute($dn, $image);
     // assigns our self-picked oc username to the dn
     $this->mapping->map($dn, $username, 'fakeUUID-' . $username);
     // initialize home folder and make sure that the user will update
     // also remove an possibly existing avatar
     \OC_Util::tearDownFS();
     \OC_Util::setupFS($username);
     \OC::$server->getUserFolder($username);
     \OC::$server->getConfig()->deleteUserValue($username, 'user_ldap', User::USER_PREFKEY_LASTREFRESH);
     if (\OC::$server->getAvatarManager()->getAvatar($username)->exists()) {
         \OC::$server->getAvatarManager()->getAvatar($username)->remove();
     }
     // finally attempt to get the avatar set
     $user = $this->userManager->get($dn);
     $user->updateAvatar();
 }
 /**
  * adds a map entry for the user, so we know the username
  *
  * @param $dn
  * @param $username
  */
 private function prepareUser($dn, $username)
 {
     // assigns our self-picked oc username to the dn
     $this->mapping->map($dn, $username, 'fakeUUID-' . $username);
 }