Phalcon\Test\Unit\Tag\TagLinkToTest::testLinkToWithComplexRemoteUrl PHP Метод

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

Tests linkTo with complex remote URL
С версии: 2014-09-29
Автор: Nikolaos Dimopoulos ([email protected])
Автор: Dreamszhu ([email protected])
    public function testLinkToWithComplexRemoteUrl()
    {
        $this->specify("linkTo with complex remote URL string parameter returns invalid HTML", function () {
            Tag::resetInput();
            $url = "http://phalconphp.com/en/";
            $name = 'x_name';
            $actual = Tag::linkTo($url, $name, false);
            $expected = '<a href="http://phalconphp.com/en/">x_name</a>';
            expect($actual)->equals($expected);
        });
        $this->specify("linkTo with complex remote URL array parameter returns invalid HTML", function () {
            Tag::resetInput();
            $options = ["http://phalconphp.com/en/", 'x_name', false];
            $actual = Tag::linkTo($options);
            $expected = '<a href="http://phalconphp.com/en/">x_name</a>';
            expect($actual)->equals($expected);
        });
        $this->specify("linkTo with complex remote URL array named parameter returns invalid HTML", function () {
            Tag::resetInput();
            $options = ["http://phalconphp.com/en/", 'text' => 'x_name', 'local' => false];
            $actual = Tag::linkTo($options);
            $expected = '<a href="http://phalconphp.com/en/">x_name</a>';
            expect($actual)->equals($expected);
        });
        $this->specify("linkTo with mailto URL string parameter returns invalid HTML", function () {
            Tag::resetInput();
            $url = "mailto:[email protected]";
            $name = '[email protected]';
            $actual = Tag::linkTo($url, $name, false);
            $expected = '<a href="mailto:[email protected]">[email protected]</a>';
            expect($actual)->equals($expected);
        });
    }