/** * Define which team lost this game - alternative to {@link BBMatchGame::set_winner()} * * @param BBTeam|int $loser tourney_team_id of the loser (null or false to indicat a draw) * @param int $winner_score * @param int $loser_score * @return boolean */ public function set_loser($loser, $winner_score = null, $loser_score = null) { if (!is_null($winner = $this->match->toggle_team($loser))) { return $this->set_winner($loser_score, $winner_score, $loser); } return false; }
/** * Test the accuracy of toggle_team() with an invalid team id * @covers BBMatch::toggle_team() */ public function test_toggle_team_invalid_id() { $invalid = $this->get_invalid_team(); $this->assertNull($this->object->toggle_team($invalid->id)); }