Follow-up to #13675: Added testcase for t3lib_div::intExplode()
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Feb 2010 17:44:01 +0000 (17:44 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Feb 2010 17:44:01 +0000 (17:44 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7060 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
tests/t3lib/t3lib_div_testcase.php

index 2859518..c7d77df 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-02-26  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Follow-up to #13675: Added testcase for t3lib_div::intExplode()
        * Follow-up to #13675: Use array_map() instead of array_walk()
        * Fixed bug #13675: Performance improvement: Use array_walk() for t3lib_div::intExplode (Thanks to Georg Ringer)
 
index c717b1a..3fb0f2e 100644 (file)
@@ -36,6 +36,17 @@ class t3lib_div_testcase extends tx_phpunit_testcase {
        /**
         * @test
         */
+       public function checkIntExplodeConvertsStringsToInteger() {
+               $testString = '1,foo,2';
+               $expectedArray = array(1, 0, 2);
+               $actualArray = t3lib_div::intExplode(',', $testString);
+
+               $this->assertEquals($expectedArray, $actualArray);
+       }
+
+       /**
+        * @test
+        */
        public function checkTrimExplodeTrimsSpacesAtElementStartAndEnd() {
                $testString = ' a , b , c ,d ,,  e,f,';
                $expectedArray = array('a', 'b', 'c', 'd', '', 'e', 'f', '');