Initial unit tests, code cleanup

This commit is contained in:
2022-10-31 00:42:29 +01:00
parent abde48640f
commit d0956f851c
13 changed files with 180 additions and 24 deletions

3
tests/autoload.php Normal file
View File

@ -0,0 +1,3 @@
<?php
// This is not an autoloader, it is used by the tests

View File

@ -0,0 +1,7 @@
{
"datasets": {
"baz": {
"filename": "data/test.csv"
}
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace NoccyLabs\Dataset;
defined("NOCCYLABS_DATASET_TEST") || define("NOCCYLABS_DATASET_TEST", true);
class DatasetManagerTest extends \PHPUnit\Framework\TestCase
{
/**
* @covers DatasetManager::__construct
* @covers DatasetManager::determineVendorPath
*/
public function testCreatingTheDatasetManager()
{
$dm = new DatasetManager();
$sets = $dm->getAvailableDatasets();
$this->assertEquals(1, count($sets), "Expected 1 loaded set");
}
}