lithium\tests\cases\net\http\RouterTest::testCompileScopeAbsoluteWithVariables PHP Метод

testCompileScopeAbsoluteWithVariables() публичный Метод

    public function testCompileScopeAbsoluteWithVariables()
    {
        $result = Router::invokeMethod('_compileScope', array(array('absolute' => true, 'host' => '{:subdomain:[a-z]+}.{:domain}.{:tld}', 'scheme' => 'http', 'prefix' => 'web/tests')));
        $expected = array('absolute' => true, 'host' => '{:subdomain:[a-z]+}.{:domain}.{:tld}', 'scheme' => 'http', 'base' => null, 'prefix' => 'web/tests', 'pattern' => '@^http://(?P<subdomain>[a-z]+)\\.(?P<domain>[^/]+?)\\.' . '(?P<tld>[^/]+?)/web/tests/@', 'params' => array('subdomain', 'domain', 'tld'));
        $this->assertEqual($expected, $result);
        $result = Router::invokeMethod('_compileScope', array(array('absolute' => true, 'host' => '{:subdomain:[a-z]+}.{:domain}.{:tld}', 'scheme' => '{:scheme:https}', 'prefix' => '')));
        $expected = array('absolute' => true, 'host' => '{:subdomain:[a-z]+}.{:domain}.{:tld}', 'scheme' => '{:scheme:https}', 'base' => null, 'prefix' => '', 'pattern' => '@^(?P<scheme>https)://(?P<subdomain>[a-z]+)\\.(?P<domain>[^/]+?)\\.' . '(?P<tld>[^/]+?)/@', 'params' => array('scheme', 'subdomain', 'domain', 'tld'));
        $this->assertEqual($expected, $result);
    }
RouterTest