/** * Test empty fields */ public function testEmptyPerson() { $sponsor = new Sponsor(); $this->assertNull($sponsor->getId()); $this->assertNull($sponsor->getSlug()); $this->assertNull($sponsor->getName()); $this->assertNull($sponsor->getSite()); $this->assertNull($sponsor->getAbout()); $this->assertNull($sponsor->getLogo()); $this->assertNull($sponsor->getFile()); $this->assertNull($sponsor->getCreatedAt()); $this->assertNull($sponsor->getUpdatedAt()); }
/** * @param \Doctrine\Common\Persistence\ObjectManager $manager */ public function load(ObjectManager $manager) { // Magento $magento = new Sponsor(); $magento->setName('Magento'); $magento->setSlug('magento'); $magento->setSite('http://ua.magento.com/'); $magento->setFile($this->_generateUploadedFile('magento.png')); $magento->setAbout('The Magento eCommerce platform serves more than 125,000 merchants worldwide and is supported by a global ecosystem of solution partners and third-party developers.'); $magento->setSortOrder(10); $magento->setOnMain(true); $manager->persist($magento); $this->addReference('sponsor-magento', $magento); // oDesk $odesk = new Sponsor(); $odesk->setName('oDesk'); $odesk->setSlug('odesk'); $odesk->setSite('http://odesk.com/'); $odesk->setFile($this->_generateUploadedFile('odesk.jpg')); $odesk->setAbout('oDesk is a global marketplace that helps employers hire, manage, and pay remote freelancers or teams. It\'s free to post a job and hire from over 1 million top professionals.'); $odesk->setSortOrder(20); $odesk->setOnMain(true); $manager->persist($odesk); $this->addReference('sponsor-odesk', $odesk); // ePochta $epochta = new Sponsor(); $epochta->setName('ePochta'); $epochta->setSlug('epochta'); $epochta->setSite('http://www.epochta.ru/'); $epochta->setFile($this->_generateUploadedFile('epochta.png')); $epochta->setOnMain(false); $epochta->setSortOrder(15); $manager->persist($epochta); $this->addReference('sponsor-epochta', $epochta); $manager->flush(); }