BaseTestCase: bootstrap only once
This commit is contained in:
parent
c741042108
commit
e9152f2f3d
|
@ -7,7 +7,7 @@ use PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
class BaseTestCase extends PHPUnit_Framework_TestCase
|
class BaseTestCase extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
private $app;
|
private static $app;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
|
@ -16,13 +16,13 @@ class BaseTestCase extends PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
protected function app()
|
protected function app()
|
||||||
{
|
{
|
||||||
if ($this->app === null) {
|
if (self::$app === null) {
|
||||||
$testModuleDir = $_SERVER['PWD'];
|
$testModuleDir = $_SERVER['PWD'];
|
||||||
$libDir = dirname(dirname($testModuleDir)) . '/library';
|
$libDir = dirname(dirname($testModuleDir)) . '/library';
|
||||||
require_once $libDir . '/Icinga/Application/Cli.php';
|
require_once $libDir . '/Icinga/Application/Cli.php';
|
||||||
$this->app = Cli::start();
|
self::$app = Cli::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->app;
|
return self::$app;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue