lithium\tests\cases\template\view\RendererTest::testUrlAutoEscaping PHP Метод

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

Tests that URLs are properly escaped by the URL handler.
public testUrlAutoEscaping ( )
    public function testUrlAutoEscaping()
    {
        Router::connect('/{:controller}/{:action}/{:id}');
        $this->assertEqual('/<foo>/<bar>', $this->subject->url('/<foo>/<bar>'));
        $result = $this->subject->url(array('Controller::action', 'id' => '<script />'));
        $this->assertEqual('/controller/action/<script />', $result);
        $this->subject = new Simple(array('response' => new Response(), 'view' => new View(), 'request' => new Request(array('base' => '', 'env' => array('HTTP_HOST' => 'foo.local')))));
        $this->assertEqual('/&lt;foo&gt;/&lt;bar&gt;', $this->subject->url('/<foo>/<bar>'));
        $result = $this->subject->url(array('Controller::action', 'id' => '<script />'));
        $this->assertEqual('/controller/action/&lt;script /&gt;', $result);
        $result = $this->subject->url(array('Posts::index', '?' => array('foo' => 'bar', 'baz' => 'dib')));
        $this->assertEqual('/posts?foo=bar&baz=dib', $result);
    }