BUGFIX: IOFactory did not return correct class

This commit is contained in:
Jeroen De Meerleer 2023-01-24 10:20:17 +01:00
parent 2003701710
commit f6c1888949
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
4 changed files with 7 additions and 4 deletions

View File

@ -13,8 +13,8 @@
namespace Blackbirdchess\Service\Import; namespace Blackbirdchess\Service\Import;
use Blackbirdchess\Service\Import\Interfaces\ReaderInterface;
use Blackbirdchess\Service\Results\Exceptions\LibpairtwoException; use Blackbirdchess\Service\Results\Exceptions\LibpairtwoException;
use Blackbirdchess\Service\Results\Interfaces\ReaderInterface;
/** /**
* Class IOFactory * Class IOFactory

View File

@ -2,6 +2,7 @@
namespace Blackbirdchess\Tests\Service\Import\Readers; namespace Blackbirdchess\Tests\Service\Import\Readers;
use Blackbirdchess\Service\Import\IOFactory;
use Blackbirdchess\Service\Import\Readers\Pairtwo6; use Blackbirdchess\Service\Import\Readers\Pairtwo6;
use Blackbirdchess\Service\Results\Enums\Title; use Blackbirdchess\Service\Results\Enums\Title;
use Blackbirdchess\Service\Results\Player; use Blackbirdchess\Service\Results\Player;
@ -23,7 +24,7 @@ class Pairtwo6Test extends TestCase
} while(is_null($root) && $directory != '/'); } while(is_null($root) && $directory != '/');
$this->testfile = $root . $this->testfile; $this->testfile = $root . $this->testfile;
$this->testobject = new Pairtwo6(); $this->testobject = IOFactory::createReader('Pairtwo-6');
$this->testobject->read($this->testfile); $this->testobject->read($this->testfile);
} }

View File

@ -2,6 +2,7 @@
namespace Blackbirdchess\Tests\Service\Import\Readers; namespace Blackbirdchess\Tests\Service\Import\Readers;
use Blackbirdchess\Service\Import\IOFactory;
use Blackbirdchess\Service\Import\Readers\Swar5; use Blackbirdchess\Service\Import\Readers\Swar5;
use Blackbirdchess\Service\Results\Enums\Title; use Blackbirdchess\Service\Results\Enums\Title;
use Blackbirdchess\Service\Results\Player; use Blackbirdchess\Service\Results\Player;
@ -23,7 +24,7 @@ class Swar5Test extends TestCase
} while(is_null($root) && $directory != '/'); } while(is_null($root) && $directory != '/');
$this->testfile = $directory . $this->testfile; $this->testfile = $directory . $this->testfile;
$this->testobject = new Swar5(); $this->testobject = IOFactory::createReader('Swar-5');
$this->testobject->read($this->testfile); $this->testobject->read($this->testfile);
} }

View File

@ -2,6 +2,7 @@
namespace Blackbirdchess\Tests\Service\Import\Readers; namespace Blackbirdchess\Tests\Service\Import\Readers;
use Blackbirdchess\Service\Import\IOFactory;
use Blackbirdchess\Service\Import\Readers\Trf16; use Blackbirdchess\Service\Import\Readers\Trf16;
use Blackbirdchess\Service\Results\Enums\Gender; use Blackbirdchess\Service\Results\Enums\Gender;
use Blackbirdchess\Service\Results\Enums\Title; use Blackbirdchess\Service\Results\Enums\Title;
@ -24,7 +25,7 @@ class Trf16Test extends TestCase
} while(is_null($root) && $directory != '/'); } while(is_null($root) && $directory != '/');
$this->testfile = $root . $this->testfile; $this->testfile = $root . $this->testfile;
$this->testobject = new Trf16(); $this->testobject = IOFactory::createReader('TRF-16');
$this->testobject->read($this->testfile); $this->testobject->read($this->testfile);
} }