[TASK] Add unit test to cover stdWrap_addParams 32/48732/4
authorElmar Hinz <t3elmar@gmail.com>
Wed, 29 Jun 2016 09:47:33 +0000 (11:47 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 7 Jul 2016 18:35:31 +0000 (20:35 +0200)
Releases: master
Resolves: #76832
Change-Id: I72062653b084281dfb2e6c36ee9669174694ec2d
Reviewed-on: https://review.typo3.org/48732
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index dbf5982..6718a00 100644 (file)
@@ -4337,6 +4337,38 @@ class ContentObjectRendererTest extends UnitTestCase
     }
 
     /**
+     * Check that stdWrap_addParams works properly.
+     *
+     * Show:
+     *
+     *  - Delegates to method addParams.
+     *  - Parameter 1 is $content.
+     *  - Parameter 2 is $conf['addParams.'].
+     *  - Returns the return value.
+     *
+     *  @test
+     *  @return void.
+     */
+    public function stdWrap_addParams()
+    {
+        $content = $this->getUniqueId('content');
+        $conf = [
+            'addParams' => $this->getUniqueId('not used'),
+            'addParams.' => [$this->getUniqueId('addParams.')],
+        ];
+        $return = $this->getUniqueId('return');
+        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
+            ->setMethods(['addParams'])->getMock();
+        $subject
+            ->expects($this->once())
+            ->method('addParams')
+            ->with($content, $conf['addParams.'])
+            ->willReturn($return);
+        $this->assertSame($return,
+            $subject->stdWrap_addParams($content, $conf));
+    }
+
+    /**
      * Check if stdWrap_age works properly.
      *
      * Show: