lithium\tests\cases\net\http\RouterTest::testProcessWithAbsoluteHttpsAttachment PHP Method

testProcessWithAbsoluteHttpsAttachment() public method

    public function testProcessWithAbsoluteHttpsAttachment()
    {
        Router::scope('app', function () {
            Router::connect('/home/welcome', array('Home::app'));
        });
        Router::scope('tests', function () {
            Router::connect('/home/welcome', array('Home::tests'));
        });
        Router::connect('/home/welcome', array('Home::default'));
        Router::attach('tests', array('absolute' => true, 'host' => 'app.mysite.com', 'scheme' => 'http'));
        Router::attach('app', array('absolute' => true, 'host' => 'app.mysite.com', 'scheme' => 'http'));
        $request = new Request(array('host' => 'app.mysite.com', 'scheme' => 'https', 'url' => '/home/welcome'));
        $result = Router::process($request);
        $expected = array('controller' => 'Home', 'action' => 'default');
        $this->assertEqual($expected, $result->params);
        Router::attach('app', array('absolute' => true, 'host' => 'app.mysite.com', 'scheme' => 'https'));
        $result = Router::process($request);
        $expected = array('library' => 'app', 'controller' => 'Home', 'action' => 'app');
        $this->assertEqual($expected, $result->params);
    }
RouterTest