[TASK] Add unit test for short data type support in ReflectionService 16/33616/3
authorMarkus Klein <klein.t3@reelworx.at>
Thu, 30 Oct 2014 11:01:48 +0000 (12:01 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Thu, 30 Oct 2014 20:25:23 +0000 (21:25 +0100)
Resolves: #62547
Releases: master
Change-Id: Idada794755d8e40f702d0d9ada5a8b8b5719bf4c
Reviewed-on: http://review.typo3.org/33616
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php

index 2da992b..ec8a0ee 100644 (file)
@@ -32,6 +32,14 @@ class ReflectionServiceTest extends UnitTestCase {
        }
 
        /**
+        * @param bool $dummy
+        * @param int $foo
+        * @return void
+        */
+       public function fixtureMethodForMethodTagsValuesWithShortTypes($dummy, $foo) {
+       }
+
+       /**
         * @test
         */
        public function getClassTagsValues() {
@@ -81,7 +89,7 @@ class ReflectionServiceTest extends UnitTestCase {
        public function getMethodParameters() {
                $service = new ReflectionService();
                $parameters = $service->getMethodParameters(get_class($this), 'fixtureMethodForMethodTagsValues');
-               $this->assertEquals(array(
+               $this->assertSame(array(
                        'foo' => array(
                                'position' => 0,
                                'byReference' => FALSE,
@@ -93,4 +101,32 @@ class ReflectionServiceTest extends UnitTestCase {
                        )
                ), $parameters);
        }
+
+       /**
+        * @test
+        */
+       public function getMethodParametersWithShortTypeNames() {
+               $service = new ReflectionService();
+               $parameters = $service->getMethodParameters(get_class($this), 'fixtureMethodForMethodTagsValuesWithShortTypes');
+               $this->assertSame(array(
+                       'dummy' => array(
+                               'position' => 0,
+                               'byReference' => FALSE,
+                               'array' => FALSE,
+                               'optional' => FALSE,
+                               'allowsNull' => TRUE,
+                               'class' => NULL,
+                               'type' => 'boolean'
+                       ),
+                       'foo' => array(
+                               'position' => 1,
+                               'byReference' => FALSE,
+                               'array' => FALSE,
+                               'optional' => FALSE,
+                               'allowsNull' => TRUE,
+                               'class' => NULL,
+                               'type' => 'integer'
+                       )
+               ), $parameters);
+       }
 }