mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Improve randomness in test data to prevent key collisions.
This commit is contained in:
@@ -49,7 +49,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -88,7 +88,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => '',
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -127,7 +127,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic CC account #' . random_int(1, 1000),
|
||||
'name' => 'Basic CC account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'ccAsset',
|
||||
@@ -174,7 +174,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'expense',
|
||||
'iban' => null,
|
||||
'name' => 'Basic expense account #' . random_int(1, 1000),
|
||||
'name' => 'Basic expense account #' . random_int(1, 10000),
|
||||
'virtualBalance' => '1243',
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -213,7 +213,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'Expense account',
|
||||
'iban' => null,
|
||||
'name' => 'Basic expense account #' . random_int(1, 1000),
|
||||
'name' => 'Basic expense account #' . random_int(1, 10000),
|
||||
'virtualBalance' => '1243',
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -251,7 +251,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -297,7 +297,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -342,7 +342,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => 'NL02ABNA0870809585',
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -381,7 +381,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => 'NL1XRABO032674X238',
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -420,7 +420,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
@@ -466,7 +466,7 @@ class AccountFactoryTest extends TestCase
|
||||
'account_type_id' => null,
|
||||
'accountType' => 'asset',
|
||||
'iban' => null,
|
||||
'name' => 'Basic asset account #' . random_int(1, 1000),
|
||||
'name' => 'Basic asset account #' . random_int(1, 10000),
|
||||
'virtualBalance' => null,
|
||||
'active' => true,
|
||||
'accountRole' => 'defaultAsset',
|
||||
|
||||
@@ -42,7 +42,7 @@ class BillFactoryTest extends TestCase
|
||||
public function testCreateBasic(): void
|
||||
{
|
||||
$data = [
|
||||
'name' => 'Some new bill #' . random_int(1, 1000),
|
||||
'name' => 'Some new bill #' . random_int(1, 10000),
|
||||
'amount_min' => '5',
|
||||
'transaction_currency_id' => 1,
|
||||
'amount_max' => '10',
|
||||
@@ -76,7 +76,7 @@ class BillFactoryTest extends TestCase
|
||||
public function testCreateEmptyNotes(): void
|
||||
{
|
||||
$data = [
|
||||
'name' => 'Some new bill #' . random_int(1, 1000),
|
||||
'name' => 'Some new bill #' . random_int(1, 10000),
|
||||
'amount_min' => '5',
|
||||
'amount_max' => '10',
|
||||
'date' => '2018-01-01',
|
||||
@@ -144,7 +144,7 @@ class BillFactoryTest extends TestCase
|
||||
/** @var BillFactory $factory */
|
||||
$factory = app(BillFactory::class);
|
||||
$factory->setUser($this->user());
|
||||
$piggy = $factory->find(null, 'I dont exist' . random_int(1, 1000));
|
||||
$piggy = $factory->find(null, 'I dont exist' . random_int(1, 10000));
|
||||
|
||||
$this->assertNull($piggy);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class BudgetFactoryTest extends TestCase
|
||||
/** @var BudgetFactory $factory */
|
||||
$factory = app(BudgetFactory::class);
|
||||
$factory->setUser($this->user());
|
||||
$this->assertNull($factory->find(null, 'I dont exist.' . random_int(1, 1000)));
|
||||
$this->assertNull($factory->find(null, 'I dont exist.' . random_int(1, 10000)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class CategoryFactoryTest extends TestCase
|
||||
*/
|
||||
public function testFindOrCreateNewName(): void
|
||||
{
|
||||
$name = 'Some new category #' . random_int(1, 1000);
|
||||
$name = 'Some new category #' . random_int(1, 10000);
|
||||
|
||||
/** @var CategoryFactory $factory */
|
||||
$factory = app(CategoryFactory::class);
|
||||
|
||||
@@ -91,6 +91,6 @@ class PiggyBankFactoryTest extends TestCase
|
||||
/** @var PiggyBankFactory $factory */
|
||||
$factory = app(PiggyBankFactory::class);
|
||||
$factory->setUser($this->user());
|
||||
$this->assertNull($factory->find(null, 'I dont exist.' . random_int(1, 1000)));
|
||||
$this->assertNull($factory->find(null, 'I dont exist.' . random_int(1, 10000)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class TagFactoryTest extends TestCase
|
||||
*/
|
||||
public function testFindOrCreateNew(): void
|
||||
{
|
||||
$tag = 'Some new tag#' . random_int(1, 1000);
|
||||
$tag = 'Some new tag#' . random_int(1, 10000);
|
||||
/** @var TagFactory $factory */
|
||||
$factory = app(TagFactory::class);
|
||||
$factory->setUser($this->user());
|
||||
|
||||
Reference in New Issue
Block a user