mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
Improve test coverage.
This commit is contained in:
@@ -57,7 +57,7 @@ class MassControllerTest extends TestCase
|
||||
$repository->shouldReceive('find')->andReturnValues([$deposits[0], $deposits[1]])->times(2);
|
||||
$repository->shouldReceive('delete')->times(2);
|
||||
|
||||
$this->session(['transactions.mass-delete.url' => 'http://localhost']);
|
||||
$this->session(['transactions.mass-delete.uri' => 'http://localhost']);
|
||||
|
||||
$data = [
|
||||
'confirm_mass_delete' => $depositIds,
|
||||
@@ -176,7 +176,7 @@ class MassControllerTest extends TestCase
|
||||
$repository->shouldReceive('find')->once()->andReturn($deposit);
|
||||
|
||||
|
||||
$this->session(['transactions.mass-edit.url' => 'http://localhost']);
|
||||
$this->session(['transactions.mass-edit.uri' => 'http://localhost']);
|
||||
|
||||
$data = [
|
||||
'journals' => [$deposit->id],
|
||||
|
||||
@@ -93,7 +93,7 @@ class SingleControllerTest extends TestCase
|
||||
$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('delete')->once();
|
||||
|
||||
$this->session(['transactions.delete.url' => 'http://localhost']);
|
||||
$this->session(['transactions.delete.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->whereNull('deleted_at')->where('user_id', $this->user()->id)->first();
|
||||
$response = $this->post(route('transactions.destroy', [$withdrawal->id]));
|
||||
@@ -198,7 +198,7 @@ class SingleControllerTest extends TestCase
|
||||
$journal->description = 'New journal';
|
||||
$repository->shouldReceive('store')->andReturn($journal);
|
||||
$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$this->session(['transactions.create.url' => 'http://localhost']);
|
||||
$this->session(['transactions.create.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
|
||||
$data = [
|
||||
@@ -242,7 +242,7 @@ class SingleControllerTest extends TestCase
|
||||
$attachmentRepo->shouldReceive('getMessages')->andReturn($messages);
|
||||
|
||||
|
||||
$this->session(['transactions.create.url' => 'http://localhost']);
|
||||
$this->session(['transactions.create.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
|
||||
$data = [
|
||||
@@ -281,7 +281,7 @@ class SingleControllerTest extends TestCase
|
||||
$repository->shouldReceive('update')->andReturn($journal);
|
||||
$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);
|
||||
|
||||
$this->session(['transactions.edit.url' => 'http://localhost']);
|
||||
$this->session(['transactions.edit.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$data = [
|
||||
'id' => 123,
|
||||
|
||||
@@ -111,7 +111,7 @@ class SplitControllerTest extends TestCase
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
$this->session(['transactions.edit-split.url' => 'http://localhost']);
|
||||
$this->session(['transactions.edit-split.uri' => 'http://localhost']);
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = [
|
||||
'id' => $deposit->id,
|
||||
@@ -158,7 +158,7 @@ class SplitControllerTest extends TestCase
|
||||
*/
|
||||
public function testUpdateOpeningBalance()
|
||||
{
|
||||
$this->session(['transactions.edit-split.url' => 'http://localhost']);
|
||||
$this->session(['transactions.edit-split.uri' => 'http://localhost']);
|
||||
$opening = TransactionJournal::where('transaction_type_id', 4)->where('user_id', $this->user()->id)->first();
|
||||
$data = [
|
||||
'id' => $opening->id,
|
||||
|
||||
Reference in New Issue
Block a user