mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Route fixes and fix tests.
This commit is contained in:
@@ -166,7 +166,6 @@ class ShowControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ShowController
|
||||
* @expectedExceptionMessage Expected a transaction
|
||||
*/
|
||||
public function testShowBrokenInitial(): void
|
||||
{
|
||||
@@ -180,7 +179,9 @@ class ShowControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$account = $this->user()->accounts()->where('account_type_id', 6)->orderBy('id', 'ASC')->whereNull('deleted_at')->first();
|
||||
$response = $this->get(route('accounts.show', [$account->id]));
|
||||
$response->assertStatus(500);
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirect(route('index'));
|
||||
$response->assertSessionHas('error');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -220,18 +220,10 @@ class IndexControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection);
|
||||
|
||||
$repository->shouldReceive('cleanupBudgets');
|
||||
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
|
||||
$repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
|
||||
$repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
|
||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
|
||||
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('budgets.index', ['Hello-there']));
|
||||
$response->assertStatus(200);
|
||||
// has bread crumb
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
$response->assertStatus(404);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ class ExportControllerTest extends TestCase
|
||||
$repository = $this->mock(ExportJobRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('changeStatus')->once();
|
||||
|
||||
|
||||
$repository->shouldReceive('exists')->once()->andReturn(true);
|
||||
$repository->shouldReceive('getContent')->once()->andReturn('Some content beep boop');
|
||||
|
||||
@@ -100,7 +100,7 @@ class CreateControllerTest extends TestCase
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('store')->andReturn(new Rule);
|
||||
$repository->shouldReceive('find')->withArgs([0])->andReturn(new Rule)->once();
|
||||
//$repository->shouldReceive('find')->withArgs([0])->andReturn(new Rule)->once();
|
||||
|
||||
$this->session(['rules.create.uri' => 'http://localhost']);
|
||||
$data = [
|
||||
|
||||
@@ -106,7 +106,6 @@ class EditControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$rule = Rule::find(1);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('find')->withArgs([1])->andReturn($rule)->once();
|
||||
$repository->shouldReceive('update');
|
||||
|
||||
$data = [
|
||||
|
||||
@@ -229,6 +229,7 @@ class SingleControllerTest extends TestCase
|
||||
$attRepos = $this->mock(AttachmentHelperInterface::class);
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$account = $this->user()->accounts()->first();
|
||||
|
||||
@@ -272,6 +273,7 @@ class SingleControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection)->once();
|
||||
|
||||
@@ -318,6 +320,7 @@ class SingleControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
|
||||
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection)->once();
|
||||
@@ -390,6 +393,7 @@ class SingleControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
|
||||
$this->be($this->user());
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)
|
||||
@@ -439,6 +443,7 @@ class SingleControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
|
||||
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection)->once();
|
||||
@@ -487,6 +492,7 @@ class SingleControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
|
||||
$account = $this->user()->accounts()->first();
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection)->once();
|
||||
@@ -528,6 +534,7 @@ class SingleControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('setUser')->once();
|
||||
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection)->once();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user