ConfigPhpTest.php
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Test\Phinx\Config;
use \Phinx\Config\Config;
/**
* Class ConfigPhpTest
* @package Test\Phinx\Config
* @group config
*/
class ConfigPhpTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers \Phinx\Config\Config::fromPhp
* @covers \Phinx\Config\Config::getDefaultEnvironment
*/
public function testFromPHPMethod()
{
$path = __DIR__ . '/_files';
$config = Config::fromPhp($path . '/valid_config.php');
$this->assertEquals('dev', $config->getDefaultEnvironment());
}
/**
* @covers \Phinx\Config\Config::fromPhp
* @covers \Phinx\Config\Config::getDefaultEnvironment
* @expectedException \RuntimeException
*/
public function testFromPHPMethodWithoutArray()
{
$path = __DIR__ . '/_files';
$config = Config::fromPhp($path . '/config_without_array.php');
$this->assertEquals('dev', $config->getDefaultEnvironment());
}
/**
* @covers \Phinx\Config\Config::fromPhp
* @covers \Phinx\Config\Config::getDefaultEnvironment
* @expectedException \RuntimeException
*/
public function testFromJSONMethodWithoutJSON()
{
$path = __DIR__ . '/_files';
$config = Config::fromPhp($path . '/empty.json');
$this->assertEquals('dev', $config->getDefaultEnvironment());
}
}