Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Apply latest cs rules
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed May 28, 2019
1 parent f34cd4f commit 03b6e2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions tests/Helper/FragmentHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public function testRender(): void
$fragment = $this->getFragmentMock();

// templating render must be called once
$this->templating->expects($this->once())->method('render')->will($this->returnValue('foo'));
$this->templating->expects($this->once())->method('render')->willReturn('foo');

$fragmentService = $this->createMock([FragmentServiceInterface::class, ExtraContentProviderInterface::class]);

$fragmentService->expects($this->once())->method('getTemplate')->will($this->returnValue('template.html.twig'));
$fragmentService->expects($this->once())->method('getExtraContent')->will($this->returnValue(['foo' => 'bar']));
$fragmentService->expects($this->once())->method('getTemplate')->willReturn('template.html.twig');
$fragmentService->expects($this->once())->method('getExtraContent')->willReturn(['foo' => 'bar']);

$this->fragmentHelper->setFragmentServices(['foo.bar' => $fragmentService]);
$this->fragmentHelper->render($fragment);
Expand All @@ -83,8 +83,8 @@ public function testRender(): void
private function getFragmentMock(): MockObject
{
$fragment = $this->createMock(FragmentInterface::class);
$fragment->expects($this->once())->method('getType')->will($this->returnValue('foo.bar'));
$fragment->expects($this->any())->method('getFields')->will($this->returnValue([]));
$fragment->expects($this->once())->method('getType')->willReturn('foo.bar');
$fragment->expects($this->any())->method('getFields')->willReturn([]);

return $fragment;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Twig/FragmentExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testRenderArticleFragment(): void
$article = $this->createMock(ArticleInterface::class);
$article->expects($this->any())
->method('getFragments')
->will($this->returnValue($fragments));
->willReturn($fragments);

// we expect only two calls
$this->fragmentHelper->expects($this->at(0))
Expand Down Expand Up @@ -109,10 +109,10 @@ protected function getFragmentMock(array $settings, bool $enabled = true): MockO
$fragment = $this->createMock(FragmentInterface::class);
$fragment->expects($this->any())
->method('getFields')
->will($this->returnValue($settings));
->willReturn($settings);
$fragment->expects($this->any())
->method('getEnabled')
->will($this->returnValue($enabled));
->willReturn($enabled);

return $fragment;
}
Expand Down

0 comments on commit 03b6e2b

Please sign in to comment.