1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 09:39:55 +02:00

Issue #4352 e107::canonical() method added.

Use define('e_DEBUG_CANONICAL', true); in e107_config.php to test usage.
This commit is contained in:
Cameron
2021-01-19 07:54:13 -08:00
parent 23d438a68b
commit 76144e6b4f
6 changed files with 79 additions and 13 deletions

View File

@@ -972,16 +972,41 @@ class e107Test extends \Codeception\Test\Unit
$obj = $this->e107;
// Test FULL url option on Legacy url with new options['mode']
$tests = array(
0 => array(
'plugin' => 'news',
'key' => 'index',
'plugin' => 'news/view/item',
'key' => array('news_id' => 1, 'news_sef' => 'my-news-item', 'category_sef' => 'my-category'),
'row' => array(),
'options' => ['mode' => 'full'],
),
1 => array(
'plugin' => 'news/view/item',
'key' => array('news_id' => 1, 'news_sef' => 'my-news-item', 'category_sef' => 'my-category'),
'row' => 'full=1&encode=0',
'options' => ['mode' => 'full'],
),
2 => array(
'plugin' => 'news/view/item',
'key' => array('news_id' => 1, 'news_sef' => 'my-news-item', 'category_sef' => 'my-category'),
'row' => '',
'options' => ['mode' => 'full'],
'_expected_' => 'https://localhost/e107/news'
),
3 => array(
'plugin' => 'news/view/item',
'key' => array('news_id' => 1, 'news_sef' => 'my-news-item', 'category_sef' => 'my-category'),
'row' => null,
'options' => ['mode' => 'full'],
),
);
foreach($tests as $v)
{
$result = $obj::url($v['plugin'], $v['key'], $v['row'], $v['options']);
$this->assertStringContainsString('http', $result);
}
$tests = array();