1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 11:36:08 +02:00

Fixes #4826 - redirect dynamic content on static domain.

This commit is contained in:
Cameron
2022-07-19 16:32:33 -07:00
parent 1792aee537
commit c4bcf0a663
4 changed files with 156 additions and 6 deletions

View File

@@ -0,0 +1,106 @@
<?php
class redirectionTest extends \Codeception\Test\Unit
{
/** @var redirection */
protected $rd;
protected function _before()
{
try
{
$this->rd = $this->make('redirection');
}
catch(Exception $e)
{
$this->fail($e->getMessage());
}
}
/* public function testRedirect()
{
}
public function testGetPreviousUrl()
{
}
public function testGo()
{
}
public function testCheckMaintenance()
{
}
public function testSetPreviousUrl()
{
}
public function testRedirectPrevious()
{
}
public function testGetSelfExceptions()
{
}
public function testGetCookie()
{
}
public function testCheckMembersOnly()
{
}
public function testSetCookie()
{
}
public function testClearCookie()
{
}
public function testGetSelf()
{
}*/
public function testRedirectStaticDomain()
{
$result = $this->rd->redirectStaticDomain();
$this->assertEmpty($result);
$this->rd->domain = 'e107.org';
$this->rd->subdomain = 'static1';
$this->rd->staticDomains = ['https://static1.e107.org', 'https://static2.e107.org'];
$this->rd->self = 'https://static1.e107.org/blogs';
$this->rd->siteurl = 'https://e107.org/';
$result = $this->rd->redirectStaticDomain();
$this->assertSame("https://e107.org/blogs", $result);
}
}