"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Neos.Flow/Tests/Unit/Mvc/Controller/ActionControllerTest.php" between
flow-development-collection-7.1.0.tar.gz and flow-development-collection-7.1.1.tar.gz

About: TYPO3 Flow is a web application platform enabling developers creating fast, reliable and complex web solutions ("the next level of PHP programming"; old name "FLOW3").

ActionControllerTest.php  (flow-development-collection-7.1.0):ActionControllerTest.php  (flow-development-collection-7.1.1)
skipping to change at line 13 skipping to change at line 13
/* /*
* This file is part of the Neos.Flow package. * This file is part of the Neos.Flow package.
* *
* (c) Contributors of the Neos Project - www.neos.io * (c) Contributors of the Neos Project - www.neos.io
* *
* This package is Open Source Software. For the full copyright and license * This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this * information, please view the LICENSE file which was distributed with this
* source code. * source code.
*/ */
use GuzzleHttp\Psr7\Response;
use Neos\Flow\Mvc\Controller\ActionController; use Neos\Flow\Mvc\Controller\ActionController;
use Neos\Flow\Mvc\Controller\Arguments; use Neos\Flow\Mvc\Controller\Arguments;
use Neos\Flow\Mvc\View\SimpleTemplateView; use Neos\Flow\Mvc\View\SimpleTemplateView;
use Neos\Flow\Mvc; use Neos\Flow\Mvc;
use Neos\Flow\ObjectManagement\ObjectManagerInterface; use Neos\Flow\ObjectManagement\ObjectManagerInterface;
use Neos\Flow\Reflection\ReflectionService; use Neos\Flow\Reflection\ReflectionService;
use Neos\Flow\Tests\UnitTestCase; use Neos\Flow\Tests\UnitTestCase;
use Neos\Flow\Validation\Validator\ConjunctionValidator; use Neos\Flow\Validation\Validator\ConjunctionValidator;
use Neos\Flow\Validation\Validator\ValidatorInterface; use Neos\Flow\Validation\Validator\ValidatorInterface;
use Neos\Flow\Validation\ValidatorResolver; use Neos\Flow\Validation\ValidatorResolver;
skipping to change at line 319 skipping to change at line 321
$mockResponse = new Mvc\ActionResponse; $mockResponse = new Mvc\ActionResponse;
$mockResponse->setContentType('application/json'); $mockResponse->setContentType('application/json');
$this->inject($this->actionController, 'supportedMediaTypes', ['applicat ion/xml']); $this->inject($this->actionController, 'supportedMediaTypes', ['applicat ion/xml']);
$this->actionController->processRequest($this->mockRequest, $mockRespons e); $this->actionController->processRequest($this->mockRequest, $mockRespons e);
self::assertSame('application/json', $mockResponse->getContentType()); self::assertSame('application/json', $mockResponse->getContentType());
} }
/** /**
* @test * @test
* @dataProvider supportedAndRequestedMediaTypes
*/
public function processRequestUsesContentTypeFromRenderedView($supportedMedi
aTypes, $acceptHeader, $expected)
{
$this->actionController = $this->getAccessibleMock(ActionController::cla
ss, ['resolveActionMethodName', 'theActionAction', 'initializeActionMethodArgume
nts', 'initializeActionMethodValidators', 'resolveView']);
$this->actionController->method('resolveActionMethodName')->willReturn('
theActionAction');
$this->actionController->method('theActionAction')->willReturn(null);
$this->inject($this->actionController, 'objectManager', $this->mockObjec
tManager);
$mockMvcPropertyMappingConfigurationService = $this->createMock(Mvc\Cont
roller\MvcPropertyMappingConfigurationService::class);
$this->inject($this->actionController, 'mvcPropertyMappingConfigurationS
ervice', $mockMvcPropertyMappingConfigurationService);
$mockHttpRequest = $this->getMockBuilder(ServerRequestInterface::class)-
>disableOriginalConstructor()->getMock();
$mockHttpRequest->method('getHeaderLine')->with('Accept')->willReturn('a
pplication/xml');
$mockHttpRequest->method('getHeaderLine')->with('Accept')->willReturn('a
pplication/xml');
$this->mockRequest->method('getHttpRequest')->willReturn($mockHttpReques
t);
$mockResponse = new Mvc\ActionResponse;
$this->inject($this->actionController, 'supportedMediaTypes', ['applicat
ion/xml']);
$mockView = $this->createMock(Mvc\View\ViewInterface::class);
$mockView->method('render')->willReturn(new Response(200, ['Content-Type
' => 'application/json']));
$this->actionController->expects(self::once())->method('resolveView')->w
ill(self::returnValue($mockView));
$this->actionController->processRequest($this->mockRequest, $mockRespons
e);
self::assertSame('application/json', $mockResponse->getContentType());
}
/**
* @test
*/ */
public function resolveViewThrowsExceptionIfResolvedViewDoesNotImplementView Interface() public function resolveViewThrowsExceptionIfResolvedViewDoesNotImplementView Interface()
{ {
$this->expectException(Mvc\Exception\ViewNotFoundException::class); $this->expectException(Mvc\Exception\ViewNotFoundException::class);
$this->mockObjectManager->expects(self::any())->method('getCaseSensitive ObjectName')->will(self::returnValue(null)); $this->mockObjectManager->expects(self::any())->method('getCaseSensitive ObjectName')->will(self::returnValue(null));
$this->actionController->_set('defaultViewObjectName', 'ViewDefaultObjec tName'); $this->actionController->_set('defaultViewObjectName', 'ViewDefaultObjec tName');
$this->actionController->_call('resolveView'); $this->actionController->_call('resolveView');
} }
public function ignoredValidationArgumentsProvider() public function ignoredValidationArgumentsProvider()
 End of changes. 2 change blocks. 
0 lines changed or deleted 49 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)