Example #1
0
 public function testGetExportFields()
 {
     $admin = new PostAdmin('sonata.post.admin.post', 'NewsBundle\\Entity\\Post', 'SonataNewsBundle:PostAdmin');
     $modelManager = $this->getMock('Sonata\\AdminBundle\\Model\\ModelManagerInterface');
     $modelManager->expects($this->once())->method('getExportFields')->with($this->equalTo('NewsBundle\\Entity\\Post'))->will($this->returnValue(array('foo', 'bar')));
     $admin->setModelManager($modelManager);
     $this->assertSame(array('foo', 'bar'), $admin->getExportFields());
 }