Skip to content

Commit

Permalink
[CS] Locked php-cs-fixer at v2.15.x and aligned codebase (#40)
Browse files Browse the repository at this point in the history
* [Composer] Locked php-cs-fixer at v2.15.x

* [CS] Applied php_unit_mock_short_will_return rule to the codebase

Modified files:
   1) tests/lib/eZ/REST/FieldTypeProcessor/RichTextProcessorTest.php (php_unit_mock_short_will_return)
   2) tests/lib/eZ/FieldType/RichText/RichTextStorageTest.php (php_unit_mock_short_will_return)
   3) tests/lib/eZ/RichText/Converter/Render/EmbedTest.php (php_unit_mock_short_will_return)
   4) tests/lib/eZ/RichText/Converter/Render/TemplateTest.php (php_unit_mock_short_will_return)
   5) tests/lib/eZ/RichText/Converter/LinkTest.php (php_unit_mock_short_will_return)
   6) tests/bundle/eZ/RichText/RendererTest.php (php_unit_mock_short_will_return)
  • Loading branch information
alongosz authored May 23, 2019
1 parent d6cd436 commit 6a15072
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
86 changes: 43 additions & 43 deletions tests/bundle/eZ/RichText/RendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -253,7 +253,7 @@ public function testRenderTagWithTemplate(
->expects($this->once())
->method('render')
->with($renderTemplate, $parameters)
->will($this->returnValue($renderResult));
->willReturn($renderResult);
}

if (!isset($templateEngineTemplate)) {
Expand All @@ -265,7 +265,7 @@ public function testRenderTagWithTemplate(
->expects($this->once())
->method('exists')
->with($templateEngineTemplate)
->will($this->returnValue(true));
->willReturn(true);
}

if (empty($configResolverParams)) {
Expand All @@ -282,7 +282,7 @@ public function testRenderTagWithTemplate(
->expects($this->at($i))
->method($method)
->with($namespace)
->will($this->returnValue($returnValue));
->willReturn($returnValue);
++$i;
}
}
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -802,7 +802,7 @@ public function testRenderContentWithTemplate(
->expects($this->once())
->method('render')
->with($renderTemplate, $parameters)
->will($this->returnValue($renderResult));
->willReturn($renderResult);
}

if (!isset($templateEngineTemplate)) {
Expand All @@ -814,7 +814,7 @@ public function testRenderContentWithTemplate(
->expects($this->once())
->method('exists')
->with($templateEngineTemplate)
->will($this->returnValue(true));
->willReturn(true);
}

if (empty($configResolverParams)) {
Expand All @@ -831,7 +831,7 @@ public function testRenderContentWithTemplate(
->expects($this->at($i))
->method($method)
->with($namespace)
->will($this->returnValue($returnValue));
->willReturn($returnValue);
++$i;
}
}
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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)) {
Expand All @@ -1330,7 +1330,7 @@ public function testRenderLocationWithTemplate(
->expects($this->once())
->method('render')
->with($renderTemplate, $parameters)
->will($this->returnValue($renderResult));
->willReturn($renderResult);
}

if (!isset($templateEngineTemplate)) {
Expand All @@ -1342,7 +1342,7 @@ public function testRenderLocationWithTemplate(
->expects($this->once())
->method('exists')
->with($templateEngineTemplate)
->will($this->returnValue(true));
->willReturn(true);
}

if (empty($configResolverParams)) {
Expand All @@ -1359,7 +1359,7 @@ public function testRenderLocationWithTemplate(
->expects($this->at($i))
->method($method)
->with($namespace)
->will($this->returnValue($returnValue));
->willReturn($returnValue);
++$i;
}
}
Expand Down
Loading

0 comments on commit 6a15072

Please sign in to comment.