protected function loadTestData(ObjectManager $em)
 {
     $user = $this->loadUserData($em, 'test', 'test', '*****@*****.**', 'Test Test');
     //Set Creator
     $project = new Project();
     $project->setTitle('Test Project');
     $project->setDescription('Project used for testing only');
     $project->setCreator($user);
     //Set Access and Roles
     $userProjectAccess = new UserProjects();
     $userProjectAccess->setUser($user);
     $userProjectAccess->setRoles('Owner');
     $project->addUserProjects($userProjectAccess);
     $em->persist($project);
     $em->flush();
     $projectEnvironment = new ProjectEnvironment();
     $projectEnvironment->setProject($project);
     $projectEnvironment->setTitle('Current Project');
     $projectEnvironment->setDescription('Test project environment showing this systems git repo');
     $projectEnvironment->setPath($this->rootDir);
     $em->persist($projectEnvironment);
     $em->flush();
 }
Ejemplo n.º 2
0
 /**
  * Add project environment.
  *
  * @param \VersionControl\GitControlBundle\Entity\ProjectEnvironment $projectEnvironment
  *
  * @return resource
  */
 public function addProjectEnvironment(\VersionControl\GitControlBundle\Entity\ProjectEnvironment $projectEnvironment)
 {
     $projectEnvironment->setProject($this);
     $this->projectEnvironment[] = $projectEnvironment;
     return $this;
 }