mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
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
|
||||
{
|
||||
private $app;
|
||||
private static $app;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
@ -16,13 +16,13 @@ class BaseTestCase extends PHPUnit_Framework_TestCase
|
||||
|
||||
protected function app()
|
||||
{
|
||||
if ($this->app === null) {
|
||||
if (self::$app === null) {
|
||||
$testModuleDir = $_SERVER['PWD'];
|
||||
$libDir = dirname(dirname($testModuleDir)) . '/library';
|
||||
require_once $libDir . '/Icinga/Application/Cli.php';
|
||||
$this->app = Cli::start();
|
||||
self::$app = Cli::start();
|
||||
}
|
||||
|
||||
return $this->app;
|
||||
return self::$app;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user