[BUGFIX] Fix GET parameter order in unit tests 17/27917/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 27 Feb 2014 21:10:57 +0000 (22:10 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Thu, 27 Feb 2014 21:19:29 +0000 (22:19 +0100)
The order of GET parameters changed, so we have
to adapt the tests.

Resolves: #56403
Releases: 6.2
Change-Id: I6fb8d231c71fa020677313127d453be3eab500ce
Reviewed-on: https://review.typo3.org/27917
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php

index aa0ed9f..f3d4bf4 100644 (file)
@@ -182,7 +182,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $_POST['foo2'] = 'bar2';
                $this->uriBuilder->setAddQueryString(TRUE);
                $this->uriBuilder->setAddQueryStringMethod('GET,POST');
-               $expectedResult = 'mod.php?M=moduleKey&moduleToken=dummyToken&id=pageId&foo=bar&foo2=bar2';
+               $expectedResult = 'mod.php?id=pageId&foo=bar&foo2=bar2&M=moduleKey&moduleToken=dummyToken';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -196,7 +196,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $_POST['foo2'] = 'bar2';
                $this->uriBuilder->setAddQueryString(TRUE);
                $this->uriBuilder->setAddQueryStringMethod(NULL);
-               $expectedResult = 'mod.php?M=moduleKey&moduleToken=dummyToken&id=pageId&foo=bar';
+               $expectedResult = 'mod.php?id=pageId&foo=bar&M=moduleKey&moduleToken=dummyToken';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -219,7 +219,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                                        'M',
                                        'id'
                                ),
-                               'mod.php?moduleToken=dummyToken&foo=bar&foo2=bar2'
+                               'mod.php?foo=bar&foo2=bar2&moduleToken=dummyToken'
                        ),
                        'Arguments to be excluded in the end' => array(
                                array(
@@ -234,7 +234,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                                        'M',
                                        'id'
                                ),
-                               'mod.php?moduleToken=dummyToken&foo=bar&foo2=bar2'
+                               'mod.php?foo=bar&foo2=bar2&moduleToken=dummyToken'
                        ),
                        'Arguments in nested array to be excluded' => array(
                                array(
@@ -251,7 +251,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                                        'id',
                                        'tx_foo[bar]'
                                ),
-                               'mod.php?M=moduleKey&moduleToken=dummyToken&foo2=bar2'
+                               'mod.php?foo2=bar2&M=moduleKey&moduleToken=dummyToken'
                        ),
                        'Arguments in multidimensional array to be excluded' => array(
                                array(
@@ -270,7 +270,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                                        'id',
                                        'tx_foo[bar][baz]'
                                ),
-                               'mod.php?M=moduleKey&moduleToken=dummyToken&foo2=bar2'
+                               'mod.php?foo2=bar2&M=moduleKey&moduleToken=dummyToken'
                        ),
                );
        }
@@ -294,7 +294,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function buildBackendUriKeepsModuleQueryParametersIfAddQueryStringIsNotSet() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::_GETset(array('M' => 'moduleKey', 'id' => 'pageId', 'foo' => 'bar'));
-               $expectedResult = 'mod.php?M=moduleKey&moduleToken=dummyToken&id=pageId';
+               $expectedResult = 'mod.php?id=pageId&M=moduleKey&moduleToken=dummyToken';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -305,7 +305,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildBackendUriMergesAndOverrulesQueryParametersWithArguments() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::_GETset(array('M' => 'moduleKey', 'id' => 'pageId', 'foo' => 'bar'));
                $this->uriBuilder->setArguments(array('M' => 'overwrittenModuleKey', 'somePrefix' => array('bar' => 'baz')));
-               $expectedResult = 'mod.php?M=overwrittenModuleKey&moduleToken=dummyToken&id=pageId&somePrefix%5Bbar%5D=baz';
+               $expectedResult = 'mod.php?id=pageId&somePrefix%5Bbar%5D=baz&M=overwrittenModuleKey&moduleToken=dummyToken';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -318,7 +318,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockDomainObject = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity', array('dummy'));
                $mockDomainObject->_set('uid', '123');
                $this->uriBuilder->setArguments(array('somePrefix' => array('someDomainObject' => $mockDomainObject)));
-               $expectedResult = 'mod.php?M=moduleKey&moduleToken=dummyToken&somePrefix%5BsomeDomainObject%5D=123';
+               $expectedResult = 'mod.php?somePrefix%5BsomeDomainObject%5D=123&M=moduleKey&moduleToken=dummyToken';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }