Skip to content

Commit

Permalink
Fix build (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 authored and greg0ire committed Oct 12, 2017
1 parent 3100b67 commit 3869601
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Tests/Controller/GalleryAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,15 @@ private function configureSetFormTheme($formView, $formTheme)
private function configureRender($template, $data, $rendered)
{
$templating = $this->prophesize('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
$response = $this->prophesize('Symfony\Component\HttpFoundation\Response');
$pool = $this->prophesize('Sonata\MediaBundle\Provider\Pool');

$this->admin->getPersistentParameters()->willReturn(array('param' => 'param'));
$this->container->has('templating')->willReturn(true);
$this->container->get('templating')->willReturn($templating->reveal());
$this->container->get('sonata.media.pool')->willReturn($pool->reveal());
$templating->renderResponse($template, $data, null)->willReturn($rendered);
$response->getContent()->willReturn($rendered);
$templating->renderResponse($template, $data, null)->willReturn($response->reveal());
$templating->render($template, $data)->willReturn($rendered);
}
}
14 changes: 10 additions & 4 deletions Tests/Controller/MediaAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public function testCreateActionToSelectProvider()

$response = $this->controller->createAction($this->request->reveal());

$this->assertSame('renderResponse', $response);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertSame('renderResponse', $response->getContent());
}

public function testCreateAction()
Expand All @@ -72,7 +73,8 @@ public function testCreateAction()

$response = $this->controller->createAction($this->request->reveal());

$this->assertSame('renderResponse', $response);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertSame('renderResponse', $response->getContent());
}

public function testListAction()
Expand Down Expand Up @@ -115,7 +117,8 @@ public function testListAction()

$response = $this->controller->listAction($this->request->reveal());

$this->assertSame('renderResponse', $response);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertSame('renderResponse', $response->getContent());
}

private function configureCRUDController()
Expand Down Expand Up @@ -216,12 +219,15 @@ private function configureSetCsrfToken($intention)
private function configureRender($template, $data, $rendered)
{
$templating = $this->prophesize('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
$response = $this->prophesize('Symfony\Component\HttpFoundation\Response');
$pool = $this->prophesize('Sonata\MediaBundle\Provider\Pool');

$this->admin->getPersistentParameters()->willReturn(array('param' => 'param'));
$this->container->has('templating')->willReturn(true);
$this->container->get('templating')->willReturn($templating->reveal());
$this->container->get('sonata.media.pool')->willReturn($pool->reveal());
$templating->renderResponse($template, $data, null)->willReturn($rendered);
$response->getContent()->willReturn($rendered);
$templating->renderResponse($template, $data, null)->willReturn($response->reveal());
$templating->render($template, $data)->willReturn($rendered);
}
}
9 changes: 7 additions & 2 deletions Tests/Controller/MediaControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public function testViewActionRendersView()

$response = $this->controller->viewAction(1, 'format');

$this->assertSame('renderResponse', $response);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertSame('renderResponse', $response->getContent());
}

private function configureDownloadSecurity($pool, $media, $request, $isGranted)
Expand Down Expand Up @@ -162,9 +163,13 @@ private function configureGetCurrentRequest($request)
private function configureRender($template, $data, $rendered)
{
$templating = $this->prophesize('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
$response = $this->prophesize('Symfony\Component\HttpFoundation\Response');
$pool = $this->prophesize('Sonata\MediaBundle\Provider\Pool');

$this->container->has('templating')->willReturn(true);
$this->container->get('templating')->willReturn($templating->reveal());
$templating->renderResponse($template, $data, null)->willReturn($rendered);
$response->getContent()->willReturn($rendered);
$templating->renderResponse($template, $data, null)->willReturn($response->reveal());
$templating->render($template, $data)->willReturn($rendered);
}
}

0 comments on commit 3869601

Please sign in to comment.