コード例 #1
0
ファイル: TableSessionTest.php プロジェクト: cwd/TableBundle
 /**
  * @expectedException \RuntimeException
  */
 public function testStoreException()
 {
     $type = $this->getMock('EMC\\TableBundle\\Table\\Type\\TableTypeInterface');
     $data = array(array(1), array(2));
     $options = array('x' => 3, 'y' => 'z');
     $this->tableSession->store($type, $data, $options);
 }
コード例 #2
0
ファイル: TableFactoryTest.php プロジェクト: cwd/TableBundle
 protected function setUp()
 {
     $this->entityManagerMock = $this->getMock('Doctrine\\Common\\Persistence\\ObjectManager');
     $this->eventDispatcherMock = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $this->tableSessionMock = $this->getMock('EMC\\TableBundle\\Session\\TableSessionInterface');
     $this->columnFactoryMock = $this->getMock('EMC\\TableBundle\\Table\\Column\\ColumnFactoryInterface');
     $this->exportRegistryMock = $this->getMock('EMC\\TableBundle\\Table\\Export\\ExportRegistryInterface');
     $this->factory = new TableFactory($this->entityManagerMock, $this->eventDispatcherMock, $this->tableSessionMock, $this->columnFactoryMock, $this->exportRegistryMock, $this->defaultOptions, $this->defaultColumnOptions);
     $this->fooType = new Type\FooType();
     $this->tableSessionMock->expects($this->any())->method('restore')->with($this->fooType->getId())->will($this->returnValue(array('class' => get_class($this->fooType), 'options' => array(), 'data' => null)));
 }
コード例 #3
0
ファイル: TableFactory.php プロジェクト: cwd/TableBundle
 /**
  * {@inheritdoc}
  */
 public function restore($tableId, array $params = array(), $mode = self::MODE_NORMAL)
 {
     $config = $this->tableSession->restore($tableId);
     return $this->load($config['class'], $config['data'], $config['options'], $params, $mode);
 }
コード例 #4
0
ファイル: TableListener.php プロジェクト: cwd/TableBundle
 public function onPreSetData(TablePreSetDataEvent $event)
 {
     $this->session->store($event->getTable()->getType(), $event->getData(), $event->getOptions());
 }