/**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->smtpUser = new Tinebase_Model_EmailUser(array('emailAddress' => $user->accountEmailAddress, 'emailAliases' => array('*****@*****.**', '*****@*****.**')));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     $this->assertEquals(array('*****@*****.**', '*****@*****.**'), $testUser->smtpUser->emailAliases);
     $this->assertEquals($user->accountEmailAddress, $testUser->smtpUser->emailAddress);
     return $testUser;
 }
 /**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->imapUser = new Tinebase_Model_EmailUser(array('emailMailQuota' => 1000));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     #var_dump($testUser->toArray());
     #var_dump($this->_config);
     $this->assertEquals(array('emailUID' => empty($this->_config['domain']) ? $user->accountLoginName : $user->accountLoginName . '@' . $this->_config['domain'], 'emailGID' => sprintf("%u", crc32(Tinebase_Application::getInstance()->getApplicationByName('Tinebase')->getId())), 'emailMailQuota' => 1000, 'emailForwardOnly' => 0), $testUser->imapUser->toArray());
     return $user;
 }
 /**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->sambaSAM = new Tinebase_Model_SAMUser(array('homeDrive' => 'H:', 'homePath' => '\\\\smbserver\\homes'));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     $this->assertEquals($user->accountLoginName, $testUser->accountLoginName);
     $this->assertTrue(!empty($testUser->sambaSAM->sid), 'no sid set');
     $this->assertEquals('H:', $testUser->sambaSAM->homeDrive);
     $this->assertEquals('\\\\smbserver\\homes', $testUser->sambaSAM->homePath);
     return $user;
 }
 /**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->smtpUser = new Tinebase_Model_EmailUser(array('emailAddress' => $user->accountEmailAddress, 'emailForwardOnly' => true, 'emailForwards' => array('unittest@' . $this->_mailDomain, 'test@' . $this->_mailDomain), 'emailAliases' => array('bla@' . $this->_mailDomain, 'blubb@' . $this->_mailDomain)));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     $this->assertEquals(array('unittest@' . $this->_mailDomain, 'test@' . $this->_mailDomain), $testUser->smtpUser->emailForwards);
     $this->assertEquals(array('bla@' . $this->_mailDomain, 'blubb@' . $this->_mailDomain), $testUser->smtpUser->emailAliases);
     $this->assertEquals(true, $testUser->smtpUser->emailForwardOnly);
     $this->assertEquals($user->accountEmailAddress, $testUser->smtpUser->emailAddress);
     return $testUser;
 }
 /**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->imapUser = new Tinebase_Model_EmailUser(array('emailMailQuota' => 1000));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     #var_dump($testUser->imapUser->toArray());
     #var_dump($this->_config);
     $this->assertEquals($user->imapUser->emailMailQuota, $testUser->imapUser->emailMailQuota, 'emailMailQuota');
     $this->assertEquals(empty($this->_config['domain']) ? $user->accountLoginName : $user->accountLoginName . '@' . $this->_config['domain'], $testUser->imapUser->emailUserId, 'emailUserId');
     $this->assertEquals(empty($this->_config['domain']) ? $user->accountLoginName : $user->accountLoginName . '@' . $this->_config['domain'], $testUser->imapUser->emailUsername, 'emailUsername');
     return $user;
 }
 /**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->smtpUser = new Tinebase_Model_EmailUser(array('emailAddress' => $user->accountEmailAddress, 'emailForwardOnly' => true, 'emailForwards' => array(Tinebase_Core::getUser()->accountEmailAddress, '*****@*****.**'), 'emailAliases' => array('*****@*****.**', '*****@*****.**')));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     #var_dump($testUser->toArray());
     #var_dump($this->_config);
     $this->assertEquals(array(Tinebase_Core::getUser()->accountEmailAddress, '*****@*****.**'), $testUser->smtpUser->emailForwards);
     $this->assertEquals(array('*****@*****.**', '*****@*****.**'), $testUser->smtpUser->emailAliases);
     $this->assertEquals(true, $testUser->smtpUser->emailForwardOnly);
     $this->assertEquals($user->accountEmailAddress, $testUser->smtpUser->emailAddress);
     return $testUser;
 }
 /**
  * try to add an user
  * 
  * @return Tinebase_Model_FullUser
  */
 public function testAddUser()
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     $user->smtpUser = new Tinebase_Model_EmailUser(array('emailAddress' => $user->accountEmailAddress, 'emailForwardOnly' => true, 'emailForwards' => array('unittest@' . $this->_mailDomain, 'test@' . $this->_mailDomain), 'emailAliases' => array('bla@' . $this->_mailDomain, 'blubb@' . $this->_mailDomain)));
     $testUser = $this->_backend->addUser($user);
     $this->objects['users']['testUser'] = $testUser;
     $this->assertTrue($testUser instanceof Tinebase_Model_FullUser);
     $this->assertTrue(isset($testUser->smtpUser), 'no smtpUser data found in ' . print_r($testUser->toArray(), TRUE));
     $this->assertEquals(array('unittest@' . $this->_mailDomain, 'test@' . $this->_mailDomain), $testUser->smtpUser->emailForwards, 'forwards not found');
     $this->assertEquals(array('bla@' . $this->_mailDomain, 'blubb@' . $this->_mailDomain), $testUser->smtpUser->emailAliases, 'aliases not found');
     $this->assertEquals(true, $testUser->smtpUser->emailForwardOnly);
     $this->assertEquals($user->accountEmailAddress, $testUser->smtpUser->emailAddress);
     return $testUser;
 }
 /**
  * add user with email data
  * 
  * @param string $username
  * @return Tinebase_Model_FullUser
  */
 protected function _addUser($username = NULL)
 {
     $user = Tinebase_User_LdapTest::getTestRecord();
     if ($username) {
         $user->accountLoginName = $username;
     }
     $user->imapUser = new Tinebase_Model_EmailUser(array('emailPassword' => Tinebase_Record_Abstract::generateUID(), 'emailUID' => '1000', 'emailGID' => '1000'));
     $user = Tinebase_User::getInstance()->addUser($user);
     $this->_objects['fullUsers'] = array($user);
     return $user;
 }