Expand tests.

This commit is contained in:
James Cole
2018-02-28 15:50:00 +01:00
parent 28debb46be
commit 46f4fa1a7d
34 changed files with 987 additions and 403 deletions

View File

@@ -55,6 +55,7 @@ class IndexControllerTest extends TestCase
*/
public function testDownload()
{
$repository = $this->mock(ImportJobRepositoryInterface::class);
//$job = $this->user()->importJobs()->where('key', 'testImport')->first();
$this->be($this->user());
$response = $this->get(route('import.download', ['testImport']));
@@ -67,7 +68,7 @@ class IndexControllerTest extends TestCase
*/
public function testIndex()
{
$repository = $this->mock(ImportJobRepositoryInterface::class);
$this->be($this->user());
$response = $this->get(route('import.index'));
$response->assertStatus(200);
@@ -79,6 +80,7 @@ class IndexControllerTest extends TestCase
*/
public function testStart()
{
$repository = $this->mock(ImportJobRepositoryInterface::class);
$routine = $this->mock(FileRoutine::class);
$routine->shouldReceive('setJob')->once();
$routine->shouldReceive('run')->once()->andReturn(true);
@@ -94,6 +96,7 @@ class IndexControllerTest extends TestCase
*/
public function testStartFailed()
{
$repository = $this->mock(ImportJobRepositoryInterface::class);
$routine = $this->mock(FileRoutine::class);
$routine->shouldReceive('setJob')->once();
$routine->shouldReceive('run')->once()->andReturn(false);