public function testEquals() { $compareTeam = new Team(); $this->assertTrue($this->team->equals($compareTeam)); $this->team->setId(1); $compareTeam->setId(2); $this->assertFalse($this->team->equals($compareTeam)); }
/** * @param Team $team */ public function setTeam(Team $team) { if (null === $this->team || !$this->team->equals($team)) { $this->team = $team; $this->team->addPlayer($this); } }