From 4aa5ac8622b465561ef94a01bd0bf70d7501eb06 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 14 Jan 2020 13:45:35 -0800 Subject: [PATCH] Issue 4054 Added test for e107::url() with 'mode' => 'full' as often utilized by e107::redirect() --- e107_tests/tests/unit/e107Test.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php index 23d7d3090..48ed90d9d 100644 --- a/e107_tests/tests/unit/e107Test.php +++ b/e107_tests/tests/unit/e107Test.php @@ -791,6 +791,24 @@ class e107Test extends \Codeception\Test\Unit $result = $obj::url('news','index', array(), array('mode'=>'full')); $this->assertEquals("https://localhost/e107/news", $result); + + + $obj::getPlugin()->install('forum'); + $url = $obj::url('forum', 'topic', array(), array( + 'query' => array( + 'f' => 'post', + 'id' => 123 + ), + 'mode'=>'full' // suitable for URL redirect. eg. e107::redirect($url) + )); + + if(strpos($url,'http')!==0 || strpos($url, '&') !== false) + { + $this->fail("Generated 'full mode' URL contains ampersand entities or does not contain http"); + } + + + } /** @@ -810,6 +828,9 @@ class e107Test extends \Codeception\Test\Unit e_PLUGIN_ABS. 'forum/forum_viewtopic.php?f=post&id=123', $url, "Generated href does not match expectation" ); + + + } /* public function testRedirect()