[BUGFIX] felogin: Use correct regex in redirect evaluation
[Packages/TYPO3.CMS.git] / typo3 / sysext / felogin / Tests / Unit / Controller / FrontendLoginControllerTest.php
index b03322c..9f162f6 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Felogin\Tests\Unit\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
+
 /**
  * Test case
  *
@@ -449,4 +451,22 @@ class FrontendLoginControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertFalse($this->accessibleFixture->_call('isInCurrentDomain', $url));
        }
 
+       /**
+        * @test
+        */
+       public function processRedirectReferrerDomainsMatchesDomains() {
+               $conf = array(
+                       'redirectMode' => 'refererDomains',
+                       'domains' => 'example.com'
+               );
+
+               $this->accessibleFixture->_set('conf', $conf);
+               $this->accessibleFixture->_set('logintype', 'login');
+               $this->accessibleFixture->_set('referer', 'http://www.example.com/snafu');
+               /** @var TypoScriptFrontendController $tsfe */
+               $tsfe = $this->accessibleFixture->_get('frontendController');
+               $tsfe->loginUser = TRUE;
+               $this->assertSame(array('http://www.example.com/snafu'), $this->accessibleFixture->_call('processRedirect'));
+       }
+
 }