Improve randomness in test data to prevent key collisions.

This commit is contained in:
James Cole
2018-07-14 16:41:07 +02:00
parent ff403dfa2e
commit 3d1523a060
50 changed files with 283 additions and 283 deletions

View File

@@ -65,7 +65,7 @@ class JournalUpdateServiceTest extends TestCase
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->where('transaction_type_id', 2)->first();
$data = [
'description' => 'Updated journal #' . random_int(1, 1000),
'description' => 'Updated journal #' . random_int(1, 10000),
'date' => new Carbon('2018-01-01'),
'bill_id' => null,
'bill_name' => null,
@@ -107,7 +107,7 @@ class JournalUpdateServiceTest extends TestCase
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 2)->first();
$data = [
'description' => 'Updated journal #' . random_int(1, 1000),
'description' => 'Updated journal #' . random_int(1, 10000),
'date' => new Carbon('2018-01-01'),
'bill_id' => null,
'bill_name' => null,
@@ -199,7 +199,7 @@ class JournalUpdateServiceTest extends TestCase
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->skip(4)->where('transaction_type_id', 1)->first();
$data = [
'description' => 'Updated journal #' . random_int(1, 1000),
'description' => 'Updated journal #' . random_int(1, 10000),
'date' => new Carbon('2018-01-01'),
'bill_id' => null,
'bill_name' => null,