2016-11-23 18:20:59 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Businessprocess\Web;
|
|
|
|
|
|
|
|
|
|
use Icinga\Application\Icinga;
|
2023-08-14 03:50:53 -04:00
|
|
|
use Icinga\Application\Web;
|
2016-11-23 18:20:59 -05:00
|
|
|
use Icinga\Web\Url as WebUrl;
|
|
|
|
|
|
2016-11-26 15:18:18 -05:00
|
|
|
/**
|
|
|
|
|
* Class Url
|
|
|
|
|
*
|
|
|
|
|
* The main purpose of this class is to get unit tests running on CLI
|
|
|
|
|
*
|
|
|
|
|
* @package Icinga\Module\Businessprocess\Web
|
|
|
|
|
*/
|
2016-11-23 18:20:59 -05:00
|
|
|
class Url extends WebUrl
|
|
|
|
|
{
|
|
|
|
|
protected static function getRequest()
|
|
|
|
|
{
|
|
|
|
|
$app = Icinga::app();
|
|
|
|
|
if ($app->isCli()) {
|
|
|
|
|
return new FakeRequest();
|
|
|
|
|
}
|
2023-08-14 03:50:53 -04:00
|
|
|
|
|
|
|
|
/** @var Web $app */
|
|
|
|
|
return $app->getRequest();
|
2016-11-23 18:20:59 -05:00
|
|
|
}
|
2016-11-26 15:18:18 -05:00
|
|
|
}
|