function testCalculateScore2() { $player1 = new FoosPlayer('player1', 1000); $player2 = new FoosPlayer('player2', 1000); $match = new FoosMatch($player1, 1, $player2, 2); $match->calculateScore(); $this->assertEqual($player2->getStrength(), 1100); $this->assertEqual($player1->getStrength(), 900); }
public function isIgnoredPlayer(FoosPlayer $player) { foreach ($this->getIgnoreList() as $ignoredName) { if ($player->matchesName($ignoredName)) { return true; } } return false; }
function testMatchName() { $player = new FoosPlayer('Name', 1); $this->assertTrue($player->matchesName('name')); $this->assertFalse($player->matchesName('hamster')); }