コード例 #1
0
ファイル: InitProcessor.php プロジェクト: kingsj/core
 /**
  * Creates features path structure (initializes behat tests structure).
  *
  * @param   Behat\Behat\PathLocator                             $locator    path locator
  * @param   Symfony\Component\Console\Input\OutputInterface     $output     output console
  */
 protected function initFeaturesDirectoryStructure(PathLocator $locator, OutputInterface $output)
 {
     $basePath = realpath($locator->getWorkPath()) . DIRECTORY_SEPARATOR;
     $featuresPath = $locator->getFeaturesPath();
     $bootstrapPath = $locator->getBootstrapPath();
     if (!is_dir($featuresPath)) {
         mkdir($featuresPath, 0777, true);
         $output->writeln('<info>+d</info> ' . str_replace($basePath, '', realpath($featuresPath)) . ' <comment>- place your *.feature files here</comment>');
     }
     if (!is_dir($bootstrapPath)) {
         mkdir($bootstrapPath, 0777, true);
         $output->writeln('<info>+d</info> ' . str_replace($basePath, '', realpath($bootstrapPath)) . ' <comment>- place bootstrap scripts and static files here</comment>');
         file_put_contents($bootstrapPath . DIRECTORY_SEPARATOR . 'FeatureContext.php', $this->getFeatureContextSkelet());
         $output->writeln('<info>+f</info> ' . str_replace($basePath, '', realpath($bootstrapPath)) . DIRECTORY_SEPARATOR . 'FeatureContext.php <comment>- place your feature related code here</comment>');
     }
 }