public function testhistoryCompareRevisionsActionAction()
 {
     $this->request->query->set('id', 123);
     $this->admin->expects($this->once())->method('isGranted')->with($this->equalTo('EDIT'))->will($this->returnValue(true));
     $object = new \stdClass();
     $this->admin->expects($this->once())->method('getObject')->will($this->returnValue($object));
     $this->admin->expects($this->any())->method('getClass')->will($this->returnValue('Foo'));
     $this->auditManager->expects($this->once())->method('hasReader')->with($this->equalTo('Foo'))->will($this->returnValue(true));
     $reader = $this->getMock('Sonata\\AdminBundle\\Model\\AuditReaderInterface');
     $this->auditManager->expects($this->once())->method('getReader')->with($this->equalTo('Foo'))->will($this->returnValue($reader));
     $objectRevision = new \stdClass();
     $objectRevision->revision = 456;
     $compareObjectRevision = new \stdClass();
     $compareObjectRevision->revision = 789;
     $reader->expects($this->at(0))->method('find')->with($this->equalTo('Foo'), $this->equalTo(123), $this->equalTo(456))->will($this->returnValue($objectRevision));
     $reader->expects($this->at(1))->method('find')->with($this->equalTo('Foo'), $this->equalTo(123), $this->equalTo(789))->will($this->returnValue($compareObjectRevision));
     $this->admin->expects($this->once())->method('setSubject')->with($this->equalTo($objectRevision))->will($this->returnValue(null));
     $fieldDescriptionCollection = new FieldDescriptionCollection();
     $this->admin->expects($this->once())->method('getShow')->will($this->returnValue($fieldDescriptionCollection));
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $this->controller->historyCompareRevisionsAction(123, 456, 789));
     $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->assertSame($objectRevision, $this->parameters['object']);
     $this->assertSame($compareObjectRevision, $this->parameters['object_compare']);
     $this->assertSame($fieldDescriptionCollection, $this->parameters['elements']);
     $this->assertSame(array(), $this->session->getFlashBag()->all());
     $this->assertSame('SonataAdminBundle:CRUD:show_compare.html.twig', $this->template);
 }
 /**
  * Gets the 'sonata.admin.audit.manager' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Sonata\AdminBundle\Model\AuditManager A Sonata\AdminBundle\Model\AuditManager instance.
  */
 protected function getSonata_Admin_Audit_ManagerService()
 {
     $this->services['sonata.admin.audit.manager'] = $instance = new \Sonata\AdminBundle\Model\AuditManager($this);
     $instance->setReader('sonata.admin.audit.orm.reader', array(0 => 'Test\\TaskBundle\\Entity\\Category', 1 => 'Test\\TaskBundle\\Entity\\Product', 2 => 'Application\\Sonata\\UserBundle\\Entity\\User', 3 => 'Application\\Sonata\\UserBundle\\Entity\\Group', 4 => 'Application\\Sonata\\PageBundle\\Entity\\Page', 5 => 'Application\\Sonata\\PageBundle\\Entity\\Block', 7 => 'Application\\Sonata\\PageBundle\\Entity\\Snapshot', 8 => 'Application\\Sonata\\PageBundle\\Entity\\Site', 9 => 'Application\\Sonata\\NewsBundle\\Entity\\Post', 10 => 'Application\\Sonata\\NewsBundle\\Entity\\Comment', 11 => 'Application\\Sonata\\MediaBundle\\Entity\\Media', 12 => 'Application\\Sonata\\MediaBundle\\Entity\\Gallery', 13 => 'Application\\Sonata\\MediaBundle\\Entity\\GalleryHasMedia', 14 => 'Application\\Sonata\\CustomerBundle\\Entity\\Customer', 15 => 'Application\\Sonata\\CustomerBundle\\Entity\\Address', 16 => 'Application\\Sonata\\InvoiceBundle\\Entity\\Invoice', 17 => 'Application\\Sonata\\OrderBundle\\Entity\\Order', 18 => 'Application\\Sonata\\OrderBundle\\Entity\\OrderElement', 19 => 'Application\\Sonata\\ProductBundle\\Entity\\Product', 21 => 'Application\\Sonata\\ProductBundle\\Entity\\ProductCategory', 22 => 'Application\\Sonata\\ProductBundle\\Entity\\ProductCollection', 23 => 'Application\\Sonata\\ProductBundle\\Entity\\Delivery', 24 => 'Application\\Sonata\\CommentBundle\\Entity\\Comment', 25 => 'Application\\Sonata\\CommentBundle\\Entity\\Thread', 26 => 'Application\\Sonata\\ClassificationBundle\\Entity\\Category', 27 => 'Application\\Sonata\\ClassificationBundle\\Entity\\Tag', 28 => 'Application\\Sonata\\ClassificationBundle\\Entity\\Collection', 29 => 'Application\\Sonata\\NotificationBundle\\Entity\\Message', 30 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Car', 31 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Engine', 32 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Inspection', 33 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Color', 34 => 'Sonata\\Bundle\\DemoBundle\\Entity\\Material'));
     return $instance;
 }