[TASK] Add unit test to cover stdWrap_numRows 39/48639/4
authorElmar Hinz <t3elmar@gmail.com>
Wed, 22 Jun 2016 13:59:11 +0000 (15:59 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Sun, 26 Jun 2016 09:45:41 +0000 (11:45 +0200)
Resolves: #76736
Releases: master
Change-Id: I32d29db377eacc4f01b5344d4608caefaa6fff51
Reviewed-on: https://review.typo3.org/48639
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index f97b151..9eab32f 100644 (file)
@@ -1285,6 +1285,32 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
             $subject->stdWrap_cObject('discard', $conf));
     }
 
             $subject->stdWrap_cObject('discard', $conf));
     }
 
+    /**
+     * Check if stdWrap_numRows works properly.
+     *
+     * Show:
+     *
+     * - Delegates to method numRows.
+     * - Parameter is $conf['numRows.'].
+     * - Returns the return value.
+     *
+     * @test
+     * @return void
+     */
+    public function stdWrap_numRows()
+    {
+        $conf = [
+            'numRows' => $this->getUniqueId('numRows'),
+            'numRows.' => [$this->getUniqueId('numRows')],
+        ];
+        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
+            ->setMethods(['numRows'])->getMock();
+        $subject->expects($this->once())->method('numRows')
+            ->with($conf['numRows.'])->willReturn('return');
+        $this->assertSame('return',
+            $subject->stdWrap_numRows('discard', $conf));
+    }
+
     /**
      * Data provider for stdWrap_csConv
      *
     /**
      * Data provider for stdWrap_csConv
      *