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

@@ -138,7 +138,7 @@ class AttachmentControllerTest extends TestCase
'user_id' => $this->user()->id,
'attachable_id' => 1,
'attachable_type' => TransactionJournal::class,
'md5' => md5('Hello' . random_int(1, 1000)),
'md5' => md5('Hello' . random_int(1, 10000)),
'filename' => 'some name',
'mime' => 'text/plain',
'size' => 5,
@@ -230,7 +230,7 @@ class AttachmentControllerTest extends TestCase
// data to submit
$data = [
'filename' => 'Some new att',
'description' => sprintf('Attempt #%d', random_int(1, 1000)),
'description' => sprintf('Attempt #%d', random_int(1, 10000)),
'model' => TransactionJournal::class,
'model_id' => 1,
];
@@ -265,7 +265,7 @@ class AttachmentControllerTest extends TestCase
// data to submit
$data = [
'filename' => $attachment->filename,
'description' => sprintf('Attempt #%d', random_int(1, 1000)),
'description' => sprintf('Attempt #%d', random_int(1, 10000)),
'model' => TransactionJournal::class,
'model_id' => 1,
];