mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Improve test coverage.
This commit is contained in:
@@ -75,7 +75,7 @@ class AddTagTest extends TestCase
|
||||
*/
|
||||
public function testActNoTag(): void
|
||||
{
|
||||
$newTagName = 'TestTag-' . random_int(1, 10000);
|
||||
$newTagName = 'TestTag-' . $th;
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = $newTagName;
|
||||
|
||||
@@ -59,7 +59,7 @@ class ConvertToDepositTest extends TestCase
|
||||
|
||||
return;
|
||||
$revenue = $this->getRandomRevenue();
|
||||
$name = 'Random revenue #' . random_int(1, 10000);
|
||||
$name = 'Random revenue #' . $this->randomInt();
|
||||
$journal = $this->getRandomTransfer();
|
||||
|
||||
// journal is a transfer:
|
||||
@@ -98,7 +98,7 @@ class ConvertToDepositTest extends TestCase
|
||||
|
||||
return;
|
||||
$revenue = $this->getRandomRevenue();
|
||||
$name = 'Random revenue #' . random_int(1, 10000);
|
||||
$name = 'Random revenue #' . $this->randomInt();
|
||||
$journal = $this->getRandomWithdrawal();
|
||||
|
||||
// journal is a withdrawal:
|
||||
|
||||
@@ -59,7 +59,7 @@ class ConvertToWithdrawalTest extends TestCase
|
||||
|
||||
return;
|
||||
$expense = $this->getRandomExpense();
|
||||
$name = 'Random expense #' . random_int(1, 10000);
|
||||
$name = 'Random expense #' . $this->randomInt();
|
||||
$deposit = $this->getRandomDeposit();
|
||||
|
||||
// journal is a deposit:
|
||||
@@ -98,7 +98,7 @@ class ConvertToWithdrawalTest extends TestCase
|
||||
|
||||
return;
|
||||
$expense = $this->getRandomExpense();
|
||||
$name = 'Random expense #' . random_int(1, 10000);
|
||||
$name = 'Random expense #' . $this->randomInt();
|
||||
$transfer = $this->getRandomTransfer();
|
||||
|
||||
// journal is a transfer:
|
||||
|
||||
@@ -38,7 +38,7 @@ class PrependDescriptionTest extends TestCase
|
||||
public function testAct(): void
|
||||
{
|
||||
// get journal, give fixed description
|
||||
$description = 'text' . random_int(1, 10000);
|
||||
$description = 'text' . $this->randomInt();
|
||||
$prepend = 'prepend' . random_int(1, 1234);
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$journal->description = $description;
|
||||
|
||||
@@ -38,7 +38,7 @@ class SetDescriptionTest extends TestCase
|
||||
public function testAct(): void
|
||||
{
|
||||
// get journal, give fixed description
|
||||
$description = 'text' . random_int(1, 10000);
|
||||
$description = 'text' . $this->randomInt();
|
||||
$newDescription = 'new description' . random_int(1, 1234);
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$journal->description = $description;
|
||||
|
||||
@@ -94,7 +94,7 @@ class SetDestinationAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Not existing asset account #' . random_int(1, 10000);
|
||||
$ruleAction->action_value = 'Not existing asset account #' . $this->randomInt();
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($deposit);
|
||||
$this->assertFalse($result);
|
||||
@@ -121,7 +121,7 @@ class SetDestinationAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Not existing expense account #' . random_int(1, 10000);
|
||||
$ruleAction->action_value = 'Not existing expense account #' . $this->randomInt();
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($withdrawal);
|
||||
|
||||
@@ -186,7 +186,7 @@ class SetDestinationAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new asset ' . random_int(1, 10000);
|
||||
$ruleAction->action_value = 'Some new asset ' . $this->randomInt();
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
|
||||
@@ -93,7 +93,7 @@ class SetSourceAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new revenue #' . random_int(1, 10000);
|
||||
$ruleAction->action_value = 'Some new revenue #' . $this->randomInt();
|
||||
$action = new SetSourceAccount($ruleAction);
|
||||
$result = $action->act($deposit);
|
||||
$this->assertTrue($result);
|
||||
@@ -155,7 +155,7 @@ class SetSourceAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new account #' . random_int(1, 10000);
|
||||
$ruleAction->action_value = 'Some new account #' . $this->randomInt();
|
||||
$action = new SetSourceAccount($ruleAction);
|
||||
$result = $action->act($withdrawal);
|
||||
$this->assertFalse($result);
|
||||
@@ -181,7 +181,7 @@ class SetSourceAccountTest extends TestCase
|
||||
$accountRepos->shouldReceive('setUser');
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new asset ' . random_int(1, 10000);
|
||||
$ruleAction->action_value = 'Some new asset ' . $this->randomInt();
|
||||
$action = new SetSourceAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
|
||||
Reference in New Issue
Block a user