[+BUGFIX] MVC: Make forwarding of objects work
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / MVC / Controller / ArgumentTest.php
index 37aa0c3..b8e65b5 100644 (file)
@@ -69,6 +69,26 @@ class Tx_Extbase_Tests_Unit_MVC_Controller_ArgumentTest extends Tx_Extbase_Tests
                $this->assertSame($argument, $returnedArgument, 'The returned argument is not the original argument.');
        }
 
+       /**
+        * @test
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function setValueUsesNullAsIs() {
+               $argument = $this->getMock('Tx_Extbase_MVC_Controller_Argument', array('transformValue'), array('dummy', 'ArrayObject'));
+               $argument->expects($this->never())->method('transformValue');
+               $argument->setValue(NULL);
+       }
+
+       /**
+        * @test
+        * @author Karsten Dambekalns <karsten@typo3.org>
+       */
+       public function setValueUsesMatchingInstanceAsIs() {
+               $argument = $this->getMock('Tx_Extbase_MVC_Controller_Argument', array('transformValue'), array('dummy', 'ArrayObject'));
+               $argument->expects($this->never())->method('transformValue');
+               $argument->setValue(new ArrayObject());
+       }
+
        /**
         * @test
         */