diff --git a/web/typo3conf/ext/ep_track/Tests/Unit/Userfunction/RequestHandlerTest.php b/web/typo3conf/ext/ep_track/Tests/Unit/Userfunction/RequestHandlerTest.php deleted file mode 100644 index 102f1fda..00000000 --- a/web/typo3conf/ext/ep_track/Tests/Unit/Userfunction/RequestHandlerTest.php +++ /dev/null @@ -1,88 +0,0 @@ -, dreipunktnull - * - * All rights reserved - * - * This script is part of the TYPO3 project. The TYPO3 project is - * free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * The GNU General Public License can be found at - * http://www.gnu.org/copyleft/gpl.html. - * - * This script is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This copyright notice MUST APPEAR in all copies of the script! - ***************************************************************/ - -use EP\EpTrack\Userfunction\RequestHandler; -use TYPO3\CMS\Core\Tests\UnitTestCase; - -class RequestHandlerTest extends UnitTestCase -{ - - public function testIgnoresUrlsWithoutTrackingCode() - { - $handler = $this->getHandlerInstance(); - - $uriWithoutTrackingCode = '/foo/bar?baz=1234'; - $redirect = $handler->parseUri($uriWithoutTrackingCode); - $this->assertNull($redirect); - } - - public function testRedirectsWithValidTrackingCodeInUrl() - { - $handler = $this->getHandlerInstance(); - - $uriWithoutTrackingCode = '/foo/bar/abcd1234foo'; - $redirect = $handler->parseUri($uriWithoutTrackingCode); - $this->assertEquals($redirect, '/foo/bar/'); - - $uriWithoutTrackingCode = '/abcd1234foo'; - $redirect = $handler->parseUri($uriWithoutTrackingCode); - $this->assertEquals($redirect, '/'); - } - - public function testRedirectsWithValidTrackingCodeInQueryString() - { - $handler = $this->getHandlerInstance(); - - $uriWithoutTrackingCode = '/foo/bar/?trk=abcd1234foo'; - $redirect = $handler->parseUri($uriWithoutTrackingCode); - $this->assertEquals($redirect, '/foo/bar/'); - } - - public function testRedirectsWithValidTrackingCodeInUrlAndAdditionalQueryString() - { - $handler = $this->getHandlerInstance(); - - $uriWithoutTrackingCode = '/foo/bar/abcd1234foo?bar=baz'; - $redirect = $handler->parseUri($uriWithoutTrackingCode); - $this->assertEquals($redirect, '/foo/bar/?bar=baz'); - } - - /** - * @return RequestHandler - */ - protected function getHandlerInstance() - { - $handler = new RequestHandler(); - $cookieUtility = $this->getMockObjectGenerator()->getMock('\EP\EpTrack\Utility\CookieUtility'); - $cookieUtility->expects($this->any())->method('setCookie'); - $this->inject($handler, 'cookieUtility', $cookieUtility); - return $handler; - } - -} \ No newline at end of file diff --git a/web/typo3conf/ext/ep_track/Tests/bootstrap.php b/web/typo3conf/ext/ep_track/Tests/bootstrap.php deleted file mode 100644 index 97d27384..00000000 --- a/web/typo3conf/ext/ep_track/Tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -addPsr4('EP\\EpTrack\\Tests\\Unit\\', __DIR__ . '/Unit/');