示例#1
0
 public function test_player_functionality()
 {
     $steampunk = new Steampunk\Steampunk(self::SEED);
     $steampunk->newTurn("Cam");
     $this->assertEquals("Cam", $steampunk->getCurrentPlayer());
     $steampunk->newTurn("Bonnie");
     $this->assertEquals("Bonnie", $steampunk->getCurrentPlayer());
     $steampunk->setPlayer1("Max");
     $steampunk->setPlayer2("Bonnie");
     $this->assertEquals("Max", $steampunk->getPlayer1());
     $this->assertEquals("Bonnie", $steampunk->getPlayer2());
     $steampunk->newTurn("Max");
     $this->assertEquals("Max", $steampunk->getCurrentPlayer());
     $steampunk->alternatePlayer();
     $this->assertEquals("Bonnie", $steampunk->getCurrentPlayer());
     $steampunk->alternatePlayer();
     $this->assertEquals("Max", $steampunk->getCurrentPlayer());
 }