public function testEncode_ProjectWithSendReceive_DtoCorrect()
 {
     $userId = self::$environ->createUser('User', 'Name', '*****@*****.**');
     $user = new UserModel($userId);
     $user->role = SystemRoles::USER;
     $project = self::$environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE);
     $projectId = $project->id->asString();
     $project->interfaceLanguageCode = 'en';
     $project->projectCode = 'lf';
     $project->featured = true;
     $project->sendReceiveProjectIdentifier = 'test-sr-identifier';
     $project->sendReceiveProject = new SendReceiveProjectModel('test-sr-name', '', 'manager');
     $project->addUser($userId, ProjectRoles::CONTRIBUTOR);
     $user->addProject($projectId);
     $user->write();
     $project->write();
     $dto = LexProjectDto::encode($projectId);
     // test for a few default values
     $this->assertEquals('en', $dto['project']['interfaceLanguageCode']);
     $this->assertEquals('lf', $dto['project']['projectCode']);
     $this->assertTrue($dto['project']['featured']);
     $this->assertEquals('test-sr-identifier', $dto['project']['sendReceive']['project']['identifier']);
 }
Пример #2
0
 public function lex_projectDto()
 {
     return LexProjectDto::encode($this->projectId);
 }