mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-11 12:18:08 +00:00
Improve randomness in test data to prevent key collisions.
This commit is contained in:
@@ -162,9 +162,9 @@ class LinkControllerTest extends TestCase
|
||||
{
|
||||
$repository = $this->mock(LinkTypeRepositoryInterface::class);
|
||||
$data = [
|
||||
'name' => 'test ' . random_int(1, 1000),
|
||||
'inward' => 'test inward' . random_int(1, 1000),
|
||||
'outward' => 'test outward' . random_int(1, 1000),
|
||||
'name' => 'test ' . random_int(1, 10000),
|
||||
'inward' => 'test inward' . random_int(1, 10000),
|
||||
'outward' => 'test outward' . random_int(1, 10000),
|
||||
];
|
||||
$repository->shouldReceive('store')->once()->andReturn(LinkType::first());
|
||||
$repository->shouldReceive('findNull')->andReturn(LinkType::first());
|
||||
@@ -184,9 +184,9 @@ class LinkControllerTest extends TestCase
|
||||
{
|
||||
$repository = $this->mock(LinkTypeRepositoryInterface::class);
|
||||
$data = [
|
||||
'name' => 'test ' . random_int(1, 1000),
|
||||
'inward' => 'test inward' . random_int(1, 1000),
|
||||
'outward' => 'test outward' . random_int(1, 1000),
|
||||
'name' => 'test ' . random_int(1, 10000),
|
||||
'inward' => 'test inward' . random_int(1, 10000),
|
||||
'outward' => 'test outward' . random_int(1, 10000),
|
||||
'create_another' => '1',
|
||||
];
|
||||
$repository->shouldReceive('store')->once()->andReturn(new LinkType);
|
||||
@@ -210,9 +210,9 @@ class LinkControllerTest extends TestCase
|
||||
$repository->shouldReceive('update')->once()->andReturn(new $linkType);
|
||||
|
||||
$data = [
|
||||
'name' => 'test ' . random_int(1, 1000),
|
||||
'inward' => 'test inward' . random_int(1, 1000),
|
||||
'outward' => 'test outward' . random_int(1, 1000),
|
||||
'name' => 'test ' . random_int(1, 10000),
|
||||
'inward' => 'test inward' . random_int(1, 10000),
|
||||
'outward' => 'test outward' . random_int(1, 10000),
|
||||
];
|
||||
$this->session(['link_types.edit.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
@@ -231,9 +231,9 @@ class LinkControllerTest extends TestCase
|
||||
$linkType = LinkType::where('editable', 0)->first();
|
||||
|
||||
$data = [
|
||||
'name' => 'test ' . random_int(1, 1000),
|
||||
'inward' => 'test inward' . random_int(1, 1000),
|
||||
'outward' => 'test outward' . random_int(1, 1000),
|
||||
'name' => 'test ' . random_int(1, 10000),
|
||||
'inward' => 'test inward' . random_int(1, 10000),
|
||||
'outward' => 'test outward' . random_int(1, 10000),
|
||||
'return_to_edit' => '1',
|
||||
];
|
||||
$this->session(['link_types.edit.uri' => 'http://localhost']);
|
||||
@@ -254,9 +254,9 @@ class LinkControllerTest extends TestCase
|
||||
$linkType = LinkType::create(['editable' => 1, 'inward' => 'healox', 'outward' => 'byaex', 'name' => 'Test tyapeX']);
|
||||
|
||||
$data = [
|
||||
'name' => 'test ' . random_int(1, 1000),
|
||||
'inward' => 'test inward' . random_int(1, 1000),
|
||||
'outward' => 'test outward' . random_int(1, 1000),
|
||||
'name' => 'test ' . random_int(1, 10000),
|
||||
'inward' => 'test inward' . random_int(1, 10000),
|
||||
'outward' => 'test outward' . random_int(1, 10000),
|
||||
'return_to_edit' => '1',
|
||||
];
|
||||
$repository->shouldReceive('update')->once()->andReturn(new $linkType);
|
||||
|
||||
Reference in New Issue
Block a user