Fix some tests. Won't fix all.

This commit is contained in:
James Cole 2016-04-06 19:44:42 +02:00
parent 250b2c2f53
commit 768d3bb3e8
3 changed files with 7 additions and 4 deletions

View File

@ -50,8 +50,7 @@ class PiggyBankController extends Controller
return Response::json($cache->get());
}
/** @var Collection $set */
$set = new Collection($repository->getEventSummarySet($piggyBank));
$set = $repository->getEventSummarySet($piggyBank);
$data = $this->generator->history($set);
$cache->store($data);

View File

@ -52,6 +52,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
public function destroy(PiggyBank $piggyBank): bool
{
$piggyBank->delete();
return true;
}
@ -62,7 +63,9 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
*/
public function getEventSummarySet(PiggyBank $piggyBank): Collection
{
return DB::table('piggy_bank_events')->where('piggy_bank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::raw('SUM(`amount`) AS `sum`')]);
$var = DB::table('piggy_bank_events')->where('piggy_bank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::raw('SUM(`amount`) AS `sum`')]);
return new Collection($var);
}
/**
@ -130,6 +133,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
$piggyBank->order = $order;
$piggyBank->save();
}
return true;
}

View File

@ -36,7 +36,7 @@ class CsvControllerTest extends TestCase
$data->shouldReceive('getRoles')->once()->andReturn([]);
$data->shouldReceive('getMap')->once()->andReturn([]);
$data->shouldReceive('hasHeaders')->once()->andReturn([]);
$data->shouldReceive('hasHeaders')->once()->andReturn(false);
$this->call('GET', '/csv/column_roles');