mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-05-28 04:35:53 -04:00
BaseTestCase: bootstrap only once
This commit is contained in:
parent
c741042108
commit
e9152f2f3d
1 changed files with 4 additions and 4 deletions
|
|
@ -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…
Reference in a new issue