ParaTest\Console\Testers\PHPUnit::requireBootstrap PHP Method

requireBootstrap() public method

Require the bootstrap. If the file is specified, but does not exist then an exception will be raised.
public requireBootstrap ( $file )
$file
    public function requireBootstrap($file)
    {
        if (!$file) {
            return;
        }
        if (!file_exists($file)) {
            $message = sprintf('Bootstrap specified but could not be found (%s)', $file);
            throw new \RuntimeException($message);
        }
        $this->scopedRequire($file);
    }

Usage Example

Beispiel #1
0
 public function testRequireBootstrapIsChdirResistent()
 {
     $file = dirname(__FILE__) . '/../../../../fixtures/chdirBootstrap.php';
     $tester = new PHPUnit();
     $cwd = getcwd();
     $tester->requireBootstrap($file);
     $this->assertEquals($cwd, getcwd());
 }