1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Issue 4054 Added test for e107::url() with 'mode' => 'full' as often utilized by e107::redirect()

This commit is contained in:
Cameron
2020-01-14 13:45:35 -08:00
parent 9488fdcdc3
commit 4aa5ac8622

View File

@@ -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()