public function testCollectData()
 {
     $this->builder->add('id', 'text');
     $this->builder->add('name', 'text', array('format' => '#%s!', 'title' => 'name'));
     $table = $this->builder->getTable();
     $valueExporter = new ValueExporter();
     $dataCollector = new TableDataCollector($valueExporter);
     $this->resolvedOptions['_passed_options'] = array('a' => 1, 'b' => 'x');
     $dataCollector->collectData($table, null, $this->resolvedOptions);
     $tables = $dataCollector->getTables();
     $expected = array('query' => '[page => 1, sort => 0, limit => 10, filter => null]', 'total' => 23, 'rows 0' => '[id => 1, name => Aquitaine]', 'rows 1' => '[id => 2, name => Auvergne]', 'rows 2' => '[id => 3, name => Bourgogne]', 'rows 3' => '[id => 4, name => Bretagne]', 'rows 4' => '[id => 5, name => Centre]', 'rows 5' => '[id => 6, name => Champagne Ardenne]', 'rows 6' => '[id => 7, name => Corse]', 'rows 7' => '[id => 8, name => DOM/TOM]', 'rows 8' => '[id => 9, name => Franche Comté]', 'rows 9' => '[id => 10, name => Ile de France]', 'rows 10' => '[id => 11, name => Languedoc Roussillon]', '...' => '', 'rows 20' => '[id => 22, name => Rhône Alpes]', 'rows 21' => '[id => 23, name => Alsace]', 'rows 22' => '[id => 24, name => Basse-Normandie]');
     $this->assertEquals($expected, $tables['test']['query_result']);
 }
 public function onPostSetData(TablePostSetDataEvent $event)
 {
     $this->dataCollector->collectData($event->getTable(), $event->getData(), $event->getOptions());
 }