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

@@ -53,7 +53,7 @@ class JobConfigurationControllerTest extends TestCase
{
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '1Afake_job_' . random_int(1, 1000);
$job->key = '1Afake_job_' . random_int(1, 10000);
$job->status = 'has_prereq';
$job->provider = 'fake';
$job->file_type = '';
@@ -85,7 +85,7 @@ class JobConfigurationControllerTest extends TestCase
{
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '2Bfake_job_' . random_int(1, 1000);
$job->key = '2Bfake_job_' . random_int(1, 10000);
$job->status = 'some_bad_state';
$job->provider = 'fake';
$job->file_type = '';
@@ -111,7 +111,7 @@ class JobConfigurationControllerTest extends TestCase
{
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '3Cfake_job_' . random_int(1, 1000);
$job->key = '3Cfake_job_' . random_int(1, 10000);
$job->status = 'has_prereq';
$job->provider = 'fake';
$job->file_type = '';
@@ -140,7 +140,7 @@ class JobConfigurationControllerTest extends TestCase
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '4Dfake_job_' . random_int(1, 1000);
$job->key = '4Dfake_job_' . random_int(1, 10000);
$job->status = 'has_prereq';
$job->provider = 'fake';
$job->file_type = '';
@@ -174,7 +174,7 @@ class JobConfigurationControllerTest extends TestCase
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '5Ffake_job_' . random_int(1, 1000);
$job->key = '5Ffake_job_' . random_int(1, 10000);
$job->status = 'some_bad_state';
$job->provider = 'fake';
$job->file_type = '';
@@ -203,7 +203,7 @@ class JobConfigurationControllerTest extends TestCase
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '6Efake_job_' . random_int(1, 1000);
$job->key = '6Efake_job_' . random_int(1, 10000);
$job->status = 'has_prereq';
$job->provider = 'fake';
$job->file_type = '';
@@ -233,7 +233,7 @@ class JobConfigurationControllerTest extends TestCase
$file = UploadedFile::fake()->image('avatar.jpg');
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = '7Dfake_job_' . random_int(1, 1000);
$job->key = '7Dfake_job_' . random_int(1, 10000);
$job->status = 'has_prereq';
$job->provider = 'fake';
$job->file_type = '';