Exemplo n.º 1
0
 /**
  * @return array
  */
 public function provider()
 {
     $dateTime = new \DateTime();
     $dateStart = $dateTime->sub(new \DateInterval('P1Y'));
     $dateEnd = $dateTime->add(new \DateInterval('P4Y'));
     $dateTime = new \DateTime();
     $dateStartActual = $dateTime->sub(new \DateInterval('P6M'));
     $dateEndActual = $dateTime->add(new \DateInterval('P3Y'));
     $contactTest = new ContactTest();
     $callTest = new CallTest();
     $project = new Project();
     $project->setCall($callTest->provider()[0][0]);
     $project->setDateStart($dateStart);
     $project->setDateEnd($dateEnd);
     $project->setDateStartActual($dateStartActual);
     $project->setDateEndActual($dateEndActual);
     $project->setNumber(Rand::getString(4));
     $project->setContact($contactTest->provider()[0][0]);
     $project->setSummary('This is the summary');
     $project->setDescription('This is the description');
     $versionType = new Type();
     $versionType->setType('Type');
     $versionType->setId(1);
     return [[$project, $versionType]];
 }
Exemplo n.º 2
0
 /**
  * @return Type
  */
 public function provider()
 {
     $type = new Type();
     $type->setType('version-type');
     $type->setDescription('version-type-description');
     return [[$type]];
 }
Exemplo n.º 3
0
 /**
  * @param ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $versionType = new Type();
     $versionType->setType(Type::TYPE_PO);
     $versionType->setDescription('This is a project outline');
     $manager->persist($versionType);
     $versionType = new Type();
     $versionType->setType(Type::TYPE_FPP);
     $versionType->setDescription('This is a full project proposal');
     $manager->persist($versionType);
     $versionType = new Type();
     $versionType->setType(Type::TYPE_CR);
     $versionType->setDescription('This is a change request');
     $manager->persist($versionType);
     $versionType = new Type();
     $versionType->setType(Type::TYPE_SR);
     $versionType->setDescription('This is a stop request');
     $manager->persist($versionType);
     $manager->flush();
 }
Exemplo n.º 4
0
 public function testParseStatus()
 {
     $version = new Version();
     $versionType = new Type();
     $versionType->setType(Type::TYPE_PO);
     $version->setVersionType($versionType);
     $this->versionService->setVersion($version);
     $this->assertEquals('Unsubmitted', $this->versionService->parseStatus());
     $this->versionService->getVersion()->setDateSubmitted(new \DateTime());
     $this->versionService->getVersion()->setDateReviewed(null);
     $this->assertEquals('Decision Pending', $this->versionService->parseStatus());
     $this->versionService->getVersion()->setDateReviewed(new \DateTime());
     $this->versionService->getVersion()->setApproved(Version::STATUS_REJECTED);
     $this->assertEquals('Rejected', $this->versionService->parseStatus());
     $this->versionService->getVersion()->setApproved(Version::STATUS_APPROVED);
     $this->assertEquals('Approved', $this->versionService->parseStatus());
     $this->versionService->getVersion()->setApproved(Version::STATUS_SELECTED);
     $this->assertEquals('Selected', $this->versionService->parseStatus());
     $this->versionService->getVersion()->setApproved(Version::STATUS_RESUBMIT);
     $this->assertEquals('Resubmit', $this->versionService->parseStatus());
 }