示例#1
0
 public function testURLConfigFile()
 {
     $url = 'http://code.nervhq.com/toml/.kosh.config.toml';
     // $testToml = '#Toml File'.PHP_EOL.PHP_EOL.'[webonly]'.PHP_EOL.'test="testvalue"'.PHP_EOL;
     $configFile = new ConfigFile($url);
     $this->assertEquals($url, $configFile->getFilename(), 'Check URL File Location');
     // echo "Mock Test".PHP_EOL;
     // $config = $this->getMockBuilder('Koshatul\Config\Config')
     // 	->disableOriginalConstructor()
     // 	->getMock();
     // $config->expects($this->once())
     // 	->method('_getContents')
     // 	->with($url)
     // 	->willReturn($testToml);
     // $config->__construct($url);
     $config = new Config($url);
     $this->assertEquals('testvalue', $config->getValue('webonly/test'), 'Check Value in Web Only TOML file');
 }
示例#2
0
 public function testConfigFileValid()
 {
     $this->assertEquals(true, $this->configFile->isValid(), 'Test that config file is valid');
     $badConfigFile = new ConfigFile('/', 'null_should_not_exist');
     $this->assertEquals(false, $badConfigFile->isValid(), 'Test that config file is invalid when not found');
 }