mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 14:41:20 +00:00
Improve randomness in test data to prevent key collisions.
This commit is contained in:
@@ -57,7 +57,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sidh_bbunq_' . random_int(1, 1000);
|
||||
$job->key = 'sidh_bbunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
@@ -107,7 +107,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
$payment = new BunqPayment($amount, $pointer, 'Some descr', null, null);
|
||||
$payment->setAmount($amount);
|
||||
$payment->setCounterpartyAlias($labelMonetaryAccount);
|
||||
$payment->setDescription('Random description #' . random_int(1, 1000));
|
||||
$payment->setDescription('Random description #' . random_int(1, 10000));
|
||||
$value = [$payment];
|
||||
$list = new BunqResponsePaymentList($value, [], null);
|
||||
|
||||
@@ -191,7 +191,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sidA_bbunq_' . random_int(1, 1000);
|
||||
$job->key = 'sidA_bbunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
@@ -253,7 +253,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sidh_bbunq_' . random_int(1, 1000);
|
||||
$job->key = 'sidh_bbunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
@@ -295,7 +295,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
|
||||
$payment = new BunqPayment($amount, $pointer, 'Some descr', null, null);
|
||||
$payment->setAmount($amount);
|
||||
$payment->setDescription('Some random thing #' . random_int(1, 1000));
|
||||
$payment->setDescription('Some random thing #' . random_int(1, 10000));
|
||||
$payment->setCounterpartyAlias($labelMonetaryAccount);
|
||||
$value = [$payment];
|
||||
$list = new BunqResponsePaymentList($value, [], null);
|
||||
@@ -377,7 +377,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sidh_bbunq_' . random_int(1, 1000);
|
||||
$job->key = 'sidh_bbunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
@@ -427,7 +427,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
$payment = new BunqPayment($amount, $pointer, 'Some descr', null, null);
|
||||
$payment->setAmount($amount);
|
||||
$payment->setCounterpartyAlias($labelMonetaryAccount);
|
||||
$payment->setDescription('Random transfer #' . random_int(1, 1000));
|
||||
$payment->setDescription('Random transfer #' . random_int(1, 10000));
|
||||
$value = [$payment];
|
||||
$list = new BunqResponsePaymentList($value, [], null);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'snh_bunq_' . random_int(1, 1000);
|
||||
$job->key = 'snh_bunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
@@ -143,7 +143,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'snha_bunq_' . random_int(1, 1000);
|
||||
$job->key = 'snha_bunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
@@ -234,7 +234,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'snh_bbunq_' . random_int(1, 1000);
|
||||
$job->key = 'snh_bbunq_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'bunq';
|
||||
|
||||
@@ -45,7 +45,7 @@ class LineReaderTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'linerA' . random_int(1, 1000);
|
||||
$job->key = 'linerA' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'fake';
|
||||
|
||||
@@ -120,7 +120,7 @@ class MappingConvergerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'linerB' . random_int(1, 1000);
|
||||
$job->key = 'linerB' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'fake';
|
||||
|
||||
@@ -112,7 +112,7 @@ class StageAuthenticatedHandlerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sa_a_' . random_int(1, 1000);
|
||||
$job->key = 'sa_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -241,7 +241,7 @@ class StageAuthenticatedHandlerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sa_a_' . random_int(1, 1000);
|
||||
$job->key = 'sa_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -370,7 +370,7 @@ class StageAuthenticatedHandlerTest extends TestCase
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sa_a_' . random_int(1, 1000);
|
||||
$job->key = 'sa_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
|
||||
@@ -113,7 +113,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
$revenue = $this->user()->accounts()->where('account_type_id', 5)->first();
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sid_a_' . random_int(1, 1000);
|
||||
$job->key = 'sid_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -313,7 +313,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
$revenue = $this->user()->accounts()->where('account_type_id', 5)->first();
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sid_a_' . random_int(1, 1000);
|
||||
$job->key = 'sid_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -510,7 +510,7 @@ class StageImportDataHandlerTest extends TestCase
|
||||
$revenue = $this->user()->accounts()->where('account_type_id', 5)->first();
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sid_a_' . random_int(1, 1000);
|
||||
$job->key = 'sid_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
|
||||
@@ -59,7 +59,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sn_a_' . random_int(1, 1000);
|
||||
$job->key = 'sn_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -126,7 +126,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sn_a_' . random_int(1, 1000);
|
||||
$job->key = 'sn_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -179,7 +179,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sn_a_' . random_int(1, 1000);
|
||||
$job->key = 'sn_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@@ -248,7 +248,7 @@ class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sn_a_' . random_int(1, 1000);
|
||||
$job->key = 'sn_a_' . random_int(1, 10000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
|
||||
Reference in New Issue
Block a user