mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	[Nostromo] Improve covergage and tests
This commit is contained in:
		
							parent
							
								
									b095cd0bb8
								
							
						
					
					
						commit
						12f07aecef
					
				@ -40,6 +40,41 @@ class RuntimeTest extends TestCase
 | 
			
		||||
        $this->assertLessThanOrEqual(2, $dateDiff->s);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testEnvOptionWithInvalidEnvironment()
 | 
			
		||||
    {
 | 
			
		||||
        $runtime = new Runtime();
 | 
			
		||||
        $runtime->setConfiguration(['environments' => ['invalid' => []]]);
 | 
			
		||||
        $runtime->setEnvironment('invalid');
 | 
			
		||||
        $runtime->setConfiguration(['environments' => []]);
 | 
			
		||||
 | 
			
		||||
        $controlValue = time();
 | 
			
		||||
        $returnedValue = $runtime->getEnvOption('test', $controlValue);
 | 
			
		||||
 | 
			
		||||
        $this->assertEquals($controlValue, $returnedValue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testNoConfigWithEmptyTasks()
 | 
			
		||||
    {
 | 
			
		||||
        $runtime = new Runtime();
 | 
			
		||||
        $tasks = $runtime->getTasks();
 | 
			
		||||
 | 
			
		||||
        $this->assertTrue(is_array($tasks));
 | 
			
		||||
        $this->assertEquals(0, count($tasks));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testInvalidEnvironmentEmptyTasks()
 | 
			
		||||
    {
 | 
			
		||||
        $runtime = new Runtime();
 | 
			
		||||
        $runtime->setConfiguration(['environments' => ['invalid' => []]]);
 | 
			
		||||
        $runtime->setEnvironment('invalid');
 | 
			
		||||
        $runtime->setConfiguration(['environments' => []]);
 | 
			
		||||
 | 
			
		||||
        $tasks = $runtime->getTasks();
 | 
			
		||||
 | 
			
		||||
        $this->assertTrue(is_array($tasks));
 | 
			
		||||
        $this->assertEquals(0, count($tasks));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testInvalidEnvironments()
 | 
			
		||||
    {
 | 
			
		||||
        try {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user