cvs: pear /Games_Chess/tests Games_Chess_TestCase_getPossibleRookMoves.php Games_Chess_TestCase_getRookSquares.php
Games_Chess_TestCase_getSquareFromParsedMove.php Games_Chess_TestCase_inBasicDraw.php Games_Chess_TestCase_inCheckMate.php
Games_Chess_TestCase_inStaleMate.php Games_Chess_TestCase_interposeOrCapture.php Games_Chess_TestCase_moveAlgebraic.php
Games_Chess_TestCase_movePiece.php Games_Chess_TestCase_moveSAN.php Games_Chess_TestCase_parseFen.php
/Games_Chess/tests/Games_Chess/getPossibleRookMoves setup.php.inc test_invalid_color.phpt test_invalid_square.phpt test_valid_b1.phpt
test_valid_b2.phpt test_valid_b3.phpt test_valid_w1.phpt test_valid_w2.phpt test_valid_w3.phpt /Games_Chess/tests/Games_Chess/getRookSquares
setup.php.inc test_a1.phpt test_a8.phpt test_e4.phpt test_h1.phpt test_h8.phpt /Games_Chess/tests/Games_Chess/getSquareFromParsedMove setup.php.inc
test_ambiguous1.phpt test_ambiguous2.phpt test_ambiguous3.phpt test_getking.phpt test_getsimpl! e.phpt test_invalid_ambiguous1.phpt
test_invalid_ambiguous2.phpt /Games_Chess/tests/Games_Chess/inBasicDraw setup.php.inc test_kingsonly.phpt test_kkb.phpt test_kkbb_invalid.phpt
test_kkbb_valid.phpt test_kkn.phpt test_notdraw1.phpt test_notdraw2.phpt /Games_Chess/tests/Games_Chess/inCheckMate setup.php.inc test1.phpt
test_bug7565.phpt test_doublecheck.phpt test_interposingpiece.phpt test_kingcanmove.phpt test_smotheredmate.phpt
/Games_Chess/tests/Games_Chess/inStaleMate setup.php.inc test1.phpt test2.phpt test_notstalemate.phpt
/Games_Chess/tests/Games_Chess/interposeOrCapture setup.php.inc test_knightcheck_capture_impossible.phpt test_knightcheck_capture_possible.phpt
test_piececheck_capture_impossible.phpt test_piececheck_capture_possible.phpt test_piececheck_interpose_possible.phpt
/Games_Chess/tests/Games_Chess/moveAlgebraic setup.php.inc test_capture.phpt test_simple.phpt /Games_Chess/tests/Games_Chess/movePiece setup.php.inc
test_pawn.phpt test_piece.phpt test_! promotedpiece.phpt /Games_Chess/tests/Games_Chess/moveSAN setup.php.inc test_castlekb.phpt test_castlekw.phpt
test_castleqb.phpt test_castleqw.phpt test_invalidpawnmove.phpt test_invalidpiecemove.phpt test_moveking.phpt test_moverook.phpt
test_pawncapture1.phpt test_pawncapture2.phpt test_pawnmove1.phpt test_pawnmove2.phpt
| From: | Greg Beaver | Date: | Wed, 04 Oct 2006 19:50:37 +0000 |
| Subject: | cvs: pear /Games_Chess/tests Games_Chess_TestCase_getPossibleRookMoves.php Games_Chess_TestCase_getRookSquares.php Games_Chess_TestCase_getSquareFromParsedMove.php Games_Chess_TestCase_inBasicDraw.php Games_Chess_TestCase_inCheckMate.php Games_Chess_TestCase_inStaleMate.php Games_Chess_TestCase_interposeOrCapture.php Games_Chess_TestCase_moveAlgebraic.php Games_Chess_TestCase_movePiece.php Games_Chess_TestCase_moveSAN.php Games_Chess_TestCase_parseFen.php /Games_Chess/tests/Games_Chess/getPossibleRookMoves setup.php.inc test_invalid_color.phpt test_invalid_square.phpt test_valid_b1.phpt test_valid_b2.phpt test_valid_b3.phpt test_valid_w1.phpt test_valid_w2.phpt test_valid_w3.phpt /Games_Chess/tests/Games_Chess/getRookSquares setup.php.inc test_a1.phpt test_a8.phpt test_e4.phpt test_h1.phpt test_h8.phpt /Games_Chess/tests/Games_Chess/getSquareFromParsedMove setup.php.inc test_ambiguous1.phpt test_ambiguous2.phpt test_ambiguous3.phpt test_getking.phpt test_getsimpl! e.phpt test_invalid_ambiguous1.phpt test_invalid_ambiguous2.phpt /Games_Chess/tests/Games_Chess/inBasicDraw setup.php.inc test_kingsonly.phpt test_kkb.phpt test_kkbb_invalid.phpt test_kkbb_valid.phpt test_kkn.phpt test_notdraw1.phpt test_notdraw2.phpt /Games_Chess/tests/Games_Chess/inCheckMate setup.php.inc test1.phpt test_bug7565.phpt test_doublecheck.phpt test_interposingpiece.phpt test_kingcanmove.phpt test_smotheredmate.phpt /Games_Chess/tests/Games_Chess/inStaleMate setup.php.inc test1.phpt test2.phpt test_notstalemate.phpt /Games_Chess/tests/Games_Chess/interposeOrCapture setup.php.inc test_knightcheck_capture_impossible.phpt test_knightcheck_capture_possible.phpt test_piececheck_capture_impossible.phpt test_piececheck_capture_possible.phpt test_piececheck_interpose_possible.phpt /Games_Chess/tests/Games_Chess/moveAlgebraic setup.php.inc test_capture.phpt test_simple.phpt /Games_Chess/tests/Games_Chess/movePiece setup.php.inc test_pawn.phpt test_piece.phpt test_! promotedpiece.phpt /Games_Chess/tests/Games_Chess/moveSAN setup.php.inc test_castlekb.phpt test_castlekw.phpt test_castleqb.phpt test_castleqw.phpt test_invalidpawnmove.phpt test_invalidpiecemove.phpt test_moveking.phpt test_moverook.phpt test_pawncapture1.phpt test_pawncapture2.phpt test_pawnmove1.phpt test_pawnmove2.phpt |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42415@lists.php.net to get a copy of this message | ||
cellog Wed Oct 4 19:50:37 2006 UTC
Added files:
/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves
setup.php.inc
test_invalid_color.phpt
test_invalid_square.phpt
test_valid_b1.phpt
test_valid_b2.phpt
test_valid_b3.phpt
test_valid_w1.phpt
test_valid_w2.phpt
test_valid_w3.phpt
/pear/Games_Chess/tests/Games_Chess/getRookSquares setup.php.inc
test_a1.phpt
test_a8.phpt
test_e4.phpt
test_h1.phpt
test_h8.phpt
/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove
setup.php.inc
test_ambiguous1.phpt
test_ambiguous2.phpt
test_ambiguous3.phpt
test_getking.phpt
test_getsimple.phpt
test_invalid_ambiguous1.phpt
test_invalid_ambiguous2.phpt
/pear/Games_Chess/tests/Games_Chess/inBasicDraw setup.php.inc
test_kingsonly.phpt
test_kkb.phpt
test_kkbb_invalid.phpt
test_kkbb_valid.phpt
test_kkn.phpt
test_notdraw1.phpt
test_notdraw2.phpt
/pear/Games_Chess/tests/Games_Chess/inCheckMate setup.php.inc
test1.phpt
test_bug7565.phpt
test_doublecheck.phpt
test_interposingpiece.phpt
test_kingcanmove.phpt
test_smotheredmate.phpt
/pear/Games_Chess/tests/Games_Chess/inStaleMate setup.php.inc
test1.phpt
test2.phpt
test_notstalemate.phpt
/pear/Games_Chess/tests/Games_Chess/interposeOrCapture
setup.php.inc
test_knightcheck_capture_impossible.phpt
test_knightcheck_capture_possible.phpt
test_piececheck_capture_impossible.phpt
test_piececheck_capture_possible.phpt
test_piececheck_interpose_possible.phpt
/pear/Games_Chess/tests/Games_Chess/moveAlgebraic setup.php.inc
test_capture.phpt
test_simple.phpt
/pear/Games_Chess/tests/Games_Chess/movePiece setup.php.inc
test_pawn.phpt
test_piece.phpt
test_promotedpiece.phpt
/pear/Games_Chess/tests/Games_Chess/moveSAN setup.php.inc
test_castlekb.phpt
test_castlekw.phpt
test_castleqb.phpt
test_castleqw.phpt
test_invalidpawnmove.phpt
test_invalidpiecemove.phpt
test_moveking.phpt
test_moverook.phpt
test_pawncapture1.phpt
test_pawncapture2.phpt
test_pawnmove1.phpt
test_pawnmove2.phpt
test_piececapture1.phpt
test_piecemove1.phpt
test_piecemove2.phpt
/pear/Games_Chess/tests/Games_Chess/parseFen setup.php.inc
test_invalid1.phpt
test_invalid10.phpt
test_invalid11.phpt
test_invalid12.phpt
test_invalid13.phpt
test_invalid2.phpt
test_invalid3.phpt
test_invalid4.phpt
test_invalid5.phpt
test_invalid6.phpt
test_invalid7.phpt
test_invalid8.phpt
test_invalid9.phpt
test_valid1.phpt
test_valid2.phpt
test_valid_fenboard1.phpt
test_valid_fenboard2.phpt
test_valid_fenboard3.phpt
test_valid_fenboard4.phpt
Removed files:
/pear/Games_Chess/tests
Games_Chess_TestCase_getPossibleRookMoves.php
Games_Chess_TestCase_getRookSquares.php
Games_Chess_TestCase_getSquareFromParsedMove.php
Games_Chess_TestCase_inBasicDraw.php
Games_Chess_TestCase_inCheckMate.php
Games_Chess_TestCase_inStaleMate.php
Games_Chess_TestCase_interposeOrCapture.php
Games_Chess_TestCase_moveAlgebraic.php
Games_Chess_TestCase_movePiece.php
Games_Chess_TestCase_moveSAN.php
Games_Chess_TestCase_parseFen.php
Log:
continue transition to .phpt
http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_color.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_color.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_color.phpt --TEST-- Games_Chess->getPossibleRookMoves() invalid color --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->getPossibleRookMoves('a1', 'Q'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => '"Q" is not a valid piece color, try W or B') ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_square.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_square.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_square.phpt --TEST-- Games_Chess->getPossibleRookMoves() invalid square --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->getPossibleRookMoves('a9', 'B'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => '"a9" is not a valid square, must be between a1 and h8') ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b1.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b1.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid black #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b8', 'B'); $phpunit->assertEquals(array(), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b2.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b2.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid black #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b7', 'B'); $phpunit->assertEquals(array('b6', 'b5', 'b4', 'b3', 'b2'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b3.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b3.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid black #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('e4', 'B'); $phpunit->assertEquals(array('e5', 'e6', 'f4', 'g4', 'h4', 'e3', 'e2', 'd4', 'c4', 'b4', 'a4'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w1.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w1.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid white #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b1', 'W'); $phpunit->assertEquals(array(), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w2.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w2.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid white #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b2', 'W'); $phpunit->assertEquals(array('b3', 'b4', 'b5', 'b6', 'b7'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w3.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w3.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid white #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('e4', 'W'); $phpunit->assertEquals(array('e5', 'e6', 'e7', 'f4', 'g4', 'h4', 'e3', 'd4', 'c4', 'b4', 'a4'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a1.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a1.phpt --TEST-- Games_Chess->getRookSquares() a1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('a1'); $phpunit->assertEquals(false, $ret['S'], 'South should not exist'); $phpunit->assertEquals(false, $ret['W'], 'West should not exist'); $phpunit->assertEquals(array('a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8'), $ret['N'], 'North should contain some RookSquares'); $phpunit->assertEquals(array('b1', 'c1', 'd1', 'e1', 'f1', 'g1', 'h1'), $ret['E'], 'East should contain some RookSquares'); $ret = $board->_getRookSquares('a1', true); $phpunit->assertEquals(array('a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'b1', 'c1', 'd1', 'e1', 'f1', 'g1', 'h1'), $ret, 'simple array'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a8.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a8.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a8.phpt --TEST-- Games_Chess->getRookSquares() a8 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('a8'); $phpunit->assertEquals(false, $ret['W'], 'West should not exist'); $phpunit->assertEquals(false, $ret['N'], 'North should not exist'); $phpunit->assertEquals(array('a7', 'a6', 'a5', 'a4', 'a3', 'a2', 'a1'), $ret['S'], 'South should contain some RookSquares'); $phpunit->assertEquals(array('b8', 'c8', 'd8', 'e8', 'f8', 'g8', 'h8'), $ret['E'], 'East should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_e4.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_e4.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_e4.phpt --TEST-- Games_Chess->getRookSquares() e4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('e4'); $phpunit->assertEquals(array('d4', 'c4', 'b4', 'a4'), $ret['W'], 'West should should contain some RookSquares'); $phpunit->assertEquals(array('f4', 'g4', 'h4'), $ret['E'], 'East should contain some RookSquares'); $phpunit->assertEquals(array('e5', 'e6', 'e7', 'e8'), $ret['N'], 'North should should contain some RookSquares'); $phpunit->assertEquals(array('e3', 'e2', 'e1'), $ret['S'], 'South should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h1.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h1.phpt --TEST-- Games_Chess->getRookSquares() h1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('h1'); $phpunit->assertEquals(false, $ret['E'], 'East should not exist'); $phpunit->assertEquals(false, $ret['S'], 'South should not exist'); $phpunit->assertEquals(array('h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8'), $ret['N'], 'South should contain some RookSquares'); $phpunit->assertEquals(array('g1', 'f1', 'e1', 'd1', 'c1', 'b1', 'a1'), $ret['W'], 'West should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h8.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h8.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h8.phpt --TEST-- Games_Chess->getRookSquares() h8 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('h8'); $phpunit->assertEquals(false, $ret['E'], 'East should not exist'); $phpunit->assertEquals(false, $ret['N'], 'North should not exist'); $phpunit->assertEquals(array('h7', 'h6', 'h5', 'h4', 'h3', 'h2', 'h1'), $ret['S'], 'South should contain some RookSquares'); $phpunit->assertEquals(array('g8', 'f8', 'e8', 'd8', 'c8', 'b8', 'a8'), $ret['W'], 'West should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous1.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous1.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() ambiguous Q6h4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'h6'); $a = $board->_parseMove('Q6h4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h6', $err, 'wrong queen square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous2.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous2.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() ambiguous Qhh4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'e4'); $a = $board->_parseMove('Qhh4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h2', $err, 'wrong queen square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous3.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous3.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() ambiguous Qaa2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'e4'); $board->addPiece('W', 'Q', 'a1'); $a = $board->_parseMove('Qaa2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('a1', $err, 'wrong queen square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getking.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getking.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getking.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() get king square --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PPP/RNB1KBNR w KQkq - 2 6'); $a = $board->_parseMove('Kd1'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('e1', $err, 'wrong king square'); $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PPP/RNB1KBNR b KQkq - 2 6'); $a = $board->_parseMove('Kf7'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('e8', $err, 'wrong king square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getsimple.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getsimple.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getsimple.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() simple move tests --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PP1/RNB1KBNR w KQkq - 2 6'); $a = $board->_parseMove('Qh4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h5', $err, 'wrong queen square'); $a = $board->_parseMove('Nf3'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('g1', $err, 'wrong knight square'); $a = $board->_parseMove('Be2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('f1', $err, 'wrong bishop square'); $board->_pieces['WP8'] = false; $a = $board->_parseMove('Rh2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h1', $err, 'wrong rook square'); $a = $board->_parseMove('Ke2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('e1', $err, 'wrong king square'); $a = $board->_parseMove('g4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('g2', $err, 'wrong pawn square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous1.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous1.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() invalid ambiguous Qh4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'e4'); $a = $board->_parseMove('Qh4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertErrors( array('package' => 'PEAR_Error', 'message' => '"Qh4" does not resolve ambiguity between Queens on h2 e4') , 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous2.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous2.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() invalid Ka1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $a = $board->_parseMove('Ka1'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertErrors( array('package' => 'PEAR_Error', 'message' => 'There are no White pieces on the board that can do "Ka1"') , 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kingsonly.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kingsonly.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kingsonly.phpt --TEST-- Games_Chess->inBasicDraw() only 2 kings on the board --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'K', 'h7'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkb.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkb.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkb.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/bishop --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'K', 'h7'); $board->addPiece('B', 'B', 'e4'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_invalid.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_invalid.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_invalid.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/2 bishops, not a draw --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('B', 'K', 'a8'); $board->addPiece('B', 'B', 'h1'); $phpunit->assertFalse($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_valid.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_valid.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_valid.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/2 bishops, valid draw --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('B', 'K', 'h1'); $board->addPiece('B', 'B', 'h2'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkn.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkn.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkn.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/knight --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'K', 'h7'); $board->addPiece('B', 'N', 'e4'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw1.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw1.phpt --TEST-- Games_Chess->inBasicDraw() not a basic draw #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('W', 'B', 'b1'); $board->addPiece('B', 'K', 'h8'); $board->addPiece('B', 'B', 'h1'); $phpunit->assertFalse($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw2.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw2.phpt --TEST-- Games_Chess->inBasicDraw() not a basic draw #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('B', 'B', 'b1'); $board->addPiece('B', 'K', 'h8'); $board->addPiece('B', 'B', 'h1'); $phpunit->assertFalse($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test1.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test1.phpt --TEST-- Games_Chess->inCheckMate() valid checkmate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PPP/RNB1KBNR b KQkq - 2 6'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_bug7565.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_bug7565.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_bug7565.phpt --TEST-- Games_Chess->inCheckMate() Bug #7565 - checkmate because of pinned interposing piece --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('1r2k3/p1pbb1p1/2p5/5p1r/N1Q5/5N2/PPP2PPP/R3R1K1 w - - 2 20'); $board->moveSAN('Qg8'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_doublecheck.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_doublecheck.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_doublecheck.phpt --TEST-- Games_Chess->inCheckMate() double check checkmate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('B', 'R', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'g8'); // add a piece that could interpose if it weren't double check $board->addPiece('B', 'B', 'e8'); $board->addPiece('W', 'R', 'f1'); $board->addPiece('W', 'N', 'e7'); $board->addpiece('W', 'B', 'e4'); $board->addPiece('W', 'R', 'g1'); $board->addPiece('W', 'K', 'a1'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_interposingpiece.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_interposingpiece.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_interposingpiece.phpt --TEST-- Games_Chess->inCheckMate() interposing piece stops checkmate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('B', 'R', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'g8'); // add a piece that can interpose $board->addPiece('B', 'B', 'e8'); $board->addPiece('W', 'R', 'f1'); $board->addpiece('W', 'B', 'e4'); $board->addPiece('W', 'R', 'g1'); $board->addPiece('W', 'K', 'a1'); $phpunit->assertFalse($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_kingcanmove.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_kingcanmove.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_kingcanmove.phpt --TEST-- Games_Chess->inCheckMate() king can move out of check --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('B', 'R', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'g8'); $board->addPiece('W', 'R', 'f1'); $board->addPiece('W', 'R', 'g1'); $board->addPiece('W', 'K', 'a1'); $phpunit->assertFalse($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_smotheredmate.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_smotheredmate.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_smotheredmate.phpt --TEST-- Games_Chess->inCheckMate() smothered mate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'N', 'f7'); $board->addPiece('B', 'K', 'h8'); $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'P', 'h7'); $board->addPiece('B', 'P', 'g7'); $board->addPiece('B', 'R', 'g8'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/test1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/test1.phpt +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/test1.phpt --TEST-- Games_Chess->inStaleMate() pieces are pinned, causing stalemate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e8'); $board->addPiece('B', 'R', 'a8'); $board->addPiece('W', 'N', 'd8'); $board->addPiece('W', 'P', 'd7'); $board->addPiece('W', 'P', 'e7'); $board->addPiece('W', 'P', 'f7'); $board->addPiece('W', 'B', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'e1'); $phpunit->assertTrue($board->inStaleMate('W'), 'W'); $phpunit->assertFalse($board->inStaleMate('B'), 'B'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/test2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/test2.phpt +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/test2.phpt --TEST-- Games_Chess->inStaleMate() no pieces can move, stalemate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'P', 'g4'); $board->addPiece('B', 'P', 'g5'); $board->addPiece('W', 'P', 'g3'); $board->addPiece('W', 'K', 'h3'); $board->addPiece('W', 'P', 'h2'); $board->addPiece('W', 'P', 'g2'); $board->addPiece('B', 'K', 'e8'); $phpunit->assertTrue($board->inStaleMate('W'), 'W'); $phpunit->assertFalse($board->inStaleMate('B'), 'B'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/test_notstalemate.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/test_notstalemate.phpt +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/test_notstalemate.phpt --TEST-- Games_Chess->inStaleMate() 1 piece can move, not stalemate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'P', 'g4'); $board->addPiece('B', 'P', 'g5'); $board->addPiece('W', 'P', 'g3'); $board->addPiece('W', 'K', 'h3'); // add a piece that can move $board->addPiece('W', 'P', 'h5'); $board->addPiece('W', 'P', 'h2'); $board->addPiece('W', 'P', 'g2'); $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse($board->inStaleMate('W'), 'W'); $phpunit->assertFalse($board->inStaleMate('B'), 'B'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_impossible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_impossible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_impossible.phpt --TEST-- Games_Chess->_interposeOrCapture() knight check, capture impossible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'N', 'd2'); $board->addPiece('W', 'Q', 'h5'); $phpunit->assertFalse($board->_interposeOrCapture( $board->_getPathToKing('d2', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_possible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_possible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_possible.phpt --TEST-- Games_Chess->_interposeOrCapture() knight check, capture possible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'N', 'd2'); $board->addPiece('W', 'Q', 'h6'); $phpunit->assertTrue($board->_interposeOrCapture( $board->_getPathToKing('d2', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_impossible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_impossible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_impossible.phpt --TEST-- Games_Chess->_interposeOrCapture() piece check, capture impossible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'B', 'c2'); $board->addPiece('W', 'Q', 'h1'); $phpunit->assertFalse($board->_interposeOrCapture( $board->_getPathToKing('b1', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_possible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_possible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_possible.phpt --TEST-- Games_Chess->_interposeOrCapture() piece check, capture possible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'B', 'b1'); $board->addPiece('W', 'Q', 'h1'); $phpunit->assertTrue($board->_interposeOrCapture( $board->_getPathToKing('b1', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_interpose_possible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_interpose_possible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_interpose_possible.phpt --TEST-- Games_Chess->_interposeOrCapture() piece check, interpose possible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'B', 'b1'); $board->addPiece('W', 'Q', 'h2'); $phpunit->assertTrue($board->_interposeOrCapture( $board->_getPathToKing('b1', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveAlgebraic/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveAlgebraic/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/moveAlgebraic/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_capture.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_capture.phpt +++ pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_capture.phpt --TEST-- Games_Chess->_moveAlgebraic() capture --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $board->addPiece('B', 'B', 'h7'); $phpunit->assertEquals('e4', $board->_pieces['WB1'], 'setup test 1'); $phpunit->assertEquals('WB1', $board->_board['e4'], 'setup test 2'); $phpunit->assertEquals('BB1', $board->_board['h7'], 'setup test 3'); $phpunit->assertEquals('h7', $board->_pieces['BB1'], 'setup test 4'); $board->_moveAlgebraic('e4', 'h7'); $phpunit->assertEquals('h7', $board->_pieces['WB1'], 'move test 1'); $phpunit->assertEquals('e4', $board->_board['e4'], 'move test 2'); $phpunit->assertEquals('WB1', $board->_board['h7'], 'move test 3'); $phpunit->assertFalse($board->_pieces['BB1'], 'move test 4'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_simple.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_simple.phpt +++ pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_simple.phpt --TEST-- Games_Chess->_moveAlgebraic() simple move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $phpunit->assertEquals('e4', $board->_pieces['WB1'], 'setup test 1'); $phpunit->assertEquals('WB1', $board->_board['e4'], 'setup test 2'); $phpunit->assertEquals('h7', $board->_board['h7'], 'setup test 3'); $board->_moveAlgebraic('e4', 'h7'); $phpunit->assertEquals('h7', $board->_pieces['WB1'], 'move test 1'); $phpunit->assertEquals('e4', $board->_board['e4'], 'move test 2'); $phpunit->assertEquals('WB1', $board->_board['h7'], 'move test 3'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/movePiece/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/test_pawn.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/test_pawn.phpt +++ pear/Games_Chess/tests/Games_Chess/movePiece/test_pawn.phpt --TEST-- Games_Chess->_movePiece() pawn move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'P', 'e4'); $phpunit->assertEquals(array('e4', 'P'), $board->_pieces['WP1'], 'setup test'); $board->_movePiece('e4', 'e5'); $phpunit->assertEquals(array('e5', 'P'), $board->_pieces['WP1'], 'move test'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/test_piece.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/test_piece.phpt +++ pear/Games_Chess/tests/Games_Chess/movePiece/test_piece.phpt --TEST-- Games_Chess->_movePiece() piece move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $phpunit->assertEquals('e4', $board->_pieces['WB1'], 'setup test'); $board->_movePiece('e4', 'h7'); $phpunit->assertEquals('h7', $board->_pieces['WB1'], 'move test'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/test_promotedpiece.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/test_promotedpiece.phpt +++ pear/Games_Chess/tests/Games_Chess/movePiece/test_promotedpiece.phpt --TEST-- Games_Chess->_movePiece() promoted piece move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $board->addPiece('W', 'B', 'e5'); $board->addPiece('W', 'B', 'e6'); $phpunit->assertEquals(array('e6', 'B'), $board->_pieces['WP1'], 'setup test'); $board->_movePiece('e6', 'd5'); $phpunit->assertEquals(array('d5', 'B'), $board->_pieces['WP1'], 'move test'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/moveSAN/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekb.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekb.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekb.phpt --TEST-- Games_Chess->moveSAN() castling kingside (black) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $board->_move = 'B'; $err = $board->addPiece('B', 'R', 'h8'); $phpunit->assertFalse(is_object($err), 'adding B rook failed'); $err = $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse(is_object($err), 'adding B king failed'); $err = $board->moveSAN('O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekw.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekw.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekw.phpt --TEST-- Games_Chess->moveSAN() castling kingside (white) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'R', 'h1'); $phpunit->assertFalse(is_object($err), 'adding W rook failed'); $err = $board->addPiece('W', 'K', 'e1'); $phpunit->assertFalse(is_object($err), 'adding W king failed'); $err = $board->moveSAN('O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqb.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqb.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqb.phpt --TEST-- Games_Chess->moveSAN() castling queenside (white) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $board->_move = 'B'; $err = $board->addPiece('B', 'R', 'a8'); $phpunit->assertFalse(is_object($err), 'adding B rook failed'); $err = $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse(is_object($err), 'adding B king failed'); $err = $board->moveSAN('O-O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqw.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqw.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqw.phpt --TEST-- Games_Chess->moveSAN() castling queenside (white) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'R', 'a1'); $phpunit->assertFalse(is_object($err), 'adding W rook failed'); $err = $board->addPiece('W', 'K', 'e1'); $phpunit->assertFalse(is_object($err), 'adding W king failed'); $err = $board->moveSAN('O-O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpawnmove.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpawnmove.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpawnmove.phpt --TEST-- Games_Chess->moveSAN() invalid pawn move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $err = $board->addPiece('W', 'P', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W pawn failed'); $err = $board->moveSAN('exd5'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'There are no White pieces on the board that can do "exd5"') ), 'wrong message'); $phpunit->assertEquals(6, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpiecemove.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpiecemove.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpiecemove.phpt --TEST-- Games_Chess->moveSAN() invalid piece move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('B', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W knight failed'); $err = $board->moveSAN('Nxf6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'There is no piece on square f6', )), 'wrong message'); $phpunit->assertEquals(6, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('e3', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_moveking.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_moveking.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_moveking.phpt --TEST-- Games_Chess->moveSAN() move king --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $err = $board->addPiece('W', 'K', 'e1'); $phpunit->assertFalse(is_object($err), 'adding W king failed'); $err = $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse(is_object($err), 'adding B king failed'); $err = $board->moveSAN('Ke2'); $phpunit->assertFalse(is_object($err), 'moving W king failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared'); $board->_WCastleQ = $board->_WCastleK = true; $err = $board->moveSAN('Ke7'); $phpunit->assertFalse(is_object($err), 'moving B king failed'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_moverook.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_moverook.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_moverook.phpt --TEST-- Games_Chess->moveSAN() move rook --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $err = $board->addPiece('W', 'R', 'a1'); $phpunit->assertFalse(is_object($err), 'adding W rook 1 failed'); $err = $board->moveSAN('Ra3'); $phpunit->assertFalse(is_object($err), 'moving W rook 1 failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared 1'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared 1'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared 1'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared 1'); $board->_QCastleW = $board->_QCastleB = true; $board->_KCastleW = $board->_KCastleB = true; $board->resetGame(); $board->blankBoard(); $err = $board->addPiece('W', 'R', 'h1'); $phpunit->assertFalse(is_object($err), 'adding W rook 2 failed'); $err = $board->moveSAN('Rh8'); $phpunit->assertFalse(is_object($err), 'moving W rook 2 failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared 2'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared 2'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared 2'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared 2'); $board->resetGame(); $board->blankBoard(); $board->_move = 'B'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $err = $board->addPiece('B', 'R', 'a8'); $phpunit->assertFalse(is_object($err), 'adding B rook 1 failed'); $err = $board->addPiece('B', 'R', 'h8'); $phpunit->assertFalse(is_object($err), 'adding B rook 2 failed'); $err = $board->moveSAN('Ra6'); $phpunit->assertFalse(is_object($err), 'moving B rook 1 failed'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared 3'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared 3'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared 3'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared 3'); $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_move = 'B'; $err = $board->moveSAN('Rh7'); $phpunit->assertFalse(is_object($err), 'moving B rook 2 failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared 4'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared 4'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared 4'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared 4'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture1.phpt --TEST-- Games_Chess->moveSAN() pawn capture #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'd6'; $err = $board->addPiece('W', 'P', 'e5'); $phpunit->assertFalse(is_object($err), 'adding W pawn failed'); $err = $board->addPiece('B', 'P', 'd5'); $phpunit->assertFalse(is_object($err), 'adding B pawn failed'); $err = $board->moveSAN('exd6'); $phpunit->assertFalse(is_object($err), 'capturing pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture2.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture2.phpt --TEST-- Games_Chess->moveSAN() pawn capture #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'P', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W pawn failed'); $err = $board->addPiece('B', 'P', 'd4'); $phpunit->assertFalse(is_object($err), 'adding B pawn failed'); $err = $board->moveSAN('dxe3'); $phpunit->assertFalse(is_object($err), 'capturing pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove1.phpt --TEST-- Games_Chess->moveSAN() pawn move #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'e6'; $err = $board->addPiece('W', 'P', 'e4'); $phpunit->assertFalse(is_object($err), 'adding pawn failed'); $err = $board->moveSAN('e5'); $phpunit->assertFalse(is_object($err), 'moving pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove2.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove2.phpt --TEST-- Games_Chess->moveSAN() pawn move #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'e6'; $err = $board->addPiece('W', 'P', 'e2'); $phpunit->assertFalse(is_object($err), 'adding pawn failed'); $err = $board->moveSAN('e4'); $phpunit->assertFalse(is_object($err), 'moving pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('e3', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_piececapture1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_piececapture1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_piececapture1.phpt --TEST-- Games_Chess->moveSAN() piece capture #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('B', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding B knight failed'); $err = $board->addPiece('W', 'N', 'f6'); $phpunit->assertFalse(is_object($err), 'adding w knight failed'); $err = $board->moveSAN('Nxf6'); $phpunit->assertFalse(is_object($err), 'capturing knight failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove1.phpt --TEST-- Games_Chess->moveSAN() piece move #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W knight failed'); $err = $board->moveSAN('Nf6'); $phpunit->assertFalse(is_object($err), 'moving knight failed'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove2.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove2.phpt --TEST-- Games_Chess->moveSAN() piece move #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('B', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W knight failed'); $err = $board->moveSAN('Nf6'); $phpunit->assertFalse(is_object($err), 'moving knight failed'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/parseFen/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); class Games_Chess_testStandard extends Games_Chess_Standard { var $pieces = array(); function addPiece($color, $type, $square) { $this->pieces[] = array($color, $type, $square); } } http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid1.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid1.phpt --TEST-- Games_Chess->_parseFen() invalid #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('hello'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "hello" has 1 fields, 6 is required'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid10.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid10.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid10.phpt --TEST-- Games_Chess->_parseFen() invalid #10 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - a 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - a 6" the half-move ply count "a" is not a number'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid11.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid11.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid11.phpt --TEST-- Games_Chess->_parseFen() invalid #11 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 a'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 a" the move number "a" is not a number'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid12.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid12.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid12.phpt --TEST-- Games_Chess->_parseFen() invalid #12 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkppp/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 5'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkppp/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 5" Too many Black Pawns'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid13.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid13.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid13.phpt --TEST-- Games_Chess->_parseFen() invalid #13 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQk d1 0 1'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQk d1 0 1" the en passant square indicator "d1" is invalid'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid2.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid2.phpt --TEST-- Games_Chess->_parseFen() invalid #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('1 2 3 4 5'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "1 2 3 4 5" has an empty field at index 4'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid3.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid3.phpt --TEST-- Games_Chess->_parseFen() invalid #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('1$ 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "1$ 2 3 4 5 6" the character "$" is not a valid piece, separator or number'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid4.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid4.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid4.phpt --TEST-- Games_Chess->_parseFen() invalid #4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('RKQBPRNNRQ 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "RKQBPRNNRQ 2 3 4 5 6" has too many pieces for a chessboard'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid5.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid5.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid5.phpt --TEST-- Games_Chess->_parseFen() invalid #5 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('RKQBPRNN/RQ 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "RKQBPRNN/RQ 2 3 4 5 6" has too few pieces for a chessboard'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid6.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid6.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid6.phpt --TEST-- Games_Chess->_parseFen() invalid #6 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR 2 3 4 5 6" has invalid to-move indicator, must be "w" or "b"'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid7.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid7.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid7.phpt --TEST-- Games_Chess->_parseFen() invalid #7 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKQKQ 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKQKQ 4 5 6" the castling indicator (KQkq) is too long'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid8.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid8.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid8.phpt --TEST-- Games_Chess->_parseFen() invalid #8 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKqw 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKqw 4 5 6" the castling indicator "w" is invalid'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid9.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid9.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid9.phpt --TEST-- Games_Chess->_parseFen() invalid #9 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq 4 5 6" the en passant square indicator "4" is invalid'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid1.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid1.phpt --TEST-- Games_Chess->_parseFen() valid #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQk d3 0 1'); $phpunit->assertSame(true, $err, 'not valid parse'); $phpunit->assertTrue($board->_WCastleQ, '_WCastleQ'); $phpunit->assertTrue($board->_WCastleK, '_WCastleK'); $phpunit->assertFalse(false, $board->_BCastleQ, '_BCastleQ'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK'); $phpunit->assertEquals('B', $board->_move, 'move'); $phpunit->assertEquals('d3', $board->_enPassantSquare, 'wrong en passant'); $phpunit->assertEquals('0', $board->_halfMoves, 'wrong ply count'); $phpunit->assertEquals('1', $board->_moveNumber, 'wrong ply count'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid2.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid2.phpt --TEST-- Games_Chess->_parseFen() valid #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Kkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 1'); $phpunit->assertTrue($board->_WCastleK, '_WCastleK 1'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 1'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK 1'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertTrue($board->_WCastleQ, '_WCastleQ 2'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 2'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 2'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK 2'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w kq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 3'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 3'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 3'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK 3'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w q d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 4'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 4'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 4'); $phpunit->assertFalse($board->_BCastleK, '_BCastleK 4'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w - d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 5'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 5'); $phpunit->assertFalse($board->_BCastleQ, '_BCastleQ 5'); $phpunit->assertFalse($board->_BCastleK, '_BCastleK 5'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard1.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard1.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $newboard = new Games_Chess_testStandard; $err = $newboard->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( array('B', 'R', 'a8'), array('B', 'N', 'b8'), array('B', 'B', 'c8'), array('B', 'Q', 'd8'), array('B', 'K', 'e8'), array('B', 'B', 'f8'), array('B', 'N', 'g8'), array('B', 'R', 'h8'), array('B', 'P', 'a7'), array('B', 'P', 'b7'), array('B', 'P', 'c7'), array('B', 'P', 'd7'), array('B', 'P', 'e7'), array('B', 'P', 'f7'), array('B', 'P', 'g7'), array('B', 'P', 'h7'), array('W', 'P', 'a2'), array('W', 'P', 'b2'), array('W', 'P', 'c2'), array('W', 'P', 'd2'), array('W', 'P', 'e2'), array('W', 'P', 'f2'), array('W', 'P', 'g2'), array('W', 'P', 'h2'), array('W', 'R', 'a1'), array('W', 'N', 'b1'), array('W', 'B', 'c1'), array('W', 'Q', 'd1'), array('W', 'K', 'e1'), array('W', 'B', 'f1'), array('W', 'N', 'g1'), array('W', 'R', 'h1'), ), $newboard->pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard2.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard2.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $newboard = new Games_Chess_testStandard; $err = $newboard->_parseFen('rnbqkbn1/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( array('B', 'R', 'a8'), array('B', 'N', 'b8'), array('B', 'B', 'c8'), array('B', 'Q', 'd8'), array('B', 'K', 'e8'), array('B', 'B', 'f8'), array('B', 'N', 'g8'), array('B', 'P', 'a7'), array('B', 'P', 'b7'), array('B', 'P', 'c7'), array('B', 'P', 'd7'), array('B', 'P', 'e7'), array('B', 'P', 'f7'), array('B', 'P', 'g7'), array('B', 'P', 'h7'), array('W', 'P', 'a2'), array('W', 'P', 'b2'), array('W', 'P', 'c2'), array('W', 'P', 'd2'), array('W', 'P', 'e2'), array('W', 'P', 'f2'), array('W', 'P', 'g2'), array('W', 'P', 'h2'), array('W', 'R', 'a1'), array('W', 'N', 'b1'), array('W', 'B', 'c1'), array('W', 'Q', 'd1'), array('W', 'K', 'e1'), array('W', 'B', 'f1'), array('W', 'N', 'g1'), array('W', 'R', 'h1'), ), $newboard->pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard3.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard3.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $newboard = new Games_Chess_testStandard; $err = $newboard->_parseFen('rnbqkbn1/pppppppp/5r2/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( array('B', 'R', 'a8'), array('B', 'N', 'b8'), array('B', 'B', 'c8'), array('B', 'Q', 'd8'), array('B', 'K', 'e8'), array('B', 'B', 'f8'), array('B', 'N', 'g8'), array('B', 'P', 'a7'), array('B', 'P', 'b7'), array('B', 'P', 'c7'), array('B', 'P', 'd7'), array('B', 'P', 'e7'), array('B', 'P', 'f7'), array('B', 'P', 'g7'), array('B', 'P', 'h7'), array('B', 'R', 'f6'), array('W', 'P', 'a2'), array('W', 'P', 'b2'), array('W', 'P', 'c2'), array('W', 'P', 'd2'), array('W', 'P', 'e2'), array('W', 'P', 'f2'), array('W', 'P', 'g2'), array('W', 'P', 'h2'), array('W', 'R', 'a1'), array('W', 'N', 'b1'), array('W', 'B', 'c1'), array('W', 'Q', 'd1'), array('W', 'K', 'e1'), array('W', 'B', 'f1'), array('W', 'N', 'g1'), array('W', 'R', 'h1'), ), $newboard->pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard4.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard4.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard4.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->_parseFen('rnbqkbn1/pppppppp/5r2/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( 'WR1' => 'a1', 'WN1' => 'b1', 'WB1' => 'c1', 'WQ' => 'd1', 'WK' => 'e1', 'WB2' => 'f1', 'WN2' => 'g1', 'WR2' => 'h1', 'WP1' => array('a2','P'), 'WP2' => array('b2','P'), 'WP3' => array('c2','P'), 'WP4' => array('d2','P'), 'WP5' => array('e2','P'), 'WP6' => array('f2','P'), 'WP7' => array('g2','P'), 'WP8' => array('h2','P'), 'BP1' => array('a7','P'), 'BP2' => array('b7','P'), 'BP3' => array('c7','P'), 'BP4' => array('d7','P'), 'BP5' => array('e7','P'), 'BP6' => array('f7','P'), 'BP7' => array('g7','P'), 'BP8' => array('h7','P'), 'BR1' => 'a8', 'BN1' => 'b8', 'BB1' => 'c8', 'BQ' => 'd8', 'BK' => 'e8', 'BB2' => 'f8', 'BN2' => 'g8', 'BR2' => 'f6', ), $board->_pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done
http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_color.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_color.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_color.phpt --TEST-- Games_Chess->getPossibleRookMoves() invalid color --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->getPossibleRookMoves('a1', 'Q'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => '"Q" is not a valid piece color, try W or B') ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_square.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_square.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_invalid_square.phpt --TEST-- Games_Chess->getPossibleRookMoves() invalid square --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->getPossibleRookMoves('a9', 'B'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => '"a9" is not a valid square, must be between a1 and h8') ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b1.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b1.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid black #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b8', 'B'); $phpunit->assertEquals(array(), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b2.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b2.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid black #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b7', 'B'); $phpunit->assertEquals(array('b6', 'b5', 'b4', 'b3', 'b2'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b3.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_b3.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid black #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('e4', 'B'); $phpunit->assertEquals(array('e5', 'e6', 'f4', 'g4', 'h4', 'e3', 'e2', 'd4', 'c4', 'b4', 'a4'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w1.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w1.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid white #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b1', 'W'); $phpunit->assertEquals(array(), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w2.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w2.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid white #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('b2', 'W'); $phpunit->assertEquals(array('b3', 'b4', 'b5', 'b6', 'b7'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w3.phpt +++ pear/Games_Chess/tests/Games_Chess/getPossibleRookMoves/test_valid_w3.phpt --TEST-- Games_Chess->getPossibleRookMoves() valid white #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame(); $err = $board->getPossibleRookMoves('e4', 'W'); $phpunit->assertEquals(array('e5', 'e6', 'e7', 'f4', 'g4', 'h4', 'e3', 'd4', 'c4', 'b4', 'a4'), $err, 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a1.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a1.phpt --TEST-- Games_Chess->getRookSquares() a1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('a1'); $phpunit->assertEquals(false, $ret['S'], 'South should not exist'); $phpunit->assertEquals(false, $ret['W'], 'West should not exist'); $phpunit->assertEquals(array('a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8'), $ret['N'], 'North should contain some RookSquares'); $phpunit->assertEquals(array('b1', 'c1', 'd1', 'e1', 'f1', 'g1', 'h1'), $ret['E'], 'East should contain some RookSquares'); $ret = $board->_getRookSquares('a1', true); $phpunit->assertEquals(array('a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'b1', 'c1', 'd1', 'e1', 'f1', 'g1', 'h1'), $ret, 'simple array'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a8.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a8.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_a8.phpt --TEST-- Games_Chess->getRookSquares() a8 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('a8'); $phpunit->assertEquals(false, $ret['W'], 'West should not exist'); $phpunit->assertEquals(false, $ret['N'], 'North should not exist'); $phpunit->assertEquals(array('a7', 'a6', 'a5', 'a4', 'a3', 'a2', 'a1'), $ret['S'], 'South should contain some RookSquares'); $phpunit->assertEquals(array('b8', 'c8', 'd8', 'e8', 'f8', 'g8', 'h8'), $ret['E'], 'East should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_e4.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_e4.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_e4.phpt --TEST-- Games_Chess->getRookSquares() e4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('e4'); $phpunit->assertEquals(array('d4', 'c4', 'b4', 'a4'), $ret['W'], 'West should should contain some RookSquares'); $phpunit->assertEquals(array('f4', 'g4', 'h4'), $ret['E'], 'East should contain some RookSquares'); $phpunit->assertEquals(array('e5', 'e6', 'e7', 'e8'), $ret['N'], 'North should should contain some RookSquares'); $phpunit->assertEquals(array('e3', 'e2', 'e1'), $ret['S'], 'South should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h1.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h1.phpt --TEST-- Games_Chess->getRookSquares() h1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('h1'); $phpunit->assertEquals(false, $ret['E'], 'East should not exist'); $phpunit->assertEquals(false, $ret['S'], 'South should not exist'); $phpunit->assertEquals(array('h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8'), $ret['N'], 'South should contain some RookSquares'); $phpunit->assertEquals(array('g1', 'f1', 'e1', 'd1', 'c1', 'b1', 'a1'), $ret['W'], 'West should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h8.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h8.phpt +++ pear/Games_Chess/tests/Games_Chess/getRookSquares/test_h8.phpt --TEST-- Games_Chess->getRookSquares() h8 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $ret = $board->_getRookSquares('h8'); $phpunit->assertEquals(false, $ret['E'], 'East should not exist'); $phpunit->assertEquals(false, $ret['N'], 'North should not exist'); $phpunit->assertEquals(array('h7', 'h6', 'h5', 'h4', 'h3', 'h2', 'h1'), $ret['S'], 'South should contain some RookSquares'); $phpunit->assertEquals(array('g8', 'f8', 'e8', 'd8', 'c8', 'b8', 'a8'), $ret['W'], 'West should contain some RookSquares'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous1.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous1.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() ambiguous Q6h4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'h6'); $a = $board->_parseMove('Q6h4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h6', $err, 'wrong queen square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous2.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous2.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() ambiguous Qhh4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'e4'); $a = $board->_parseMove('Qhh4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h2', $err, 'wrong queen square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous3.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_ambiguous3.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() ambiguous Qaa2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'e4'); $board->addPiece('W', 'Q', 'a1'); $a = $board->_parseMove('Qaa2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('a1', $err, 'wrong queen square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getking.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getking.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getking.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() get king square --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PPP/RNB1KBNR w KQkq - 2 6'); $a = $board->_parseMove('Kd1'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('e1', $err, 'wrong king square'); $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PPP/RNB1KBNR b KQkq - 2 6'); $a = $board->_parseMove('Kf7'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('e8', $err, 'wrong king square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getsimple.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getsimple.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_getsimple.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() simple move tests --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PP1/RNB1KBNR w KQkq - 2 6'); $a = $board->_parseMove('Qh4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h5', $err, 'wrong queen square'); $a = $board->_parseMove('Nf3'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('g1', $err, 'wrong knight square'); $a = $board->_parseMove('Be2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('f1', $err, 'wrong bishop square'); $board->_pieces['WP8'] = false; $a = $board->_parseMove('Rh2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('h1', $err, 'wrong rook square'); $a = $board->_parseMove('Ke2'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('e1', $err, 'wrong king square'); $a = $board->_parseMove('g4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertEquals('g2', $err, 'wrong pawn square'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous1.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous1.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() invalid ambiguous Qh4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'Q', 'h2'); $board->addPiece('W', 'Q', 'e4'); $a = $board->_parseMove('Qh4'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertErrors( array('package' => 'PEAR_Error', 'message' => '"Qh4" does not resolve ambiguity between Queens on h2 e4') , 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous2.phpt +++ pear/Games_Chess/tests/Games_Chess/getSquareFromParsedMove/test_invalid_ambiguous2.phpt --TEST-- Games_Chess->_getSquareFromParsedMove() invalid Ka1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $a = $board->_parseMove('Ka1'); $err = $board->_getSquareFromParsedMove(current($a)); $phpunit->assertErrors( array('package' => 'PEAR_Error', 'message' => 'There are no White pieces on the board that can do "Ka1"') , 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kingsonly.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kingsonly.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kingsonly.phpt --TEST-- Games_Chess->inBasicDraw() only 2 kings on the board --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'K', 'h7'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkb.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkb.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkb.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/bishop --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'K', 'h7'); $board->addPiece('B', 'B', 'e4'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_invalid.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_invalid.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_invalid.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/2 bishops, not a draw --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('B', 'K', 'a8'); $board->addPiece('B', 'B', 'h1'); $phpunit->assertFalse($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_valid.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_valid.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkbb_valid.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/2 bishops, valid draw --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('B', 'K', 'h1'); $board->addPiece('B', 'B', 'h2'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkn.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkn.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_kkn.phpt --TEST-- Games_Chess->inBasicDraw() 2 kings/knight --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'K', 'h7'); $board->addPiece('B', 'N', 'e4'); $phpunit->assertTrue($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw1.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw1.phpt --TEST-- Games_Chess->inBasicDraw() not a basic draw #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('W', 'B', 'b1'); $board->addPiece('B', 'K', 'h8'); $board->addPiece('B', 'B', 'h1'); $phpunit->assertFalse($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw2.phpt +++ pear/Games_Chess/tests/Games_Chess/inBasicDraw/test_notdraw2.phpt --TEST-- Games_Chess->inBasicDraw() not a basic draw #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'a4'); $board->addPiece('W', 'B', 'a1'); $board->addPiece('B', 'B', 'b1'); $board->addPiece('B', 'K', 'h8'); $board->addPiece('B', 'B', 'h1'); $phpunit->assertFalse($board->inBasicDraw(), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test1.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test1.phpt --TEST-- Games_Chess->inCheckMate() valid checkmate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('rnbqkbnr/1pp1p2p/2P5/p2P1ppQ/8/8/PP1P1PPP/RNB1KBNR b KQkq - 2 6'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_bug7565.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_bug7565.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_bug7565.phpt --TEST-- Games_Chess->inCheckMate() Bug #7565 - checkmate because of pinned interposing piece --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->resetGame('1r2k3/p1pbb1p1/2p5/5p1r/N1Q5/5N2/PPP2PPP/R3R1K1 w - - 2 20'); $board->moveSAN('Qg8'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_doublecheck.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_doublecheck.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_doublecheck.phpt --TEST-- Games_Chess->inCheckMate() double check checkmate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('B', 'R', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'g8'); // add a piece that could interpose if it weren't double check $board->addPiece('B', 'B', 'e8'); $board->addPiece('W', 'R', 'f1'); $board->addPiece('W', 'N', 'e7'); $board->addpiece('W', 'B', 'e4'); $board->addPiece('W', 'R', 'g1'); $board->addPiece('W', 'K', 'a1'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_interposingpiece.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_interposingpiece.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_interposingpiece.phpt --TEST-- Games_Chess->inCheckMate() interposing piece stops checkmate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('B', 'R', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'g8'); // add a piece that can interpose $board->addPiece('B', 'B', 'e8'); $board->addPiece('W', 'R', 'f1'); $board->addpiece('W', 'B', 'e4'); $board->addPiece('W', 'R', 'g1'); $board->addPiece('W', 'K', 'a1'); $phpunit->assertFalse($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_kingcanmove.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_kingcanmove.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_kingcanmove.phpt --TEST-- Games_Chess->inCheckMate() king can move out of check --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('B', 'R', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'g8'); $board->addPiece('W', 'R', 'f1'); $board->addPiece('W', 'R', 'g1'); $board->addPiece('W', 'K', 'a1'); $phpunit->assertFalse($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inCheckMate/test_smotheredmate.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inCheckMate/test_smotheredmate.phpt +++ pear/Games_Chess/tests/Games_Chess/inCheckMate/test_smotheredmate.phpt --TEST-- Games_Chess->inCheckMate() smothered mate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'N', 'f7'); $board->addPiece('B', 'K', 'h8'); $board->addPiece('W', 'K', 'h2'); $board->addPiece('B', 'P', 'h7'); $board->addPiece('B', 'P', 'g7'); $board->addPiece('B', 'R', 'g8'); $phpunit->assertTrue($board->inCheckmate('B'), 'B'); $phpunit->assertFalse($board->inCheckmate('W'), 'W'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/test1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/test1.phpt +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/test1.phpt --TEST-- Games_Chess->inStaleMate() pieces are pinned, causing stalemate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e8'); $board->addPiece('B', 'R', 'a8'); $board->addPiece('W', 'N', 'd8'); $board->addPiece('W', 'P', 'd7'); $board->addPiece('W', 'P', 'e7'); $board->addPiece('W', 'P', 'f7'); $board->addPiece('W', 'B', 'f8'); $board->addPiece('B', 'R', 'h8'); $board->addPiece('B', 'K', 'e1'); $phpunit->assertTrue($board->inStaleMate('W'), 'W'); $phpunit->assertFalse($board->inStaleMate('B'), 'B'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/test2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/test2.phpt +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/test2.phpt --TEST-- Games_Chess->inStaleMate() no pieces can move, stalemate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'P', 'g4'); $board->addPiece('B', 'P', 'g5'); $board->addPiece('W', 'P', 'g3'); $board->addPiece('W', 'K', 'h3'); $board->addPiece('W', 'P', 'h2'); $board->addPiece('W', 'P', 'g2'); $board->addPiece('B', 'K', 'e8'); $phpunit->assertTrue($board->inStaleMate('W'), 'W'); $phpunit->assertFalse($board->inStaleMate('B'), 'B'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/inStaleMate/test_notstalemate.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/inStaleMate/test_notstalemate.phpt +++ pear/Games_Chess/tests/Games_Chess/inStaleMate/test_notstalemate.phpt --TEST-- Games_Chess->inStaleMate() 1 piece can move, not stalemate --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'P', 'g4'); $board->addPiece('B', 'P', 'g5'); $board->addPiece('W', 'P', 'g3'); $board->addPiece('W', 'K', 'h3'); // add a piece that can move $board->addPiece('W', 'P', 'h5'); $board->addPiece('W', 'P', 'h2'); $board->addPiece('W', 'P', 'g2'); $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse($board->inStaleMate('W'), 'W'); $phpunit->assertFalse($board->inStaleMate('B'), 'B'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_impossible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_impossible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_impossible.phpt --TEST-- Games_Chess->_interposeOrCapture() knight check, capture impossible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'N', 'd2'); $board->addPiece('W', 'Q', 'h5'); $phpunit->assertFalse($board->_interposeOrCapture( $board->_getPathToKing('d2', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_possible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_possible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_knightcheck_capture_possible.phpt --TEST-- Games_Chess->_interposeOrCapture() knight check, capture possible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'N', 'd2'); $board->addPiece('W', 'Q', 'h6'); $phpunit->assertTrue($board->_interposeOrCapture( $board->_getPathToKing('d2', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_impossible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_impossible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_impossible.phpt --TEST-- Games_Chess->_interposeOrCapture() piece check, capture impossible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'B', 'c2'); $board->addPiece('W', 'Q', 'h1'); $phpunit->assertFalse($board->_interposeOrCapture( $board->_getPathToKing('b1', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_possible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_possible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_capture_possible.phpt --TEST-- Games_Chess->_interposeOrCapture() piece check, capture possible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'B', 'b1'); $board->addPiece('W', 'Q', 'h1'); $phpunit->assertTrue($board->_interposeOrCapture( $board->_getPathToKing('b1', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_interpose_possible.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_interpose_possible.phpt +++ pear/Games_Chess/tests/Games_Chess/interposeOrCapture/test_piececheck_interpose_possible.phpt --TEST-- Games_Chess->_interposeOrCapture() piece check, interpose possible --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'K', 'e4'); $board->addPiece('B', 'B', 'b1'); $board->addPiece('W', 'Q', 'h2'); $phpunit->assertTrue($board->_interposeOrCapture( $board->_getPathToKing('b1', 'e4'), 'W'),1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveAlgebraic/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveAlgebraic/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/moveAlgebraic/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_capture.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_capture.phpt +++ pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_capture.phpt --TEST-- Games_Chess->_moveAlgebraic() capture --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $board->addPiece('B', 'B', 'h7'); $phpunit->assertEquals('e4', $board->_pieces['WB1'], 'setup test 1'); $phpunit->assertEquals('WB1', $board->_board['e4'], 'setup test 2'); $phpunit->assertEquals('BB1', $board->_board['h7'], 'setup test 3'); $phpunit->assertEquals('h7', $board->_pieces['BB1'], 'setup test 4'); $board->_moveAlgebraic('e4', 'h7'); $phpunit->assertEquals('h7', $board->_pieces['WB1'], 'move test 1'); $phpunit->assertEquals('e4', $board->_board['e4'], 'move test 2'); $phpunit->assertEquals('WB1', $board->_board['h7'], 'move test 3'); $phpunit->assertFalse($board->_pieces['BB1'], 'move test 4'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_simple.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_simple.phpt +++ pear/Games_Chess/tests/Games_Chess/moveAlgebraic/test_simple.phpt --TEST-- Games_Chess->_moveAlgebraic() simple move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $phpunit->assertEquals('e4', $board->_pieces['WB1'], 'setup test 1'); $phpunit->assertEquals('WB1', $board->_board['e4'], 'setup test 2'); $phpunit->assertEquals('h7', $board->_board['h7'], 'setup test 3'); $board->_moveAlgebraic('e4', 'h7'); $phpunit->assertEquals('h7', $board->_pieces['WB1'], 'move test 1'); $phpunit->assertEquals('e4', $board->_board['e4'], 'move test 2'); $phpunit->assertEquals('WB1', $board->_board['h7'], 'move test 3'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/movePiece/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/test_pawn.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/test_pawn.phpt +++ pear/Games_Chess/tests/Games_Chess/movePiece/test_pawn.phpt --TEST-- Games_Chess->_movePiece() pawn move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'P', 'e4'); $phpunit->assertEquals(array('e4', 'P'), $board->_pieces['WP1'], 'setup test'); $board->_movePiece('e4', 'e5'); $phpunit->assertEquals(array('e5', 'P'), $board->_pieces['WP1'], 'move test'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/test_piece.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/test_piece.phpt +++ pear/Games_Chess/tests/Games_Chess/movePiece/test_piece.phpt --TEST-- Games_Chess->_movePiece() piece move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $phpunit->assertEquals('e4', $board->_pieces['WB1'], 'setup test'); $board->_movePiece('e4', 'h7'); $phpunit->assertEquals('h7', $board->_pieces['WB1'], 'move test'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/movePiece/test_promotedpiece.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/movePiece/test_promotedpiece.phpt +++ pear/Games_Chess/tests/Games_Chess/movePiece/test_promotedpiece.phpt --TEST-- Games_Chess->_movePiece() promoted piece move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->addPiece('W', 'B', 'e4'); $board->addPiece('W', 'B', 'e5'); $board->addPiece('W', 'B', 'e6'); $phpunit->assertEquals(array('e6', 'B'), $board->_pieces['WP1'], 'setup test'); $board->_movePiece('e6', 'd5'); $phpunit->assertEquals(array('d5', 'B'), $board->_pieces['WP1'], 'move test'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/moveSAN/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekb.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekb.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekb.phpt --TEST-- Games_Chess->moveSAN() castling kingside (black) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $board->_move = 'B'; $err = $board->addPiece('B', 'R', 'h8'); $phpunit->assertFalse(is_object($err), 'adding B rook failed'); $err = $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse(is_object($err), 'adding B king failed'); $err = $board->moveSAN('O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekw.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekw.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castlekw.phpt --TEST-- Games_Chess->moveSAN() castling kingside (white) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'R', 'h1'); $phpunit->assertFalse(is_object($err), 'adding W rook failed'); $err = $board->addPiece('W', 'K', 'e1'); $phpunit->assertFalse(is_object($err), 'adding W king failed'); $err = $board->moveSAN('O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqb.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqb.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqb.phpt --TEST-- Games_Chess->moveSAN() castling queenside (white) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $board->_move = 'B'; $err = $board->addPiece('B', 'R', 'a8'); $phpunit->assertFalse(is_object($err), 'adding B rook failed'); $err = $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse(is_object($err), 'adding B king failed'); $err = $board->moveSAN('O-O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqw.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqw.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_castleqw.phpt --TEST-- Games_Chess->moveSAN() castling queenside (white) --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'R', 'a1'); $phpunit->assertFalse(is_object($err), 'adding W rook failed'); $err = $board->addPiece('W', 'K', 'e1'); $phpunit->assertFalse(is_object($err), 'adding W king failed'); $err = $board->moveSAN('O-O-O'); $phpunit->assertFalse(is_object($err), 'castling kingside failed'); if (is_object($err)) { $phpunit->assertEquals($err->message,''); } $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpawnmove.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpawnmove.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpawnmove.phpt --TEST-- Games_Chess->moveSAN() invalid pawn move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $err = $board->addPiece('W', 'P', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W pawn failed'); $err = $board->moveSAN('exd5'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'There are no White pieces on the board that can do "exd5"') ), 'wrong message'); $phpunit->assertEquals(6, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpiecemove.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpiecemove.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_invalidpiecemove.phpt --TEST-- Games_Chess->moveSAN() invalid piece move --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('B', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W knight failed'); $err = $board->moveSAN('Nxf6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'There is no piece on square f6', )), 'wrong message'); $phpunit->assertEquals(6, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('e3', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_moveking.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_moveking.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_moveking.phpt --TEST-- Games_Chess->moveSAN() move king --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $err = $board->addPiece('W', 'K', 'e1'); $phpunit->assertFalse(is_object($err), 'adding W king failed'); $err = $board->addPiece('B', 'K', 'e8'); $phpunit->assertFalse(is_object($err), 'adding B king failed'); $err = $board->moveSAN('Ke2'); $phpunit->assertFalse(is_object($err), 'moving W king failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared'); $board->_WCastleQ = $board->_WCastleK = true; $err = $board->moveSAN('Ke7'); $phpunit->assertFalse(is_object($err), 'moving B king failed'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_moverook.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_moverook.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_moverook.phpt --TEST-- Games_Chess->moveSAN() move rook --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $err = $board->addPiece('W', 'R', 'a1'); $phpunit->assertFalse(is_object($err), 'adding W rook 1 failed'); $err = $board->moveSAN('Ra3'); $phpunit->assertFalse(is_object($err), 'moving W rook 1 failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared 1'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared 1'); $phpunit->assertFalse($board->_WCastleQ, 'WQ not cleared 1'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared 1'); $board->_QCastleW = $board->_QCastleB = true; $board->_KCastleW = $board->_KCastleB = true; $board->resetGame(); $board->blankBoard(); $err = $board->addPiece('W', 'R', 'h1'); $phpunit->assertFalse(is_object($err), 'adding W rook 2 failed'); $err = $board->moveSAN('Rh8'); $phpunit->assertFalse(is_object($err), 'moving W rook 2 failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared 2'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared 2'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared 2'); $phpunit->assertFalse($board->_WCastleK, 'WK not cleared 2'); $board->resetGame(); $board->blankBoard(); $board->_move = 'B'; $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $err = $board->addPiece('B', 'R', 'a8'); $phpunit->assertFalse(is_object($err), 'adding B rook 1 failed'); $err = $board->addPiece('B', 'R', 'h8'); $phpunit->assertFalse(is_object($err), 'adding B rook 2 failed'); $err = $board->moveSAN('Ra6'); $phpunit->assertFalse(is_object($err), 'moving B rook 1 failed'); $phpunit->assertFalse($board->_BCastleQ, 'BQ not cleared 3'); $phpunit->assertTrue($board->_BCastleK, 'BK cleared 3'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared 3'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared 3'); $board->_WCastleQ = $board->_WCastleK = true; $board->_BCastleQ = $board->_BCastleK = true; $board->_move = 'B'; $err = $board->moveSAN('Rh7'); $phpunit->assertFalse(is_object($err), 'moving B rook 2 failed'); $phpunit->assertTrue($board->_BCastleQ, 'BQ cleared 4'); $phpunit->assertFalse($board->_BCastleK, 'BK not cleared 4'); $phpunit->assertTrue($board->_WCastleQ, 'WQ cleared 4'); $phpunit->assertTrue($board->_WCastleK, 'WK cleared 4'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture1.phpt --TEST-- Games_Chess->moveSAN() pawn capture #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'd6'; $err = $board->addPiece('W', 'P', 'e5'); $phpunit->assertFalse(is_object($err), 'adding W pawn failed'); $err = $board->addPiece('B', 'P', 'd5'); $phpunit->assertFalse(is_object($err), 'adding B pawn failed'); $err = $board->moveSAN('exd6'); $phpunit->assertFalse(is_object($err), 'capturing pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture2.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawncapture2.phpt --TEST-- Games_Chess->moveSAN() pawn capture #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'P', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W pawn failed'); $err = $board->addPiece('B', 'P', 'd4'); $phpunit->assertFalse(is_object($err), 'adding B pawn failed'); $err = $board->moveSAN('dxe3'); $phpunit->assertFalse(is_object($err), 'capturing pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove1.phpt --TEST-- Games_Chess->moveSAN() pawn move #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'e6'; $err = $board->addPiece('W', 'P', 'e4'); $phpunit->assertFalse(is_object($err), 'adding pawn failed'); $err = $board->moveSAN('e5'); $phpunit->assertFalse(is_object($err), 'moving pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove2.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_pawnmove2.phpt --TEST-- Games_Chess->moveSAN() pawn move #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'e6'; $err = $board->addPiece('W', 'P', 'e2'); $phpunit->assertFalse(is_object($err), 'adding pawn failed'); $err = $board->moveSAN('e4'); $phpunit->assertFalse(is_object($err), 'moving pawn failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('e3', $board->_enPassantSquare, 'en passant not set'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_piececapture1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_piececapture1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_piececapture1.phpt --TEST-- Games_Chess->moveSAN() piece capture #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('B', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding B knight failed'); $err = $board->addPiece('W', 'N', 'f6'); $phpunit->assertFalse(is_object($err), 'adding w knight failed'); $err = $board->moveSAN('Nxf6'); $phpunit->assertFalse(is_object($err), 'capturing knight failed'); $phpunit->assertEquals(1, $board->_halfMoves, 'half moves did not reset'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove1.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove1.phpt --TEST-- Games_Chess->moveSAN() piece move #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'W'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('W', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W knight failed'); $err = $board->moveSAN('Nf6'); $phpunit->assertFalse(is_object($err), 'moving knight failed'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('B', $board->_move, 'move color did not increment'); $phpunit->assertEquals(1, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove2.phpt +++ pear/Games_Chess/tests/Games_Chess/moveSAN/test_piecemove2.phpt --TEST-- Games_Chess->moveSAN() piece move #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_halfMoves = 6; $board->_moveNumber = 1; $board->_move = 'B'; $board->_enPassantSquare = 'e3'; $err = $board->addPiece('B', 'N', 'e4'); $phpunit->assertFalse(is_object($err), 'adding W knight failed'); $err = $board->moveSAN('Nf6'); $phpunit->assertFalse(is_object($err), 'moving knight failed'); $phpunit->assertEquals(7, $board->_halfMoves, 'half moves did not increment'); $phpunit->assertEquals('W', $board->_move, 'move color did not increment'); $phpunit->assertEquals(2, $board->_moveNumber, 'move number changed'); $phpunit->assertEquals('-', $board->_enPassantSquare, 'en passant not reset'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/setup.php.inc?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/setup.php.inc +++ pear/Games_Chess/tests/Games_Chess/parseFen/setup.php.inc <?php require_once 'Games/Chess.php'; require_once 'Games/Chess/Standard.php'; require_once dirname(dirname(dirname(__FILE__))) . '/phpt_test.php.inc'; $board = new Games_Chess_Standard(); $board->blankBoard(); $phpunit = new PEAR_PHPTest(); class Games_Chess_testStandard extends Games_Chess_Standard { var $pieces = array(); function addPiece($color, $type, $square) { $this->pieces[] = array($color, $type, $square); } } http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid1.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid1.phpt --TEST-- Games_Chess->_parseFen() invalid #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('hello'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "hello" has 1 fields, 6 is required'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid10.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid10.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid10.phpt --TEST-- Games_Chess->_parseFen() invalid #10 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - a 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - a 6" the half-move ply count "a" is not a number'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid11.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid11.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid11.phpt --TEST-- Games_Chess->_parseFen() invalid #11 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 a'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 a" the move number "a" is not a number'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid12.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid12.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid12.phpt --TEST-- Games_Chess->_parseFen() invalid #12 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkppp/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 5'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkppp/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5 5" Too many Black Pawns'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid13.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid13.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid13.phpt --TEST-- Games_Chess->_parseFen() invalid #13 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQk d1 0 1'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQk d1 0 1" the en passant square indicator "d1" is invalid'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid2.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid2.phpt --TEST-- Games_Chess->_parseFen() invalid #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('1 2 3 4 5'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "1 2 3 4 5" has an empty field at index 4'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid3.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid3.phpt --TEST-- Games_Chess->_parseFen() invalid #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('1$ 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "1$ 2 3 4 5 6" the character "$" is not a valid piece, separator or number'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid4.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid4.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid4.phpt --TEST-- Games_Chess->_parseFen() invalid #4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('RKQBPRNNRQ 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "RKQBPRNNRQ 2 3 4 5 6" has too many pieces for a chessboard'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid5.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid5.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid5.phpt --TEST-- Games_Chess->_parseFen() invalid #5 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('RKQBPRNN/RQ 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "RKQBPRNN/RQ 2 3 4 5 6" has too few pieces for a chessboard'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid6.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid6.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid6.phpt --TEST-- Games_Chess->_parseFen() invalid #6 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR 2 3 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR 2 3 4 5 6" has invalid to-move indicator, must be "w" or "b"'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid7.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid7.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid7.phpt --TEST-- Games_Chess->_parseFen() invalid #7 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKQKQ 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKQKQ 4 5 6" the castling indicator (KQkq) is too long'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid8.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid8.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid8.phpt --TEST-- Games_Chess->_parseFen() invalid #8 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKqw 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QKqw 4 5 6" the castling indicator "w" is invalid'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid9.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid9.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_invalid9.phpt --TEST-- Games_Chess->_parseFen() invalid #9 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq 4 5 6'); $phpunit->assertErrors(array( array('package' => 'PEAR_Error', 'message' => 'Invalid FEN - "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq 4 5 6" the en passant square indicator "4" is invalid'), ), 1); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid1.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid1.phpt --TEST-- Games_Chess->_parseFen() valid #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQk d3 0 1'); $phpunit->assertSame(true, $err, 'not valid parse'); $phpunit->assertTrue($board->_WCastleQ, '_WCastleQ'); $phpunit->assertTrue($board->_WCastleK, '_WCastleK'); $phpunit->assertFalse(false, $board->_BCastleQ, '_BCastleQ'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK'); $phpunit->assertEquals('B', $board->_move, 'move'); $phpunit->assertEquals('d3', $board->_enPassantSquare, 'wrong en passant'); $phpunit->assertEquals('0', $board->_halfMoves, 'wrong ply count'); $phpunit->assertEquals('1', $board->_moveNumber, 'wrong ply count'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid2.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid2.phpt --TEST-- Games_Chess->_parseFen() valid #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Kkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 1'); $phpunit->assertTrue($board->_WCastleK, '_WCastleK 1'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 1'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK 1'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertTrue($board->_WCastleQ, '_WCastleQ 2'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 2'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 2'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK 2'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w kq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 3'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 3'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 3'); $phpunit->assertTrue($board->_BCastleK, '_BCastleK 3'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w q d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 4'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 4'); $phpunit->assertTrue($board->_BCastleQ, '_BCastleQ 4'); $phpunit->assertFalse($board->_BCastleK, '_BCastleK 4'); $err = $board->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w - d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertFalse($board->_WCastleQ, '_WCastleQ 5'); $phpunit->assertFalse($board->_WCastleK, '_WCastleK 5'); $phpunit->assertFalse($board->_BCastleQ, '_BCastleQ 5'); $phpunit->assertFalse($board->_BCastleK, '_BCastleK 5'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard1.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard1.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard1.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #1 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $newboard = new Games_Chess_testStandard; $err = $newboard->_parseFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( array('B', 'R', 'a8'), array('B', 'N', 'b8'), array('B', 'B', 'c8'), array('B', 'Q', 'd8'), array('B', 'K', 'e8'), array('B', 'B', 'f8'), array('B', 'N', 'g8'), array('B', 'R', 'h8'), array('B', 'P', 'a7'), array('B', 'P', 'b7'), array('B', 'P', 'c7'), array('B', 'P', 'd7'), array('B', 'P', 'e7'), array('B', 'P', 'f7'), array('B', 'P', 'g7'), array('B', 'P', 'h7'), array('W', 'P', 'a2'), array('W', 'P', 'b2'), array('W', 'P', 'c2'), array('W', 'P', 'd2'), array('W', 'P', 'e2'), array('W', 'P', 'f2'), array('W', 'P', 'g2'), array('W', 'P', 'h2'), array('W', 'R', 'a1'), array('W', 'N', 'b1'), array('W', 'B', 'c1'), array('W', 'Q', 'd1'), array('W', 'K', 'e1'), array('W', 'B', 'f1'), array('W', 'N', 'g1'), array('W', 'R', 'h1'), ), $newboard->pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard2.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard2.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard2.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #2 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $newboard = new Games_Chess_testStandard; $err = $newboard->_parseFen('rnbqkbn1/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( array('B', 'R', 'a8'), array('B', 'N', 'b8'), array('B', 'B', 'c8'), array('B', 'Q', 'd8'), array('B', 'K', 'e8'), array('B', 'B', 'f8'), array('B', 'N', 'g8'), array('B', 'P', 'a7'), array('B', 'P', 'b7'), array('B', 'P', 'c7'), array('B', 'P', 'd7'), array('B', 'P', 'e7'), array('B', 'P', 'f7'), array('B', 'P', 'g7'), array('B', 'P', 'h7'), array('W', 'P', 'a2'), array('W', 'P', 'b2'), array('W', 'P', 'c2'), array('W', 'P', 'd2'), array('W', 'P', 'e2'), array('W', 'P', 'f2'), array('W', 'P', 'g2'), array('W', 'P', 'h2'), array('W', 'R', 'a1'), array('W', 'N', 'b1'), array('W', 'B', 'c1'), array('W', 'Q', 'd1'), array('W', 'K', 'e1'), array('W', 'B', 'f1'), array('W', 'N', 'g1'), array('W', 'R', 'h1'), ), $newboard->pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard3.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard3.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard3.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #3 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $newboard = new Games_Chess_testStandard; $err = $newboard->_parseFen('rnbqkbn1/pppppppp/5r2/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( array('B', 'R', 'a8'), array('B', 'N', 'b8'), array('B', 'B', 'c8'), array('B', 'Q', 'd8'), array('B', 'K', 'e8'), array('B', 'B', 'f8'), array('B', 'N', 'g8'), array('B', 'P', 'a7'), array('B', 'P', 'b7'), array('B', 'P', 'c7'), array('B', 'P', 'd7'), array('B', 'P', 'e7'), array('B', 'P', 'f7'), array('B', 'P', 'g7'), array('B', 'P', 'h7'), array('B', 'R', 'f6'), array('W', 'P', 'a2'), array('W', 'P', 'b2'), array('W', 'P', 'c2'), array('W', 'P', 'd2'), array('W', 'P', 'e2'), array('W', 'P', 'f2'), array('W', 'P', 'g2'), array('W', 'P', 'h2'), array('W', 'R', 'a1'), array('W', 'N', 'b1'), array('W', 'B', 'c1'), array('W', 'Q', 'd1'), array('W', 'K', 'e1'), array('W', 'B', 'f1'), array('W', 'N', 'g1'), array('W', 'R', 'h1'), ), $newboard->pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard4.phpt?view=markup&rev=1.1 Index: pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard4.phpt +++ pear/Games_Chess/tests/Games_Chess/parseFen/test_valid_fenboard4.phpt --TEST-- Games_Chess->_parseFen() valid board after parseFen #4 --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . '/setup.php.inc'; $err = $board->_parseFen('rnbqkbn1/pppppppp/5r2/8/8/8/PPPPPPPP/RNBQKBNR w Qkq d6 5 12'); $phpunit->assertTrue($err, 'not valid parse'); $phpunit->assertEquals( array( 'WR1' => 'a1', 'WN1' => 'b1', 'WB1' => 'c1', 'WQ' => 'd1', 'WK' => 'e1', 'WB2' => 'f1', 'WN2' => 'g1', 'WR2' => 'h1', 'WP1' => array('a2','P'), 'WP2' => array('b2','P'), 'WP3' => array('c2','P'), 'WP4' => array('d2','P'), 'WP5' => array('e2','P'), 'WP6' => array('f2','P'), 'WP7' => array('g2','P'), 'WP8' => array('h2','P'), 'BP1' => array('a7','P'), 'BP2' => array('b7','P'), 'BP3' => array('c7','P'), 'BP4' => array('d7','P'), 'BP5' => array('e7','P'), 'BP6' => array('f7','P'), 'BP7' => array('g7','P'), 'BP8' => array('h7','P'), 'BR1' => 'a8', 'BN1' => 'b8', 'BB1' => 'c8', 'BQ' => 'd8', 'BK' => 'e8', 'BB2' => 'f8', 'BN2' => 'g8', 'BR2' => 'f6', ), $board->_pieces, 'incorrect board setup'); echo 'tests done'; ?> --EXPECT-- tests done