From e9152f2f3d64490e06ab05e9fa9de064a5e11409 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 25 Feb 2016 18:31:00 +0100 Subject: [PATCH] BaseTestCase: bootstrap only once --- library/Director/Test/BaseTestCase.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/Director/Test/BaseTestCase.php b/library/Director/Test/BaseTestCase.php index 3f543e38..cb513fc6 100644 --- a/library/Director/Test/BaseTestCase.php +++ b/library/Director/Test/BaseTestCase.php @@ -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; } }