Example #1
0
 /**
  * 
  * {@inheritDoc}
  * 
  * @see \Doctrine\Common\DataFixtures\FixtureInterface::load()
  * 
  * @param Doctrine\Common\Persistence\ObjectManager $manager
  * 
  */
 public function load(ObjectManager $manager)
 {
     $publicationTU1 = new Publication();
     $publicationTU1->setPubHref('URLTU1');
     $publicationTU1->setSourceAuthor('AuthorTU1');
     $publicationTU1->setSourceTitle('TitleTU1');
     $publicationTU1->setSourceYear(new \DateTime());
     $manager->persist($publicationTU1);
     $this->addReference('PublicationTU1', $publicationTU1);
     $publicationTU2 = new Publication();
     $publicationTU2->setPubHref('URLTU2');
     $publicationTU2->setSourceAuthor('AuthorTU2');
     $publicationTU2->setSourceTitle('TitleTU2');
     $publicationTU2->setSourceYear(new \DateTime());
     $manager->persist($publicationTU2);
     $this->addReference('PublicationTU2', $publicationTU2);
     $manager->flush();
 }
Example #2
0
 /**
  * Test the setSourceAuthor() method from the Source class
  *
  * @uses \bcGen\MainBundle\Entity\Source::setSourceAuthor()
  */
 public function testSetSourceAuthor()
 {
     echo "\n********************Test SetSourceAuthor()****************************************************\n";
     $this->publication->setSourceAuthor('setSourceAuthor');
     $this->assertEquals('setSourceAuthor', $this->publication->getSourceAuthor());
 }