From e3abec18b45aaa6419713ceccbd2b9103497abc8 Mon Sep 17 00:00:00 2001
From: Michael Oehlhof <typo3@oehlhof.de>
Date: Thu, 1 Oct 2015 19:30:38 +0200
Subject: [PATCH] [TASK] Add unit tests for stdWrap_expandList()

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>
---
 .../ContentObjectRendererTest.php             | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
index 9215e8f80d17..e2bf614fd851 100644
--- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
+++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
@@ -980,6 +980,40 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 		$this->assertEquals($expected, $result);
 	}
 
+	/**
+	 * @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
 	 */
-- 
GitLab