Ejemplo n.º 1
0
 public function testQueryWithPlaceholders()
 {
     $sql = "SELECT *\n\t\t\t\t\tFROM children\n\t\t\t\t\tWHERE parent_id = 1";
     $queryTable = $this->getConnection()->createQueryTable('parent_children', $sql);
     $result = $this->connection->query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM children\n\t\t\t\tWHERE parent_id = ?\n\t\t\t", array(1));
     $queryDataSet = new ArrayDataSet(array('parent_children' => $result->flatten()));
     $this->assertTablesEqual($queryDataSet->getTable('parent_children'), $queryTable);
 }
Ejemplo n.º 2
0
 protected function createTableFromResult(Result $result)
 {
     $dataSet = new ArrayDataSet(array('result_table' => $result->flatten()));
     return $dataSet->getTable('result_table');
 }