Skip to content

Commit

Permalink
Renamed Chess\Media\BoardToFenSignal as Chess\FenSignal
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Dec 19, 2024
1 parent d9eba7d commit 3c92451
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<directory>tests/unit/Variant</directory>
<file>tests/unit/EvalFactoryTest.php</file>
<file>tests/unit/FenHeuristicsTest.php</file>
<file>tests/unit/FenSignalTest.php</file>
<file>tests/unit/FenToBoardFactoryTest.php</file>
<file>tests/unit/SanHeuristicsTest.php</file>
</testsuite>
Expand Down
9 changes: 4 additions & 5 deletions src/Media/BoardToFenSignal.php → src/FenSignal.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

namespace Chess\Media;
namespace Chess;

use Chess\FenHeuristics;
use Chess\Exception\MediaException;
use Chess\Function\FastFunction;
use Chess\Labeller\GoldbachLabeller;
use Chess\Movetext\SanMovetext;
Expand All @@ -16,7 +15,7 @@
* Discrete ternary oscillations of a game are encoded in a one-dimensional
* array of integer values.
*/
class BoardToFenSignal
class FenSignal
{
/**
* Maximum number of moves.
Expand All @@ -41,11 +40,11 @@ public function __construct(string $movetext, AbstractBoard $board)
$sanMovetext = new SanMovetext($board->move, $movetext);

if (!$sanMovetext->validate()) {
throw new MediaException();
throw new \InvalidArgumentException();
}

if (self::MAX_MOVES < count($sanMovetext->moves)) {
throw new MediaException();
throw new \InvalidArgumentException();
}

foreach ($sanMovetext->moves as $val) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Chess\Tests\Unit\Media;
namespace Chess\Tests\Unit;

use Chess\Media\BoardToFenSignal;
use Chess\FenSignal;
use Chess\Tests\AbstractUnitTestCase;
use Chess\Variant\Classical\Board;

class BoardToFenSignalTest extends AbstractUnitTestCase
class FenSignalTest extends AbstractUnitTestCase
{
/**
* @test
Expand Down Expand Up @@ -39,7 +39,7 @@ public function A74()

$board = new Board();

$signal = (new BoardToFenSignal($A74, $board))->signal;
$signal = (new FenSignal($A74, $board))->signal;

$this->assertSame($expected, $signal);
}
Expand Down

0 comments on commit 3c92451

Please sign in to comment.