/**
  * Test students loginname with schema set max length
  */
 public function testStudentNameSchemaMaxLength()
 {
     $this->_schemaConfigChanged = true;
     $this->_usernameLengthConfigChanged = true;
     Courses_Config::getInstance()->set(Courses_Config::STUDENTS_USERNAME_SCHEMA, 3);
     Tinebase_Config::getInstance()->set(Tinebase_Config::MAX_USERNAME_LENGTH, 4);
     $course = $this->_getCourseData();
     $courseData = $this->_json->saveCourse($course);
     $this->_groupsToDelete->addRecord(Tinebase_Group::getInstance()->getGroupById($courseData['group_id']));
     $result = $this->_json->addNewMember(array('accountFirstName' => 'Jams', 'accountLastName' => 'Hot'), $courseData);
     $this->assertEquals(2, count($result['results']));
     $id = NULL;
     foreach ($result['results'] as $result) {
         if ($result['name'] === 'Hot, Jams') {
             $id = $result['id'];
         }
     }
     $this->assertTrue($id !== NULL);
     $newUser = Tinebase_User::getInstance()->getFullUserById($id);
     $this->assertEquals('j.ho', $newUser->accountLoginName);
 }