be($this->user());
$this->call('GET', route('export.download', ['testExport']));
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\ExportController::getStatus
*/
public function testGetStatus()
{
$this->be($this->user());
$this->call('GET', route('export.status', ['testExport']));
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\ExportController::index
*/
public function testIndex()
{
$this->be($this->user());
$this->call('GET', route('export.index'));
$this->assertResponseStatus(200);
// has bread crumb
$this->see('
');
}
/**
* @covers \FireflyIII\Http\Controllers\ExportController::postIndex
*/
public function testPostIndex()
{
$data = [
'export_start_range' => '2015-01-01',
'export_end_range' => '2015-01-21',
'exportFormat' => 'csv',
'accounts' => [1],
'job' => 'testExport',
];
$processor = $this->mock(Processor::class);
$processor->shouldReceive('collectJournals')->once();
$processor->shouldReceive('convertJournals')->once();
$processor->shouldReceive('exportJournals')->once();
$processor->shouldReceive('createZipFile')->once();
$this->be($this->user());
$this->call('post', route('export.export'), $data);
$this->assertResponseStatus(200);
$this->see('ok');
}
}