public function testGetTemplateFilename()
 {
     $config = new SkelCommandConfig($this->cliOptionsProphecy->reveal(), '/tmp/');
     $expected = realpath(__DIR__ . '/../../../../conf/phive.skeleton.xml');
     $actual = realpath($config->getTemplateFilename());
     $this->assertEquals($expected, $actual);
 }
Пример #2
0
 /**
  * @param string $skeleton
  *
  * @throws IOException
  */
 private function writeSkeletonFile($skeleton)
 {
     $destination = $this->config->getDestination();
     if (file_exists($destination) && !$this->config->allowOverwrite()) {
         throw new IOException('A PHIVE configuration file already exists. Use the "-force" switch to overwrite it.');
     }
     file_put_contents($this->config->getDestination(), $skeleton);
 }