Login   Register  
PHP Classes
elePHPant
Icontem

File: test/TicTacToeTest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Amin Saeidi  >  Tic-Tac-Toe  >  test/TicTacToeTest.php  >  Download  
File: test/TicTacToeTest.php
Role: Unit test script
Content type: text/plain
Description: test
Class: Tic-Tac-Toe
Tic-Tac-Toe game using alpha beta search algorithm
Author: By
Last change:
Date: 4 years ago
Size: 437 bytes
 

Contents

Class file image Download
<?php
require_once 'PHPUnit/Framework.php';
require_once 
'Board.php';
require_once 
'TicTacToe.php';

class 
TicTacToeTest extends PHPUnit_Framework_TestCase {
    
    protected 
$ttt;
    
    protected function 
setUp() {
        
$this->ttt = new TicTacToe();
    }
    
    public function 
testAlphaBeta()
    {
        
$value $this->ttt->alphaBeta(new Board(), GameSearch::COM);
        
$boardPosition $value[1]->get();
        
$this->assertEquals(-1$boardPosition[4]);
    }
    
}