Ejemplo n.º 1
0
 /**
  * Test updating games in an existing match
  *
  * @covers BBGame::save_games()
  */
 public function test_save_games()
 {
     $this->assertTrue($this->object->set_winner($this->object->team()));
     $this->assertSave($this->object->report());
     //Reported - try adding game details after reporting using save_games
     $this->assertInstanceOf('BBMatchGame', $game1 = $this->object->game());
     $this->assertInstanceOf('BBMatchGame', $game2 = $this->object->game($this->object->loser()));
     $this->assertTrue($this->object->save_games());
     //Make sure they have ids
     $this->assertID($game1->id);
     $this->assertID($game2->id);
     //Add one more game, this time use match::save to submit
     $this->assertInstanceOf('BBMatchGame', $game3 = $this->object->game());
     $this->assertSave($this->object->save());
     $this->assertID($game3->id);
 }