mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Push updated tests.
This commit is contained in:
@@ -59,7 +59,7 @@ class AddTagTest extends TestCase
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'TestTag-' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'TestTag-' . random_int(1, 1000);
|
||||
$action = new AddTag($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
@@ -39,8 +39,8 @@ class PrependDescriptionTest extends TestCase
|
||||
public function testAct()
|
||||
{
|
||||
// get journal, give fixed description
|
||||
$description = 'text' . rand(1, 1000);
|
||||
$prepend = 'prepend' . rand(1, 1234);
|
||||
$description = 'text' . random_int(1, 1000);
|
||||
$prepend = 'prepend' . random_int(1, 1234);
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$journal->description = $description;
|
||||
$journal->save();
|
||||
|
||||
@@ -57,7 +57,7 @@ class RemoveTagTest extends TestCase
|
||||
foreach ($journal->tags()->get() as $tag) {
|
||||
$this->assertNotEquals($firstTag->id, $tag->id);
|
||||
}
|
||||
$this->assertEquals(($originalCount - 1), $journal->tags()->count());
|
||||
$this->assertEquals($originalCount - 1, $journal->tags()->count());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ class RemoveTagTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = rand(1, 1234) . 'nosuchtag';
|
||||
$ruleAction->action_value = random_int(1, 1234) . 'nosuchtag';
|
||||
$action = new RemoveTag($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
@@ -39,8 +39,8 @@ class SetDescriptionTest extends TestCase
|
||||
public function testAct()
|
||||
{
|
||||
// get journal, give fixed description
|
||||
$description = 'text' . rand(1, 1000);
|
||||
$newDescription = 'new description' . rand(1, 1234);
|
||||
$description = 'text' . random_int(1, 1000);
|
||||
$newDescription = 'new description' . random_int(1, 1234);
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$journal->description = $description;
|
||||
$journal->save();
|
||||
|
||||
@@ -103,7 +103,7 @@ class SetDestinationAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Not existing asset account #' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'Not existing asset account #' . random_int(1, 1000);
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
@@ -134,7 +134,7 @@ class SetDestinationAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Not existing expense account #' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'Not existing expense account #' . random_int(1, 1000);
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
|
||||
@@ -202,7 +202,7 @@ class SetDestinationAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new asset ' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'Some new asset ' . random_int(1, 1000);
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
|
||||
@@ -52,7 +52,7 @@ class SetNotesTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'These are new notes ' . rand(1, 1234);
|
||||
$ruleAction->action_value = 'These are new notes ' . random_int(1, 1234);
|
||||
$action = new SetNotes($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertTrue($result);
|
||||
@@ -75,7 +75,7 @@ class SetNotesTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'These are new notes ' . rand(1, 1234);
|
||||
$ruleAction->action_value = 'These are new notes ' . random_int(1, 1234);
|
||||
$action = new SetNotes($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
@@ -104,7 +104,7 @@ class SetSourceAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new revenue #' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'Some new revenue #' . random_int(1, 1000);
|
||||
$action = new SetSourceAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertTrue($result);
|
||||
@@ -173,7 +173,7 @@ class SetSourceAccountTest extends TestCase
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new account #' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'Some new account #' . random_int(1, 1000);
|
||||
$action = new SetSourceAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
@@ -196,7 +196,7 @@ class SetSourceAccountTest extends TestCase
|
||||
$accountRepos->shouldReceive('setUser');
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new asset ' . rand(1, 1000);
|
||||
$ruleAction->action_value = 'Some new asset ' . random_int(1, 1000);
|
||||
$action = new SetSourceAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
|
||||
Reference in New Issue
Block a user