Example #1
0
 public function testFetchesArrayOfAllResults()
 {
     $driver = $this->getMock('Orno\\Db\\Driver\\Pdo');
     $results = [['id' => 1, 'col1' => 'value', 'col2' => 'value2'], ['id' => 2, 'col1' => 'value', 'col2' => 'value2'], ['id' => 3, 'col1' => 'value', 'col2' => 'value2']];
     $driver->expects($this->once())->method('fetchAll')->will($this->returnValue($results));
     $q = new Query($driver);
     $this->assertSame($results, $q->fetchAll());
 }