diff --git a/composer.json b/composer.json index 68069fa6..adb86a44 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require-dev": { "phpunit/phpunit": "^7.0", "matthiasnoback/symfony-dependency-injection-test": "~3.0", - "friendsofphp/php-cs-fixer": "^2.13" + "friendsofphp/php-cs-fixer": "~2.15.0" }, "autoload": { "psr-4": { diff --git a/tests/bundle/eZ/RichText/RendererTest.php b/tests/bundle/eZ/RichText/RendererTest.php index 5f2df5eb..f33426d3 100644 --- a/tests/bundle/eZ/RichText/RendererTest.php +++ b/tests/bundle/eZ/RichText/RendererTest.php @@ -48,19 +48,19 @@ public function testRenderTag() ->expects($this->once()) ->method('render') ->with($templateName, $parameters) - ->will($this->returnValue($result)); + ->willReturn($result); $renderer ->expects($this->once()) ->method('getTagTemplateName') ->with($name, $isInline) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(true)); + ->willReturn(true); $this->loggerMock ->expects($this->never()) @@ -87,7 +87,7 @@ public function testRenderTagNoTemplateConfigured() ->expects($this->once()) ->method('getTagTemplateName') ->with($name, $isInline) - ->will($this->returnValue(null)); + ->willReturn(null); $this->templateEngineMock ->expects($this->never()) @@ -119,13 +119,13 @@ public function testRenderTagNoTemplateFound() ->expects($this->once()) ->method('getTagTemplateName') ->with($name, $isInline) - ->will($this->returnValue('templateName')); + ->willReturn('templateName'); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(false)); + ->willReturn(false); $this->loggerMock ->expects($this->once()) @@ -253,7 +253,7 @@ public function testRenderTagWithTemplate( ->expects($this->once()) ->method('render') ->with($renderTemplate, $parameters) - ->will($this->returnValue($renderResult)); + ->willReturn($renderResult); } if (!isset($templateEngineTemplate)) { @@ -265,7 +265,7 @@ public function testRenderTagWithTemplate( ->expects($this->once()) ->method('exists') ->with($templateEngineTemplate) - ->will($this->returnValue(true)); + ->willReturn(true); } if (empty($configResolverParams)) { @@ -282,7 +282,7 @@ public function testRenderTagWithTemplate( ->expects($this->at($i)) ->method($method) ->with($namespace) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); ++$i; } } @@ -339,19 +339,19 @@ public function testRenderContentEmbed() ->expects($this->once()) ->method('render') ->with($templateName, $parameters) - ->will($this->returnValue($result)); + ->willReturn($result); $renderer ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_CONTENT, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(true)); + ->willReturn(true); $this->loggerMock ->expects($this->never()) @@ -395,7 +395,7 @@ public function testRenderContentEmbedNoTemplateConfigured() ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_CONTENT, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->never()) @@ -442,13 +442,13 @@ public function testRenderContentEmbedNoTemplateFound() ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_CONTENT, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(false)); + ->willReturn(false); $this->loggerMock ->expects($this->once()) @@ -489,19 +489,19 @@ public function testRenderContentEmbedAccessDenied() ->expects($this->once()) ->method('render') ->with($templateName, $parameters) - ->will($this->returnValue($result)); + ->willReturn($result); $renderer ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_CONTENT, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(true)); + ->willReturn(true); $this->loggerMock ->expects($this->once()) @@ -802,7 +802,7 @@ public function testRenderContentWithTemplate( ->expects($this->once()) ->method('render') ->with($renderTemplate, $parameters) - ->will($this->returnValue($renderResult)); + ->willReturn($renderResult); } if (!isset($templateEngineTemplate)) { @@ -814,7 +814,7 @@ public function testRenderContentWithTemplate( ->expects($this->once()) ->method('exists') ->with($templateEngineTemplate) - ->will($this->returnValue(true)); + ->willReturn(true); } if (empty($configResolverParams)) { @@ -831,7 +831,7 @@ public function testRenderContentWithTemplate( ->expects($this->at($i)) ->method($method) ->with($namespace) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); ++$i; } } @@ -875,31 +875,31 @@ public function testRenderLocationEmbed() ->expects($this->once()) ->method('__get') ->with('invisible') - ->will($this->returnValue(false)); + ->willReturn(false); $renderer ->expects($this->once()) ->method('checkLocation') ->with($locationId) - ->will($this->returnValue($mockLocation)); + ->willReturn($mockLocation); $renderer ->expects($this->once()) ->method('render') ->with($templateName, $parameters) - ->will($this->returnValue($result)); + ->willReturn($result); $renderer ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_LOCATION, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(true)); + ->willReturn(true); $this->loggerMock ->expects($this->never()) @@ -926,13 +926,13 @@ public function testRenderLocationEmbedNoTemplateConfigured() ->expects($this->once()) ->method('__get') ->with('invisible') - ->will($this->returnValue(false)); + ->willReturn(false); $renderer ->expects($this->once()) ->method('checkLocation') ->with($locationId) - ->will($this->returnValue($mockLocation)); + ->willReturn($mockLocation); $renderer ->expects($this->never()) @@ -942,7 +942,7 @@ public function testRenderLocationEmbedNoTemplateConfigured() ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_LOCATION, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->never()) @@ -973,13 +973,13 @@ public function testRenderLocationEmbedNoTemplateFound() ->expects($this->once()) ->method('__get') ->with('invisible') - ->will($this->returnValue(false)); + ->willReturn(false); $renderer ->expects($this->once()) ->method('checkLocation') ->with($locationId) - ->will($this->returnValue($mockLocation)); + ->willReturn($mockLocation); $renderer ->expects($this->never()) @@ -989,13 +989,13 @@ public function testRenderLocationEmbedNoTemplateFound() ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_LOCATION, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(false)); + ->willReturn(false); $this->loggerMock ->expects($this->once()) @@ -1028,19 +1028,19 @@ public function testRenderLocationEmbedAccessDenied() ->expects($this->once()) ->method('render') ->with($templateName, $parameters) - ->will($this->returnValue($result)); + ->willReturn($result); $renderer ->expects($this->once()) ->method('getEmbedTemplateName') ->with(Renderer::RESOURCE_TYPE_LOCATION, $isInline, $isDenied) - ->will($this->returnValue($templateName)); + ->willReturn($templateName); $this->templateEngineMock ->expects($this->once()) ->method('exists') ->with($templateName) - ->will($this->returnValue(true)); + ->willReturn(true); $this->loggerMock ->expects($this->once()) @@ -1066,13 +1066,13 @@ public function testRenderLocationEmbedInvisible() ->expects($this->once()) ->method('__get') ->with('invisible') - ->will($this->returnValue(true)); + ->willReturn(true); $renderer ->expects($this->once()) ->method('checkLocation') ->with($locationId) - ->will($this->returnValue($mockLocation)); + ->willReturn($mockLocation); $renderer ->expects($this->never()) @@ -1312,13 +1312,13 @@ public function testRenderLocationWithTemplate( ->expects($this->once()) ->method('__get') ->with('invisible') - ->will($this->returnValue(false)); + ->willReturn(false); $renderer ->expects($this->once()) ->method('checkLocation') ->with($locationId) - ->will($this->returnValue($mockLocation)); + ->willReturn($mockLocation); } if (!isset($renderTemplate)) { @@ -1330,7 +1330,7 @@ public function testRenderLocationWithTemplate( ->expects($this->once()) ->method('render') ->with($renderTemplate, $parameters) - ->will($this->returnValue($renderResult)); + ->willReturn($renderResult); } if (!isset($templateEngineTemplate)) { @@ -1342,7 +1342,7 @@ public function testRenderLocationWithTemplate( ->expects($this->once()) ->method('exists') ->with($templateEngineTemplate) - ->will($this->returnValue(true)); + ->willReturn(true); } if (empty($configResolverParams)) { @@ -1359,7 +1359,7 @@ public function testRenderLocationWithTemplate( ->expects($this->at($i)) ->method($method) ->with($namespace) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); ++$i; } } diff --git a/tests/lib/eZ/FieldType/RichText/RichTextStorageTest.php b/tests/lib/eZ/FieldType/RichText/RichTextStorageTest.php index 9cd2b75f..2f53e229 100644 --- a/tests/lib/eZ/FieldType/RichText/RichTextStorageTest.php +++ b/tests/lib/eZ/FieldType/RichText/RichTextStorageTest.php @@ -70,7 +70,7 @@ public function testGetFieldData($xmlString, $updatedXmlString, $linkIds, $linkU ->expects($this->once()) ->method('getIdUrlMap') ->with($this->equalTo($linkIds)) - ->will($this->returnValue($linkUrls)); + ->willReturn($linkUrls); $gateway->expects($this->never())->method('getUrlIdMap'); $gateway->expects($this->never())->method('getContentIds'); $gateway->expects($this->never())->method('insertUrl'); @@ -200,12 +200,12 @@ public function testStoreFieldData( ->expects($this->at($gatewayCallIndex++)) ->method('getUrlIdMap') ->with($this->equalTo($linkUrls)) - ->will($this->returnValue($linkIds)); + ->willReturn($linkIds); $gateway ->expects($this->at($gatewayCallIndex++)) ->method('getContentIds') ->with($this->equalTo($remoteIds)) - ->will($this->returnValue($contentIds)); + ->willReturn($contentIds); $gateway->expects($this->never())->method('getIdUrlMap'); if (empty($insertLinks)) { $gateway->expects($this->never())->method('insertUrl'); @@ -218,7 +218,7 @@ public function testStoreFieldData( ->expects($this->at($gatewayCallIndex++)) ->method('insertUrl') ->with($this->equalTo($url)) - ->will($this->returnValue($id)); + ->willReturn($id); } else { $id = $linkIds[$url]; } @@ -283,12 +283,12 @@ public function testStoreFieldDataThrowsNotFoundException( ->expects($this->once()) ->method('getUrlIdMap') ->with($this->equalTo($linkUrls)) - ->will($this->returnValue($linkIds)); + ->willReturn($linkIds); $gateway ->expects($this->once()) ->method('getContentIds') ->with($this->equalTo($remoteIds)) - ->will($this->returnValue($contentIds)); + ->willReturn($contentIds); $gateway->expects($this->never())->method('getIdUrlMap'); if (empty($insertLinks)) { $gateway->expects($this->never())->method('insertUrl'); @@ -299,7 +299,7 @@ public function testStoreFieldDataThrowsNotFoundException( ->expects($this->at($index + 2)) ->method('insertUrl') ->with($this->equalTo($linkMap['url'])) - ->will($this->returnValue($linkMap['id'])); + ->willReturn($linkMap['id']); } $versionInfo = new VersionInfo(); diff --git a/tests/lib/eZ/REST/FieldTypeProcessor/RichTextProcessorTest.php b/tests/lib/eZ/REST/FieldTypeProcessor/RichTextProcessorTest.php index 773c121f..36262d81 100644 --- a/tests/lib/eZ/REST/FieldTypeProcessor/RichTextProcessorTest.php +++ b/tests/lib/eZ/REST/FieldTypeProcessor/RichTextProcessorTest.php @@ -45,7 +45,7 @@ public function testPostProcessValueHash() ->expects($this->once()) ->method('convert') ->with($this->isInstanceOf('DOMDocument')) - ->will($this->returnValue($convertedDocument)); + ->willReturn($convertedDocument); $this->assertEquals( $processedOutputValue, diff --git a/tests/lib/eZ/RichText/Converter/LinkTest.php b/tests/lib/eZ/RichText/Converter/LinkTest.php index 4385d184..36ad0da6 100644 --- a/tests/lib/eZ/RichText/Converter/LinkTest.php +++ b/tests/lib/eZ/RichText/Converter/LinkTest.php @@ -222,12 +222,12 @@ public function testConvertLocationLink($input, $output, $locationId, $urlResolv $locationService->expects($this->once()) ->method('loadLocation') ->with($this->equalTo($locationId)) - ->will($this->returnValue($location)); + ->willReturn($location); $urlAliasRouter->expects($this->once()) ->method('generate') ->with($this->equalTo($location)) - ->will($this->returnValue($urlResolved)); + ->willReturn($urlResolved); $converter = new Link($locationService, $contentService, $urlAliasRouter); @@ -427,22 +427,22 @@ public function testConvertContentLink($input, $output, $contentId, $urlResolved $contentInfo->expects($this->once()) ->method('__get') ->with($this->equalTo('mainLocationId')) - ->will($this->returnValue($locationId)); + ->willReturn($locationId); $contentService->expects($this->any()) ->method('loadContentInfo') ->with($this->equalTo($contentId)) - ->will($this->returnValue($contentInfo)); + ->willReturn($contentInfo); $locationService->expects($this->once()) ->method('loadLocation') ->with($this->equalTo($locationId)) - ->will($this->returnValue($location)); + ->willReturn($location); $urlAliasRouter->expects($this->once()) ->method('generate') ->with($this->equalTo($location)) - ->will($this->returnValue($urlResolved)); + ->willReturn($urlResolved); $converter = new Link($locationService, $contentService, $urlAliasRouter); diff --git a/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php b/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php index 9146d38e..fdfd0c53 100644 --- a/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php +++ b/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php @@ -494,7 +494,7 @@ public function testConvert($xmlString, $expectedXmlString, array $errors, array ], $params['is_inline'] ) - ->will($this->returnValue($params['id'])); + ->willReturn($params['id']); } } else { $this->rendererMock->expects($this->never())->method('renderContentEmbed'); diff --git a/tests/lib/eZ/RichText/Converter/Render/TemplateTest.php b/tests/lib/eZ/RichText/Converter/Render/TemplateTest.php index 097d8069..e448e94d 100644 --- a/tests/lib/eZ/RichText/Converter/Render/TemplateTest.php +++ b/tests/lib/eZ/RichText/Converter/Render/TemplateTest.php @@ -107,7 +107,7 @@ public function testConvert(DOMDocument $inputDocument, DOMDocument $expectedOut ->expects($this->at($convertIndex++)) ->method('convert') ->with($contentDoc) - ->will($this->returnValue($contentDoc)); + ->willReturn($contentDoc); } $this->rendererMock @@ -119,7 +119,7 @@ public function testConvert(DOMDocument $inputDocument, DOMDocument $expectedOut $params['params'], $params['is_inline'] ) - ->will($this->returnValue($params['name'])); + ->willReturn($params['name']); } } else { $this->rendererMock->expects($this->never())->method('renderTemplate');