Example #1
0
 /**
  * Tests linkTo with complex remote URL
  *
  * @issue  1679
  *
  * @author Nikolaos Dimopoulos <*****@*****.**>
  * @author Dreamszhu <*****@*****.**>
  * @since  2014-09-29
  */
 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:someone@phalconphp.com";
         $name = '*****@*****.**';
         $actual = Tag::linkTo($url, $name, false);
         $expected = '<a href="mailto:someone@phalconphp.com">someone@phalconphp.com</a>';
         expect($actual)->equals($expected);
     });
 }