예제 #1
0
 public function testFindConfigFile()
 {
     $filename = new ConfigFile(__DIR__);
     $expectedLocation = str_replace('suite/Koshatul/Config', '', __DIR__);
     $this->assertEquals($expectedLocation . '.kosh.config.toml', $filename->getFilename(), 'Check Test File Location');
     $configSpecifyFile = new ConfigFile($expectedLocation . '.kosh.config.toml');
     $this->assertEquals($expectedLocation . '.kosh.config.toml', $configSpecifyFile->getFilename(), 'Check Test File Location');
 }
예제 #2
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');
 }