/**
  * @test
  */
 public function shouldReturnNameOfPgnFilesInFolder()
 {
     // given
     ChessRegistry::setPgnFolder('pgn');
     $obj = new ChessFSPgn();
     $games = $obj->read();
     $this->assertEquals(3, count($games));
     $this->assertEquals('chessfs', $games[0]);
     $this->assertEquals('Lasker', $games[1]);
     $this->assertEquals('Morphy', $games[2]);
 }
Beispiel #2
0
<?php

require_once dirname(__FILE__) . "/autoload.php";
require_once "php/jsonwrapper/jsonwrapper.php";
date_default_timezone_set("Europe/Berlin");
ini_set('display_errors', 'on');
if (file_exists("connection.php")) {
    require "connection.php";
}
LudoDBRegistry::set('FILE_UPLOAD_PATH', '/tmp/');
LudoDBRegistry::set('DEVELOP_MODE', true);
LudoDB::enableLogging();
// For static(No db) installations
ChessRegistry::setPgnFolder("pgn");
ChessRegistry::setCacheFolder("cache");
// Path to cache
$request = isset($_GET['request']) ? $_GET['request'] : $_POST['request'];
$requestData = isset($_POST['data']) ? $_POST['data'] : null;
$handler = new LudoDBRequestHandler();
echo $handler->handle($request, $requestData);