BaseTestCase: bootstrap only once

This commit is contained in:
Thomas Gelf 2016-02-25 18:31:00 +01:00
parent c741042108
commit e9152f2f3d
1 changed files with 4 additions and 4 deletions

View File

@ -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;
} }
} }