Mutagenesis\Runner\RunnerAbstract::setBootstrap PHP Method

setBootstrap() public method

Set a bootstrap file included before tests run (e.g. setup autoloading)
public setBootstrap ( string $file )
$file string
    public function setBootstrap($file)
    {
        if (empty($file)) {
            return $this;
        }
        if (!file_exists($file) || !is_readable($file)) {
            throw new \Mutagenesis\FUTException('Invalid bootstrap file: "' . $file . '"');
        }
        $this->_bootstrap = $file;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Set the path to a bootstrap file used when testing. This allows
  * for registering autoloaders and such, for example TestHelper.php or
  * Bootstrap.php are common for PHPUnit.
  *
  * @param \Mutagenesis\Runner\RunnerAbstract $runner
  */
 protected static function setBootstrap(\Mutagenesis\Runner\RunnerAbstract $runner)
 {
     if (isset(self::$_options['bootstrap'])) {
         $runner->setBootstrap(self::$_options['bootstrap']);
     }
 }