Ejemplo n.º 1
0
 public function testRemoveSubforum()
 {
     // new entity
     $team = new Team();
     // New dummy entity
     $subforum1 = new Subforum();
     $subforum1->setName("subforum1");
     $subforum2 = new Subforum();
     $subforum2->setName("subforum2");
     $subforum3 = new Subforum();
     $subforum3->setName("subforum3");
     // Use the addSubforum method
     $team->addSubforum($subforum1);
     $team->addSubforum($subforum2);
     $team->addSubforum($subforum3);
     // Remove $subforum1 from department
     $team->removeSubforum($subforum1);
     // subforums is stored in an array
     $subforums = $team->getSubforums();
     // Loop through the array
     foreach ($subforums as $subforum) {
         // Assert the result
         $this->assertNotEquals($subforum1, $subforum);
     }
 }