Misc fixes
* Updated build scripts to handle gitless environments a little better * PDO shell plugin improvements * More tests
This commit is contained in:
		
							
								
								
									
										42
									
								
								tests/Environment/EnvironmentTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								tests/Environment/EnvironmentTest.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Spark\Environment;
 | 
			
		||||
 | 
			
		||||
class EnvironmentTest extends \PhpUnit\Framework\TestCase
 | 
			
		||||
{
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * @covers Environment::createFromDirectory
 | 
			
		||||
     * @covers Environment::getProjectDirectory
 | 
			
		||||
     */
 | 
			
		||||
    public function testCreatingEnvironmentByTraversing()
 | 
			
		||||
    {
 | 
			
		||||
        $env = Environment::createFromDirectory(__DIR__, true);
 | 
			
		||||
 | 
			
		||||
        $this->assertInstanceOf(Environment::class, $env);
 | 
			
		||||
        $this->assertEquals(dirname(__DIR__), $env->getProjectDirectory());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @covers Environment::createFromDirectory
 | 
			
		||||
     */
 | 
			
		||||
    public function testFailingToCreatingEnvironmentFromMissingConfig()
 | 
			
		||||
    {
 | 
			
		||||
        $env = Environment::createFromDirectory(__DIR__);
 | 
			
		||||
 | 
			
		||||
        $this->assertNull($env);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @covers Environment::createFromDirectory
 | 
			
		||||
     * @covers Environment::getProjectDirectory
 | 
			
		||||
     */
 | 
			
		||||
    public function testCreatingEnvironmentDirectly()
 | 
			
		||||
    {
 | 
			
		||||
        $env = Environment::createFromDirectory(__DIR__."/..");
 | 
			
		||||
 | 
			
		||||
        $this->assertInstanceOf(Environment::class, $env);
 | 
			
		||||
        $this->assertEquals(dirname(__DIR__), $env->getProjectDirectory());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user