Fix tests

This commit is contained in:
James Cole
2016-12-25 12:55:22 +01:00
parent 7894f1871e
commit 82718a74dc
9 changed files with 101 additions and 24 deletions

View File

@@ -9,7 +9,7 @@
* See the LICENSE file for details.
*/
use FireflyIII\Export\Processor;
use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:41.
@@ -32,6 +32,10 @@ class ExportControllerTest extends TestCase
*/
public function testDownload()
{
$repository = $this->mock(ExportJobRepositoryInterface::class);
$repository->shouldReceive('exists')->once()->andReturn(true);
$repository->shouldReceive('getContent')->once()->andReturn('Some content beep boop');
$this->be($this->user());
$this->call('GET', route('export.download', ['testExport']));
$this->assertResponseStatus(200);

View File

@@ -10,7 +10,7 @@
*/
use FireflyIII\Import\Setup\CsvSetup;
use Illuminate\Http\UploadedFile;
use FireflyIII\Import\ImportProcedureInterface;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:41.
@@ -142,6 +142,11 @@ class ImportControllerTest extends TestCase
*/
public function testStart()
{
/** @var ImportProcedureInterface $procedure */
$procedure = $this->mock(ImportProcedureInterface::class);
$procedure->shouldReceive('runImport');
$this->be($this->user());
$this->call('post', route('import.start', ['complete']));
$this->assertResponseStatus(200);
@@ -156,7 +161,7 @@ class ImportControllerTest extends TestCase
// complete
$this->be($this->user());
$this->call('get', route('import.status', ['complete']));
$this->assertResponseStatus(302);
$this->assertResponseStatus(200);
}
/**