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

testProcessWithAbsoluteAttachment() public method

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