PhpSpec\Console\ConsoleIO::getBootstrapPath PHP Method

getBootstrapPath() public method

public getBootstrapPath ( )
    public function getBootstrapPath()
    {
        if ($path = $this->input->getOption('bootstrap')) {
            return $path;
        }
        if ($path = $this->config->getBootstrapPath()) {
            return $path;
        }
        return false;
    }

Usage Example

コード例 #1
0
ファイル: BootstrapListener.php プロジェクト: phpspec/phpspec
 public function beforeSuite()
 {
     if ($bootstrap = $this->io->getBootstrapPath()) {
         if (!is_file($bootstrap)) {
             throw new \RuntimeException(sprintf("Bootstrap file '%s' does not exist", $bootstrap));
         }
         require $bootstrap;
     }
 }