Esempio n. 1
0
 public function testWhenIRenderStringsCollectionIGetAnHtmlTableWithStrings()
 {
     $collection = new Collection(ArrayDataProvider::getQuarksData());
     $schema = ArrayDataProvider::getQuarksSchema();
     $grid = $this->getFactory()->createGrid($collection, array('schema' => $schema));
     $html = $this->getTwig()->render('{{ datagrid(grid) }}', array('grid' => $grid));
     $this->assertFixtureEquals(__DIR__ . '/quarks.html', $html);
 }
Esempio n. 2
0
 public function testWhenISetupRouteActionsIGetRouteLinksInTable()
 {
     $collection = new Collection(ArrayDataProvider::getQuarksData());
     $schema = ArrayDataProvider::getQuarksSchema();
     $actions = Actions::enable()->addGlobalRoute('create', 'quarks_create')->addEntityRoute('read', 'quarks_read', array('id' => 'id'))->addEntityRoute('update', 'quarks_update', array('id' => 'id'))->addEntityRoute('delete', 'quarks_delete', array('id' => 'id'));
     $grid = $this->getFactory()->createGrid($collection, array('schema' => $schema, 'actions' => $actions));
     $html = $this->getTwig('router.html.twig', array(new RoutingExtension($this->getRouter(__DIR__, 'routing.yml'))))->render('{{ datagrid(grid) }}', array('grid' => $grid));
     $this->assertFixtureEquals(__DIR__ . '/quarks.html', $html);
 }