Ejemplo n.º 1
0
 /**
  * 
  * {@inheritDoc}
  * 
  * @see \Doctrine\Common\DataFixtures\FixtureInterface::load()
  * 
  * @param Doctrine\Common\Persistence\ObjectManager $manager
  * 
  */
 public function load(ObjectManager $manager)
 {
     $condition1 = new Condition();
     $condition1->setConditionDesc('ConditionDescTU1');
     $condition1->setPublicCond('PublicCondTU1');
     $condition1->addConditionSources($this->getReference('InnerCommunicationTU1'));
     $manager->persist($condition1);
     $this->addReference('ConditionTU1', $condition1);
     $condition2 = new Condition();
     $condition2->setConditionDesc('ConditionDescTU2');
     $condition2->setPublicCond('PublicCondTU2');
     $condition2->addConditionSources($this->getReference('PublicationTU1'));
     $manager->persist($condition2);
     $this->addReference('ConditionTU2', $condition2);
     $condition3 = new Condition();
     $condition3->setConditionDesc('ConditionDescTU3');
     $condition3->setPublicCond('PublicCondTU3');
     $condition3->addConditionSources($this->getReference('InnerCommunicationTU2'));
     $manager->persist($condition3);
     $this->addReference('ConditionTU3', $condition3);
     $condition4 = new Condition();
     $condition4->setConditionDesc('ConditionDescTU4');
     $condition4->setPublicCond('PublicCondTU4');
     $condition4->addConditionSources($this->getReference('PublicationTU2'));
     $manager->persist($condition4);
     $this->addReference('ConditionTU4', $condition4);
     $condition5 = new Condition();
     $condition5->setConditionDesc('ConditionDescTU5');
     $condition5->setPublicCond('PublicCondTU5');
     $condition5->addConditionSources($this->getReference('PublicationTU2'));
     $manager->persist($condition5);
     $this->addReference('ConditionTU5', $condition5);
     $manager->flush();
 }
Ejemplo n.º 2
0
 /**
  * Test the removeConditionSources() method from the Condition class
  * 
  * @uses \bcGen\MainBundle\Entity\Condition::removeConditionSource()
  */
 public function testRemoveConditionSources()
 {
     echo "\n********************Test RemoveConditionSources()*****************************************\n";
     $result = -1;
     $this->condition->addConditionSources($this->publication);
     $this->condition->removeConditionSources($this->publication);
     $result = $this->condition->getConditionSources()->count();
     $this->assertEquals(0, $result);
 }