[TASK] Add unit test to cover stdWrap_insertData 44/48744/5
authorElmar Hinz <t3elmar@gmail.com>
Thu, 30 Jun 2016 10:06:42 +0000 (12:06 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 6 Jul 2016 09:02:26 +0000 (11:02 +0200)
Releases: master
Resolves: #76848
Change-Id: I76caea143b18030aa22d55ab7f4da6e415cc8164
Reviewed-on: https://review.typo3.org/48744
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index b463a23..657e25b 100644 (file)
@@ -1050,6 +1050,31 @@ class ContentObjectRendererTest extends UnitTestCase
     }
 
     /**
+     * Check if stdWrap_insertData works properly.
+     *
+     * Show:
+     *
+     *  - Delegates to method insertData.
+     *  - Parameter 1 is $content.
+     *  - Returns the return value.
+     *
+     *  @test
+     *  @return void
+     */
+    public function stdWrap_insertData()
+    {
+        $content = $this->getUniqueId('content');
+        $conf = [$this->getUniqueId('conf not used')];
+        $return = $this->getUniqueId('return');
+        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
+            ->setMethods(['insertData'])->getMock();
+        $subject->expects($this->once())->method('insertData')
+            ->with($content)->willReturn($return);
+        $this->assertSame($return,
+            $subject->stdWrap_insertData($content, $conf));
+    }
+
+    /**
      * Check if stdWrap_preIfEmptyListNum works properly.
      *
      * Show: