public function testShowAction() { $object = new \stdClass(); $this->admin->expects($this->once())->method('getObject')->will($this->returnValue($object)); $this->admin->expects($this->once())->method('isGranted')->with($this->equalTo('VIEW'))->will($this->returnValue(true)); $show = $this->getMock('Sonata\\AdminBundle\\Admin\\FieldDescriptionCollection'); $this->admin->expects($this->once())->method('getShow')->will($this->returnValue($show)); $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $this->controller->showAction()); $this->assertSame($this->admin, $this->parameters['admin']); $this->assertSame('SonataAdminBundle::standard_layout.html.twig', $this->parameters['base_template']); $this->assertSame($this->pool, $this->parameters['admin_pool']); $this->assertSame('show', $this->parameters['action']); $this->assertInstanceOf('Sonata\\AdminBundle\\Admin\\FieldDescriptionCollection', $this->parameters['elements']); $this->assertSame($object, $this->parameters['object']); $this->assertSame(array(), $this->session->getFlashBag()->all()); $this->assertSame('SonataAdminBundle:CRUD:show.html.twig', $this->template); }