/** * @test */ public function buildMethodArgumentsValidatorConjunctionsReturnsEmptyArrayIfMethodHasNoArguments() { $mockController = $this->getAccessibleMock('TYPO3\\Flow\\Mvc\\Controller\\ActionController', array('fooAction'), array(), '', FALSE); $mockReflectionService = $this->getMock('TYPO3\\Flow\\Reflection\\ReflectionService', array(), array(), '', FALSE); $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue(array())); $this->validatorResolver = $this->getAccessibleMock('TYPO3\\Flow\\Validation\\ValidatorResolver', array('createValidator'), array(), '', FALSE); $this->validatorResolver->_set('reflectionService', $mockReflectionService); $result = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockController), 'fooAction'); $this->assertSame(array(), $result); }
/** * @test */ public function buildMethodArgumentsValidatorConjunctionsReturnsEmptyArrayIfMethodHasNoArguments() { $mockController = $this->getAccessibleMock(\TYPO3\Flow\Mvc\Controller\ActionController::class, array('fooAction'), array(), '', false); $mockReflectionService = $this->getMockBuilder(\TYPO3\Flow\Reflection\ReflectionService::class)->disableOriginalConstructor()->getMock(); $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue(array())); $this->validatorResolver = $this->getAccessibleMock(\TYPO3\Flow\Validation\ValidatorResolver::class, array('createValidator'), array(), '', false); $this->validatorResolver->_set('reflectionService', $mockReflectionService); $result = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockController), 'fooAction'); $this->assertSame(array(), $result); }