Exemplo n.º 1
0
 public function testDataSourceWithOptions()
 {
     $options = $sortedOptions = ['foo' => 'bar', 'baz' => 'bat'];
     ksort($sortedOptions);
     $this->dataSourceBuilder->expects($this->once())->method('createDataSource')->with($this->identicalTo($sortedOptions))->will($this->returnValue($dataSource = $this->createDataSourceMock()));
     $this->assertSame($dataSource, $this->view->getDataSource($options));
     $this->assertSame($dataSource, $this->view->getDataSource($sortedOptions));
 }
Exemplo n.º 2
0
 /**
  * @param GridInterface              $definition
  * @param DataSourceBuilderInterface $dataSourceBuilder
  * @param FormView                   $form
  * @param FormView                   $batchForm
  */
 public function __construct(GridInterface $definition, DataSourceBuilderInterface $dataSourceBuilder, FormView $form = null, FormView $batchForm = null)
 {
     parent::__construct($definition, $dataSourceBuilder);
     $this->setForm($form);
     $this->setBatchForm($batchForm);
 }