Commit 0ca4f2f9 authored by Aleksandr Galkin's avatar Aleksandr Galkin
Browse files

Easier tests

parent 119078b8
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit>
<testsuites>
<testsuite name="Project Test Suite">
<file>test.php</file>
</testsuite>
</testsuites>
</phpunit>
......@@ -57,8 +57,16 @@ class Test extends \PHPUnit_Framework_TestCase
$this->runFile('tests/027-pawn-can-not-move-across-figure.test');
}
/**
* Test file structure
*
* line 1: moves as arguments to chess.php
* line 2: 'correct' if all moves are correct, 'error' if there are incorrect moves
* Other lines: output of chess.php (final chess board) if all moves are correct
*
* @param string $file
*/
private function runFile($file)
{
$lines = file($file);
......
correct
8 ♜♞♝♛♚♝♞♜
7 ♟♟♟♟♟♟♟♟
6 --------
......
e2-e4
correct
8 ♜♞♝♛♚♝♞♜
7 ♟♟♟♟♟♟♟♟
6 --------
......
e2-e3 d7-d6 e3-e4
correct
8 ♜♞♝♛♚♝♞♜
7 ♟♟♟-♟♟♟♟
6 -------
......
e2-e4
correct
8 ♜♞♝♛♚♝♞♜
7 ♟♟♟♟♟♟♟♟
6 --------
......
e2-e4 d7-d5 e4-d5
correct
8 ♜♞♝♛♚♝♞♜
7 ♟♟♟-♟♟♟♟
6 --------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment