summaryrefslogtreecommitdiffstats
path: root/library/Businessprocess/Web/Url.php
blob: 92b1e8587769468880688be8b9d9381828391e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Icinga\Module\Businessprocess\Web;

use Icinga\Application\Icinga;
use Icinga\Application\Web;
use Icinga\Web\Request;
use Icinga\Web\Url as WebUrl;

/**
 * Class Url
 *
 * The main purpose of this class is to get unit tests running on CLI
 *
 * @package Icinga\Module\Businessprocess\Web
 */
class Url extends WebUrl
{
    /**
     * @return FakeRequest|Request
     */
    protected static function getRequest()
    {
        $app = Icinga::app();
        if ($app->isCli()) {
            return new FakeRequest();
        }

        /** @var Web $app */
        return $app->getRequest();
    }
}