mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 11:19:16 +02:00
29 lines
589 B
PHP
29 lines
589 B
PHP
<?php
|
|
|
|
namespace Icinga\Module\Director\Test;
|
|
|
|
use Icinga\Application\Cli;
|
|
use PHPUnit_Framework_TestCase;
|
|
|
|
class BaseTestCase extends PHPUnit_Framework_TestCase
|
|
{
|
|
private static $app;
|
|
|
|
public function setUp()
|
|
{
|
|
$this->app();
|
|
}
|
|
|
|
protected function app()
|
|
{
|
|
if (self::$app === null) {
|
|
$testModuleDir = $_SERVER['PWD'];
|
|
$libDir = dirname(dirname($testModuleDir)) . '/library';
|
|
require_once $libDir . '/Icinga/Application/Cli.php';
|
|
self::$app = Cli::start();
|
|
}
|
|
|
|
return self::$app;
|
|
}
|
|
}
|