use Psr\Log\NullLogger;
use TYPO3\CMS\Core\Authentication\LoginType;
+use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Site\Entity\Site;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
class FrontendLoginControllerTest extends UnitTestCase
{
/**
+ * @var bool Restore Environment after tests
+ */
+ protected $backupEnvironment = true;
+
+ /**
* @var \TYPO3\CMS\Felogin\Controller\FrontendLoginController|\TYPO3\TestingFramework\Core\AccessibleObjectInterface
*/
protected $accessibleFixture;
*/
protected function setUp()
{
+ parent::setUp();
$GLOBALS['TSFE'] = new \stdClass();
$this->testHostName = 'hostname.tld';
$this->testSitePath = '/';
*/
public function validateRedirectUrlKeepsCleanUrl($url)
{
+ Environment::initialize(
+ Environment::getContext(),
+ true,
+ false,
+ Environment::getProjectPath(),
+ Environment::getPublicPath(),
+ Environment::getVarPath(),
+ Environment::getConfigPath(),
+ Environment::getBackendPath() . '/index.php',
+ Environment::isWindows() ? 'WINDOWS' : 'UNIX'
+ );
$this->assertEquals($url, $this->accessibleFixture->_call('validateRedirectUrl', $url));
}
*/
public function validateRedirectUrlKeepsCleanUrlInSubdirectory($url)
{
+ Environment::initialize(
+ Environment::getContext(),
+ true,
+ false,
+ Environment::getProjectPath(),
+ Environment::getPublicPath(),
+ Environment::getVarPath(),
+ Environment::getConfigPath(),
+ Environment::getBackendPath() . '/index.php',
+ Environment::isWindows() ? 'WINDOWS' : 'UNIX'
+ );
$this->testSitePath = '/subdir/';
$this->setUpFakeSitePathAndHost();
$this->assertEquals($url, $this->accessibleFixture->_call('validateRedirectUrl', $url));
*/
public function isInCurrentDomainIgnoresScheme($host, $https, $url)
{
+ Environment::initialize(
+ Environment::getContext(),
+ true,
+ false,
+ Environment::getProjectPath(),
+ Environment::getPublicPath(),
+ Environment::getVarPath(),
+ Environment::getConfigPath(),
+ Environment::getBackendPath() . '/index.php',
+ Environment::isWindows() ? 'WINDOWS' : 'UNIX'
+ );
$_SERVER['HTTP_HOST'] = $host;
$_SERVER['HTTPS'] = $https;
$this->assertTrue($this->accessibleFixture->_call('isInCurrentDomain', $url));