Fix tests.

This commit is contained in:
James Cole 2018-01-10 20:07:47 +01:00
parent 309f9cd076
commit 0ae8418f32
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 10 additions and 9 deletions

View File

@ -43,7 +43,6 @@ class CsvProcessorTest extends TestCase
*/ */
public function testGetObjectsNoJob() public function testGetObjectsNoJob()
{ {
$processor = new CsvProcessor(); $processor = new CsvProcessor();
$processor->getObjects(); $processor->getObjects();
} }
@ -137,11 +136,13 @@ class CsvProcessorTest extends TestCase
$repository->shouldReceive('setUser')->withArgs([Mockery::any()])->once(); $repository->shouldReceive('setUser')->withArgs([Mockery::any()])->once();
$repository->shouldReceive('getConfiguration')->andReturn($config); $repository->shouldReceive('getConfiguration')->andReturn($config);
$repository->shouldReceive('uploadFileContents')->withArgs([Mockery::any()])->andReturn($csvFile)->once(); $repository->shouldReceive('uploadFileContents')->withArgs([Mockery::any()])->andReturn($csvFile)->once();
$repository->shouldReceive('getExtendedStatus')->twice()->andReturn([]); // twice for update errors. $repository->shouldReceive('getExtendedStatus')->once()->andReturn([]); // twice for update errors.
$repository->shouldReceive('setExtendedStatus')->twice()->andReturn($job); $repository->shouldReceive('setExtendedStatus')->once()->andReturn($job);
// mock stuff for this single row: // mock stuff for this single row:
$repository->shouldReceive('countByHash')->once()->withArgs([Mockery::any()])->andReturn(1); $repository->shouldReceive('countByHash')->once()->withArgs([Mockery::any()])->andReturn(1);
$repository->shouldReceive('addStepsDone')->once()->withArgs([Mockery::any(), 5]); $repository->shouldReceive('addStepsDone')->once()->withArgs([Mockery::any(), 5]);
$repository->shouldReceive('addError')->once()->withArgs([Mockery::any(), 0, 'Row #0 has already been imported.']);
$processor = new CsvProcessor(); $processor = new CsvProcessor();
$processor->setJob($job); $processor->setJob($job);
$processor->run(); $processor->run();

View File

@ -309,7 +309,7 @@ class BinderTest extends TestCase
public function testBudgetLimit() public function testBudgetLimit()
{ {
Route::middleware(Binder::class)->any( Route::middleware(Binder::class)->any(
'/_test/binder/{budgetlimit}', function () { '/_test/binder/{budgetLimit}', function () {
return 'OK'; return 'OK';
} }
); );
@ -328,7 +328,7 @@ class BinderTest extends TestCase
public function testBudgetLimitNotFound() public function testBudgetLimitNotFound()
{ {
Route::middleware(Binder::class)->any( Route::middleware(Binder::class)->any(
'/_test/binder/{budgetlimit}', function () { '/_test/binder/{budgetLimit}', function () {
return 'OK'; return 'OK';
} }
); );
@ -347,7 +347,7 @@ class BinderTest extends TestCase
public function testBudgetLimitNotLoggedIn() public function testBudgetLimitNotLoggedIn()
{ {
Route::middleware(Binder::class)->any( Route::middleware(Binder::class)->any(
'/_test/binder/{budgetlimit}', function () { '/_test/binder/{budgetLimit}', function () {
return 'OK'; return 'OK';
} }
); );
@ -1423,7 +1423,7 @@ class BinderTest extends TestCase
public function testTransactionType() public function testTransactionType()
{ {
Route::middleware(Binder::class)->any( Route::middleware(Binder::class)->any(
'/_test/binder/{transaction_type}', function () { '/_test/binder/{transactionType}', function () {
return 'OK'; return 'OK';
} }
); );
@ -1442,7 +1442,7 @@ class BinderTest extends TestCase
public function testTransactionTypeNotFound() public function testTransactionTypeNotFound()
{ {
Route::middleware(Binder::class)->any( Route::middleware(Binder::class)->any(
'/_test/binder/{transaction_type}', function () { '/_test/binder/{transactionType}', function () {
return 'OK'; return 'OK';
} }
); );
@ -1461,7 +1461,7 @@ class BinderTest extends TestCase
public function testTransactionTypeNotLoggedIn() public function testTransactionTypeNotLoggedIn()
{ {
Route::middleware(Binder::class)->any( Route::middleware(Binder::class)->any(
'/_test/binder/{transaction_type}', function () { '/_test/binder/{transactionType}', function () {
return 'OK'; return 'OK';
} }
); );