Exemplo n.º 1
0
 public function testRemoveTeam()
 {
     // new entity
     $department = new Department();
     $team1 = new Team();
     $team1->setName("Team1");
     $team2 = new Team();
     $team2->setName("Team2");
     $team3 = new Team();
     $team3->setName("Team3");
     // Use the addTeam method
     $department->addTeam($team1);
     $department->addTeam($team2);
     $department->addTeam($team3);
     // Remove $team1 from department
     $department->removeTeam($team1);
     // Teams are stored in an array
     $teams = $department->getTeams();
     // Loop through the array
     foreach ($teams as $team) {
         // Assert the result
         $this->assertNotEquals($team1, $team);
     }
 }