Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 6496e204f77658ff2108478d2951b08a > files > 502

php-pear-Games_Chess-1.0.1-5mdv2010.0.noarch.rpm

--TEST--
Games_Chess_Crazyhouse->moveSAN() place piece on invalid square
--SKIPIF--
--FILE--
<?php
require_once dirname(__FILE__) . '/setup.php.inc';
$board->resetGame();
$err = $board->moveSAN('P@d5');
$phpunit->assertErrors(array(
    array('package' => 'PEAR_Error', 'message' => 'There are no captured Black Pawns available to place')
), 'error 1');
$phpunit->assertEquals(GAMES_CHESS_ERROR_NOPIECES_TOPLACE, $err->getCode(), 'err 1');
$phpunit->assertEquals('pear_error', strtolower(get_class($err)), 'no error');
$board->moveSAN('e4');
$board->moveSAN('d5');
$board->moveSAN('exd5');
$board->moveSAN('Qxd5');
$err = $board->moveSAN('P@d5');
$phpunit->assertErrors(array(
    array('package' => 'PEAR_Error', 'message' => 'There is already a piece on d5, cannot place another there')
), 'error 2');
$phpunit->assertEquals(GAMES_CHESS_ERROR_PIECEINTHEWAY, $err->getCode(), 'err 2');
echo 'tests done';
?>
--EXPECT--
tests done