Initial unit tests, code cleanup
This commit is contained in:
		
							
								
								
									
										3
									
								
								tests/autoload.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								tests/autoload.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
// This is not an autoloader, it is used by the tests
 | 
			
		||||
							
								
								
									
										7
									
								
								tests/foo/bar/dataset.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/foo/bar/dataset.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
    "datasets": {
 | 
			
		||||
        "baz": {
 | 
			
		||||
            "filename": "data/test.csv"
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								tests/src/DatasetManagerTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								tests/src/DatasetManagerTest.php
									
									
									
									
									
										Normal 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");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user