[TASK] Unit test to cover stdWrap_rawUrlEncode 84/48284/4
authorElmar Hinz <t3elmar@gmail.com>
Wed, 25 May 2016 07:51:32 +0000 (09:51 +0200)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 27 May 2016 12:11:14 +0000 (14:11 +0200)
Resolves: #76294
Releases: master
Change-Id: Ifca415dd965473cde9cec29ca21a476491540845
Reviewed-on: https://review.typo3.org/48284
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index 4572f2b..ee5fa80 100755 (executable)
@@ -1465,6 +1465,28 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     }
 
     /**
+     * @return array
+     */
+    public function stdWrapRawUrlEncodeDataProvider()
+    {
+        return [
+            'https://typo3.org?id=10' => ['https://typo3.org?id=10', 'https%3A%2F%2Ftypo3.org%3Fid%3D10'],
+            'https://typo3.org?id=10&foo=bar' => ['https://typo3.org?id=10&foo=bar', 'https%3A%2F%2Ftypo3.org%3Fid%3D10%26foo%3Dbar'],
+        ];
+    }
+
+    /**
+     * Check if rawUrlEncode works properly
+     *
+     * @test
+     * @dataProvider stdWrapRawUrlEncodeDataProvider
+     */
+    public function stdWrap_rawUrlEncode($input, $expected)
+    {
+        $this->assertEquals($expected, $this->subject->stdWrap_rawUrlEncode($input));
+    }
+
+    /**
      * Data provider for the getQuery test
      *
      * @return array multi-dimensional array with the second level like this: