[TASK] Add unit tests for stdWrap_expandList() 11/43711/2
authorMichael Oehlhof <typo3@oehlhof.de>
Thu, 1 Oct 2015 17:30:38 +0000 (19:30 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 1 Oct 2015 19:51:00 +0000 (21:51 +0200)
Resolves: #70282
Releases: master
Change-Id: I4468bc758b25825f2e746792c4f27a7a67183a6b
Reviewed-on: http://review.typo3.org/43711
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index 9215e8f..e2bf614 100644 (file)
@@ -983,6 +983,40 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @return array
         */
+       public function stdWrap_expandListDataProvider() {
+               return array(
+                       'numbers' => array(
+                               '1,2,3',
+                               '1,2,3',
+                       ),
+                       'range' => array(
+                               '3-5',
+                               '3,4,5',
+                       ),
+                       'numbers and range' => array(
+                               '1,3-5,7',
+                               '1,3,4,5,7',
+                       ),
+               );
+       }
+
+       /**
+        * Test for the stdWrap function "expandList"
+        *
+        * @param string $content
+        * @param string $expected
+        *
+        * @dataProvider stdWrap_expandListDataProvider
+        * @test
+        */
+       public function stdWrap_expandList($content, $expected) {
+               $result = $this->subject->stdWrap_expandList($content);
+               $this->assertEquals($expected, $result);
+       }
+
+       /**
+        * @return array
+        */
        public function stdWrap_trimDataProvider() {
                return array(
                        'trimstring' => array(