mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 08:00:19 +00:00
Expand test coverage.
This commit is contained in:
@@ -22,9 +22,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\Controllers;
|
||||
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -46,7 +48,6 @@ class AttachmentControllerTest extends TestCase
|
||||
Log::debug(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\AttachmentController::delete
|
||||
*/
|
||||
@@ -133,6 +134,23 @@ class AttachmentControllerTest extends TestCase
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\AttachmentController
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
$repository = $this->mock(AttachmentRepositoryInterface::class);
|
||||
$repository->shouldReceive('get')->andReturn(new Collection([Attachment::first()]))->once();
|
||||
$repository->shouldReceive('exists')->andReturn(true)->once();
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('attachments.index'));
|
||||
$response->assertStatus(200);
|
||||
// has bread crumb
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\AttachmentController::update
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user