function testDeleteMatch() { $table = new FoosTable(dirname(__FILE__) . '/testData/'); $table->loadCurrentStatus(); $matches = $table->getMatches(); $match = $matches[3]; $this->assertEqual($table->getNumberOfMatches(), 37); $this->assertTrue($table->deleteMatch($match->getTimestamp())); $this->assertEqual($table->getNumberOfMatches(), 36); $this->assertFalse($table->deleteMatch($match->getTimestamp())); $this->assertEqual($table->getNumberOfMatches(), 36); }
</div> <div class="tab" id="history"> <table id="history"> <tr> <th>#</th> <th>Winner</th> <th></th> <th>Loser</th> <th></th> <th>Time</th> <th>Action</th> </tr> <!-- LOG --> <?php $i = 1; foreach (array_reverse($table->getMatches()) as $match) { echo "<tr>"; echo "<td>" . $i++ . "</td>"; echo "<td>" . $match->getPlayer1()->getName() . "</td>"; echo "<td>" . $match->getScore1() . "</td>"; echo "<td>" . $match->getPlayer2()->getName() . "</td>"; echo "<td>" . $match->getScore2() . "</td>"; echo "<td>" . date('d F Y g:i A', $match->getTimestamp()) . "</td>"; echo "<td><a href=\"confirm.php?delete=" . $match->getTimestamp() . "\">Delete</a></td>"; echo "</tr>"; } ?> </table> <!--<script src="js/scripts.js"></script>--> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript">