mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Go from get to post.
This commit is contained in:
@@ -131,8 +131,8 @@ class IndexControllerTest extends TestCase
|
||||
$repository = $this->mock(BudgetRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
|
||||
$date = new Carbon;
|
||||
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
|
||||
$date = new Carbon;
|
||||
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
|
||||
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
|
||||
|
||||
@@ -186,8 +186,8 @@ class IndexControllerTest extends TestCase
|
||||
$repository = $this->mock(BudgetRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
|
||||
$date = new Carbon;
|
||||
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
|
||||
$date = new Carbon;
|
||||
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
|
||||
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
|
||||
|
||||
@@ -239,8 +239,8 @@ class IndexControllerTest extends TestCase
|
||||
$repository = $this->mock(BudgetRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
|
||||
$date = new Carbon;
|
||||
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
|
||||
$date = new Carbon;
|
||||
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
|
||||
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
|
||||
|
||||
@@ -254,4 +254,25 @@ class IndexControllerTest extends TestCase
|
||||
$response = $this->get(route('budgets.index', ['Hello-there']));
|
||||
$response->assertStatus(404);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Budget\IndexController
|
||||
*/
|
||||
public function testReorder(): void
|
||||
{
|
||||
$repository = $this->mock(BudgetRepositoryInterface::class);
|
||||
$data = [
|
||||
'budgetIds' => [1,2],
|
||||
'page' => 1,
|
||||
];
|
||||
|
||||
$repository->shouldReceive('cleanupBudgets')->atLeast()->once();
|
||||
$repository->shouldReceive('findNull')->atLeast()->once()->andReturn(new Budget);
|
||||
$repository->shouldReceive('setBudgetOrder')->atLeast()->once();
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('budgets.reorder', $data));
|
||||
$response->assertStatus(200);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user