/** * @param \Rawebone\Ormish\Table $tbl * @param \Rawebone\Ormish\SqlGeneratorInterface $gen * @param \Rawebone\Ormish\Executor $ex */ function it_should_include_additional_params($tbl, $gen, $ex) { $tbl->table()->willReturn("table"); $gen->findWhere("table", "a = ?")->willReturn("query"); $ex->query("query", array(1))->willThrow(new ExecutionException("", "", "", array())); $this->run("a = ?", 1)->shouldReturn(array()); }
/** * @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); }