예제 #1
0
 /**
  * Test the removeAnnotationSources() method from the Annotation class
  * 
  * @uses \bcGen\MainBundle\Entity\Annotation::removeAnnotationSource()
  */
 public function testRemoveAnnotationSource()
 {
     echo "\n********************Test RemoveAnnotationSources()*****************************************\n";
     $expectedResult = -1;
     $this->annotation->addAnnotationSources($this->publication);
     $this->annotation->removeAnnotationSources($this->publication);
     $expectedResult = $this->annotation->getAnnotationSources()->count();
     $this->assertEquals(0, $expectedResult);
 }
예제 #2
0
 /**
  * 
  * {@inheritDoc}
  * 
  * @see \Doctrine\Common\DataFixtures\FixtureInterface::load()
  * 
  * @param Doctrine\Common\Persistence\ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $annotation1 = new Annotation();
     $annotation1->setAnnotationTitle('AnnotationTitleTU1');
     $annotation1->setAnnotationDesc('AnnotationDescTU1');
     $annotation1->setAnnotationPublic(1);
     $annotation1->setAnnotationType('Protein');
     $annotation1->addAnnotationSources($this->getReference('InnerCommunicationTU1'));
     $this->addReference('AnnotationTU1', $annotation1);
     $manager->persist($annotation1);
     $annotation2 = new Annotation();
     $annotation2->setAnnotationTitle('AnnotationTitleTU2');
     $annotation2->setAnnotationDesc('AnnotationDescTU2');
     $annotation2->setAnnotationPublic(1);
     $annotation2->setAnnotationType('Gene');
     $annotation2->addAnnotationSources($this->getReference('PublicationTU1'));
     $this->addReference('AnnotationTU2', $annotation2);
     $manager->persist($annotation2);
     $annotation3 = new Annotation();
     $annotation3->setAnnotationTitle('AnnotationTitleTU3');
     $annotation3->setAnnotationDesc('AnnotationDescTU3');
     $annotation3->setAnnotationPublic(0);
     $annotation3->setAnnotationType('Protein');
     $annotation3->addAnnotationSources($this->getReference('InnerCommunicationTU2'));
     $this->addReference('AnnotationTU3', $annotation3);
     $manager->persist($annotation3);
     $annotation4 = new Annotation();
     $annotation4->setAnnotationTitle('AnnotationTitleTU4');
     $annotation4->setAnnotationDesc('AnnotationDescTU4');
     $annotation4->setAnnotationPublic(0);
     $annotation4->setAnnotationType('Gene');
     $annotation4->addAnnotationSources($this->getReference('PublicationTU2'));
     $this->addReference('AnnotationTU4', $annotation4);
     $manager->persist($annotation4);
     $manager->flush();
 }