Exemplo n.º 1
0
 public function testSetName()
 {
     // new entity
     $forum = new Forum();
     // Use the setName method
     $forum->setName("Generelt");
     // Assert the result
     $this->assertEquals("Generelt", $forum->getName());
 }
Exemplo n.º 2
0
 public function load(ObjectManager $manager)
 {
     $forum1 = new Forum();
     $forum1->setName('Skoler');
     $forum1->setDescription('Diskusjon for de ulike ungdommskolene');
     $forum1->setType("school");
     $manager->persist($forum1);
     $manager->flush();
     $this->addReference('forum-1', $forum1);
 }
Exemplo n.º 3
0
 public function testRemoveForum()
 {
     // new entity
     $subforum = new Subforum();
     // New dummy entity
     $forum1 = new Forum();
     $forum1->setName("skole1");
     $forum2 = new Forum();
     $forum2->setName("skole2");
     $forum3 = new Forum();
     $forum3->setName("skole3");
     // Use the addForum method
     $subforum->addForum($forum1);
     $subforum->addForum($forum2);
     $subforum->addForum($forum3);
     // Remove $forum1 from department
     $subforum->removeForum($forum1);
     // forums is stored in an array
     $forums = $subforum->getForums();
     // Loop through the array
     foreach ($forums as $forum) {
         // Assert the result
         $this->assertNotEquals($forum1, $forum);
     }
 }