public function testCanRemoveEntity() { $program = $this->entityManager->find("Program\\Entity\\Program", 2); $this->programService->removeEntity($program); $reloadProgram = $this->entityManager->find("Program\\Entity\\Program", 2); $this->assertNull($reloadProgram); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $this->contact = $this->entityManager->find("Contact\\Entity\\Contact", 1); $this->addressTypeData = array('type' => 'address type'); $this->addressType = new AddressType(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $roadmap = $this->entityManager->find("Program\\Entity\\Roadmap", 1); $this->domainData = ['domain' => 'ITEA2', 'roadmap' => $roadmap, 'description' => 'This is a second description', 'color' => '#abcdef', 'mainId' => '2']; $this->domain = new Domain(); }
public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('Doctrine\\ORM\\EntityManager'); $country = $this->entityManager->find("General\\Entity\\Country", 1); $this->euData = array('country' => $country, 'since' => new \DateTime()); $this->eu = new Eu(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1); $this->webData = array('contact' => $contact, 'web' => 'http://www.example.com'); $this->web = new Web(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1); $this->emailData = array('contact' => $contact, 'email' => '*****@*****.**'); $this->email = new Email(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1); $this->cvData = array('contact' => $contact, 'cv' => file_get_contents(__DIR__ . '/../_files/php.exe')); $this->cv = new Cv(); }
public function testCanFindFunderByCountry() { $country = $this->entityManager->find("General\\Entity\\Country", 1); $funder = $this->programService->findFunderByCountry($country); foreach ($funder as $funderResult) { $this->assertInstanceOf('Program\\Entity\\Funder', $funderResult); $this->assertEquals($funderResult->getCountry()->getId(), 1); } }
public function testCanFindProjectByNews() { $news = $this->entityManager->find('News\\Entity\\News', 1); $projectsServiceByNews = $this->projectService->findProjectByNews($news); $this->assertTrue(is_array($projectsServiceByNews)); foreach ($projectsServiceByNews as $projectService) { $this->assertInstanceOf("Project\\Service\\ProjectService", $projectService); } }
public function testCanAcceptInvite() { $invite = $this->inviteService->setInviteId(1)->getInvite(); $contact = $this->entityManager->find('Contact\\Entity\\Contact', 1); $organisation = $this->entityManager->find("Organisation\\Entity\\Organisation", 1); $contactOrganisation = new ContactOrganisation(); $contactOrganisation->setContact($contact); $contactOrganisation->setOrganisation($organisation); $this->assertTrue($this->inviteService->acceptInvitation($invite, $contact, InviteAccept::OPTION_NEW_PARTNER)); $this->assertTrue($this->inviteService->acceptInvitation($invite, $contact, InviteAccept::OPTION_FINANCIAL_CONTACT)); $this->assertTrue($this->inviteService->acceptInvitation($invite, $contact, InviteAccept::OPTION_ADDITIONAL_CONTACT)); $this->assertTrue($this->inviteService->acceptInvitation($invite, $contact, InviteAccept::OPTION_MAIN_TECHNICAL_CONTACT)); }
public function testCanAddMultipleOptInToUser() { $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1); $optIn = new \Contact\Entity\OptIn(); $optIn->setOptIn(3); $optIn->setDescription('This is the description'); $optIn2 = new \Contact\Entity\OptIn(); $optIn2->setOptIn(4); $optIn2->setDescription('This is the description'); $contact->setOptIn(array($optIn, $optIn2)); $this->entityManager->persist($contact); $this->entityManager->flush(); $this->assertEquals(2, sizeof($contact->getOptIn())); }
public function testCanCreateFormAndBindEntity() { $project = $this->entityManager->find("Project\\Entity\\Project", 1); $projectForm = $this->formService->getForm(null, $project, true); $this->assertInstanceOf('Zend\\Form\\Form', $projectForm); }