mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-19 22:15:05 +02: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);
|
$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()
|
public function testInvalidEnvironments()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue