Neos\Flow\Tests\Unit\ObjectManagement\Proxy\ProxyMethodTest::buildMethodParametersCodeOmitsTypeHintsAndDefaultValuesIfToldSo PHP Method

buildMethodParametersCodeOmitsTypeHintsAndDefaultValuesIfToldSo() public method

    public function buildMethodParametersCodeOmitsTypeHintsAndDefaultValuesIfToldSo()
    {
        $className = 'TestClass' . md5(uniqid(mt_rand(), true));
        eval('
            class ' . $className . ' {
                public function foo($arg1, array $arg2, \\ArrayObject $arg3, $arg4= "foo", $arg5 = TRUE) {}
            }
        ');
        $mockReflectionService = $this->createMock(ReflectionService::class);
        $mockReflectionService->expects($this->atLeastOnce())->method('getMethodParameters')->will($this->returnValue(['arg1' => [], 'arg2' => [], 'arg3' => [], 'arg4' => [], 'arg5' => []]));
        $expectedCode = '$arg1, $arg2, $arg3, $arg4, $arg5';
        $builder = $this->getMockBuilder(ProxyMethod::class)->disableOriginalConstructor()->setMethods(['dummy'])->getMock();
        $builder->injectReflectionService($mockReflectionService);
        $actualCode = $builder->buildMethodParametersCode($className, 'foo', false);
        $this->assertSame($expectedCode, $actualCode);
    }