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

@@ -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);
}