[TASK] Add unit test to cover stdWrap_dataWrap 35/48735/3
authorElmar Hinz <t3elmar@gmail.com>
Wed, 29 Jun 2016 10:57:35 +0000 (12:57 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 6 Jul 2016 09:00:19 +0000 (11:00 +0200)
Releases: master
Resolves: #76843
Change-Id: I7e1019dba8bce515e861ce3cb726b204ee31fbb7
Reviewed-on: https://review.typo3.org/48735
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 155f1d7..b463a23 100644 (file)
@@ -2265,6 +2265,38 @@ class ContentObjectRendererTest extends UnitTestCase
     }
 
     /**
+     * Check that stdWrap_dataWrap works properly.
+     *
+     * Show:
+     *
+     *  - Delegates to method dataWrap.
+     *  - Parameter 1 is $content.
+     *  - Parameter 2 is $conf['dataWrap'].
+     *  - Returns the return value.
+     *
+     *  @test
+     *  @return void.
+     */
+    public function stdWrap_dataWrap()
+    {
+        $content = $this->getUniqueId('content');
+        $conf = [
+            'dataWrap' => $this->getUniqueId('dataWrap'),
+            'dataWrap.' => [$this->getUniqueId('not used')],
+        ];
+        $return = $this->getUniqueId('return');
+        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
+            ->setMethods(['dataWrap'])->getMock();
+        $subject
+            ->expects($this->once())
+            ->method('dataWrap')
+            ->with($content, $conf['dataWrap'])
+            ->willReturn($return);
+        $this->assertSame($return,
+            $subject->stdWrap_dataWrap($content, $conf));
+    }
+
+    /**
      * Data provider for the hash test
      *
      * @return array [$expect, $content, $conf]