示例#1
0
 /**
  * @param \Rawebone\Ormish\Table $tbl
  * @param \Rawebone\Ormish\SqlGeneratorInterface $gen
  * @param \Rawebone\Ormish\Executor $ex
  * @param \Rawebone\Ormish\Utilities\Populater $pop
  */
 function it_should_return_null_if_no_records_returned($tbl, $gen, $ex, $pop, \PDOStatement $stmt)
 {
     $tbl->table()->willReturn("table");
     $tbl->id()->willReturn("id");
     $tbl->model()->willReturn("Entity");
     $tbl->readOnly()->willReturn(true);
     $gen->find("table", "id")->willReturn("query");
     $ex->query("query", array(1))->willReturn($stmt);
     $pop->populate($stmt, "Entity")->willReturn(array());
     $this->run(1)->shouldReturn(null);
 }