From 9cd5f46a681996e553e8e2c669f5e017491b245a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 25 Feb 2016 18:23:05 +0100 Subject: [PATCH] BaseTestCase: add simple test bootstrapping --- library/Director/Test/BaseTestCase.php | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 library/Director/Test/BaseTestCase.php diff --git a/library/Director/Test/BaseTestCase.php b/library/Director/Test/BaseTestCase.php new file mode 100644 index 00000000..3f543e38 --- /dev/null +++ b/library/Director/Test/BaseTestCase.php @@ -0,0 +1,28 @@ +app(); + } + + protected function app() + { + if ($this->app === null) { + $testModuleDir = $_SERVER['PWD']; + $libDir = dirname(dirname($testModuleDir)) . '/library'; + require_once $libDir . '/Icinga/Application/Cli.php'; + $this->app = Cli::start(); + } + + return $this->app; + } +}