Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Push updated tests.
James Cole0a710775133b
diff --git a/tests/Api/V1/Controllers/AccountControllerTest.php b/tests/Api/V1/Controllers/AccountControllerTest.phpindex 3d8bf7e88d..a23e096cf4 100644--- a/tests/Api/V1/Controllers/AccountControllerTest.php+++ b/tests/Api/V1/Controllers/AccountControllerTest.php@@ -127,7 +127,7 @@ class AccountControllerTest extends TestCase// data to submit$data = [- 'name' => 'Some new asset account #' . rand(1, 10000),+ 'name' => 'Some new asset account #' . random_int(1, 10000),'currency_id' => 1,'type' => 'asset','active' => 1,@@ -169,7 +169,7 @@ class AccountControllerTest extends TestCase// data to submit$data = [- 'name' => 'Some new asset account #' . rand(1, 10000),+ 'name' => 'Some new asset account #' . random_int(1, 10000),'type' => 'asset','active' => 1,'account_role' => 'ccAsset',@@ -211,7 +211,7 @@ class AccountControllerTest extends TestCase// data to submit$data = [- 'name' => 'Some new asset account #' . rand(1, 10000),+ 'name' => 'Some new asset account #' . random_int(1, 10000),'type' => 'asset','active' => 1,'account_role' => 'defaultAsset',@@ -336,7 +336,7 @@ class AccountControllerTest extends TestCase// data to submit$data = [- 'name' => 'Some new asset account #' . rand(1, 10000),+ 'name' => 'Some new asset account #' . random_int(1, 10000),'currency_id' => 1,'type' => 'asset','active' => 1,@@ -384,7 +384,7 @@ class AccountControllerTest extends TestCase// data to submit$data = [- 'name' => 'Some new asset account #' . rand(1, 10000),+ 'name' => 'Some new asset account #' . random_int(1, 10000),'currency_code' => 'EUR','type' => 'asset','active' => 1,diff --git a/tests/Api/V1/Controllers/BillControllerTest.php b/tests/Api/V1/Controllers/BillControllerTest.phpindex ffce0c30d6..ebb886fede 100644--- a/tests/Api/V1/Controllers/BillControllerTest.php+++ b/tests/Api/V1/Controllers/BillControllerTest.php@@ -140,8 +140,8 @@ class BillControllerTest extends TestCase// data to submit:$data = [- 'name' => 'New bill #' . rand(1, 1000),- 'match' => 'some,words,' . rand(1, 1000),+ 'name' => 'New bill #' . random_int(1, 1000),+ 'match' => 'some,words,' . random_int(1, 1000),'amount_min' => '66.34','amount_max' => '45.67','date' => '2018-01-01',@@ -184,8 +184,8 @@ class BillControllerTest extends TestCase// data to submit:$data = [- 'name' => 'New bill #' . rand(1, 1000),- 'match' => 'some,words,' . rand(1, 1000),+ 'name' => 'New bill #' . random_int(1, 1000),+ 'match' => 'some,words,' . random_int(1, 1000),'amount_min' => '12.34','amount_max' => '45.67','date' => '2018-01-01',@@ -222,8 +222,8 @@ class BillControllerTest extends TestCase// data to submit:$data = [- 'name' => 'New bill #' . rand(1, 1000),- 'match' => 'some,words,' . rand(1, 1000),+ 'name' => 'New bill #' . random_int(1, 1000),+ 'match' => 'some,words,' . random_int(1, 1000),'amount_min' => '12.34','amount_max' => '45.67','date' => '2018-01-01',diff --git a/tests/Api/V1/Controllers/TransactionControllerTest.php b/tests/Api/V1/Controllers/TransactionControllerTest.phpindex 7a307699aa..1ca6805406 100644--- a/tests/Api/V1/Controllers/TransactionControllerTest.php+++ b/tests/Api/V1/Controllers/TransactionControllerTest.php@@ -95,7 +95,7 @@ class TransactionControllerTest extends TestCase$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -141,7 +141,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -239,7 +239,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$data = [- 'description' => 'Split journal #' . rand(1, 1000),+ 'description' => 'Split journal #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -297,7 +297,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -341,10 +341,10 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('setUser')->once();$accountRepos->shouldReceive('setUser');$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection);- $accountRepos->shouldReceive('findByName')->andReturn(null);+ $accountRepos->shouldReceive('findByNameNull')->andReturn(null);$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -389,7 +389,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('setUser');$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -433,7 +433,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('setUser');$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [],@@ -473,7 +473,7 @@ class TransactionControllerTest extends TestCase$data = [- 'description' => 'Split journal #' . rand(1, 1000),+ 'description' => 'Split journal #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -523,7 +523,7 @@ class TransactionControllerTest extends TestCase$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -579,7 +579,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','bill_id' => $bill->id,@@ -637,7 +637,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','bill_name' => $bill->name,@@ -695,7 +695,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -753,7 +753,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -811,7 +811,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -875,7 +875,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','piggy_bank_id' => $piggyBank->id,@@ -941,7 +941,7 @@ class TransactionControllerTest extends TestCase// submit with another account.$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','piggy_bank_name' => $piggyBank->name,@@ -995,7 +995,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'deposit','transactions' => [@@ -1044,7 +1044,7 @@ class TransactionControllerTest extends TestCase$data = [- 'description' => 'Some deposit #' . rand(1, 1000),+ 'description' => 'Some deposit #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'deposit','transactions' => [@@ -1100,7 +1100,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]), new Collection([$second]));$data = [- 'description' => 'Some transfer #' . rand(1, 1000),+ 'description' => 'Some transfer #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'transfer','transactions' => [@@ -1137,7 +1137,7 @@ class TransactionControllerTest extends TestCase'All accounts in this field must be equal.',],'transactions.1.destination_id' => [- 'The source account equals the destination account'+ 'The source account equals the destination account',],],]@@ -1164,7 +1164,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]), new Collection([$second]));$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1465,7 +1465,7 @@ class TransactionControllerTest extends TestCase$bill = $this->user()->bills()->first();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','bill_id' => $bill->id,@@ -1506,7 +1506,7 @@ class TransactionControllerTest extends TestCase$bill = $this->user()->bills()->first();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','bill_name' => $bill->name,@@ -1545,7 +1545,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1553,7 +1553,7 @@ class TransactionControllerTest extends TestCase'amount' => '10','currency_id' => 1,'source_id' => $account->id,- 'destination_name' => 'New expense account #' . rand(1, 1000),+ 'destination_name' => 'New expense account #' . random_int(1, 1000),],@@ -1586,7 +1586,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1625,7 +1625,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1644,6 +1644,47 @@ class TransactionControllerTest extends TestCase$response->assertStatus(200);}+ /**+ * Submit the minimum amount of data required to create a withdrawal.+ *+ * @covers \FireflyIII\Api\V1\Controllers\TransactionController::store+ * @covers \FireflyIII\Api\V1\Requests\TransactionRequest+ */+ public function testSuccessStoreBasicByName()+ {+ // default journal:+ $journal = $this->user()->transactionJournals()->where('transaction_type_id', 1)->first();+ $account = $this->user()->accounts()->where('account_type_id', 3)->first();+ $journalRepos = $this->mock(JournalRepositoryInterface::class)->makePartial();+ $accountRepos = $this->mock(AccountRepositoryInterface::class);++ $journalRepos->shouldReceive('setUser')->once();+ $accountRepos->shouldReceive('setUser');+ $accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection);+ $accountRepos->shouldReceive('findByNameNull')->andReturn($account);+ $journalRepos->shouldReceive('store')->andReturn($journal)->once();+++ $data = [+ 'description' => 'Some transaction #' . random_int(1, 1000),+ 'date' => '2018-01-01',+ 'type' => 'withdrawal',+ 'transactions' => [+ [+ 'amount' => '10',+ 'currency_id' => 1,+ 'source_name' => $account->name,+ ],+++ ],+ ];++ // test API+ $response = $this->post('/api/v1/transactions', $data, ['Accept' => 'application/json']);+ $response->assertStatus(200);+ }+/*** Submit the minimum amount of data required to create a deposit.*@@ -1664,7 +1705,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'deposit','transactions' => [@@ -1702,7 +1743,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1742,7 +1783,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1781,7 +1822,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1820,7 +1861,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1860,7 +1901,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1899,7 +1940,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal',// store date meta fields (if present):@@ -1944,9 +1985,9 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();- $name = 'Some new category #' . rand(1, 1000);+ $name = 'Some new category #' . random_int(1, 1000);$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -1984,9 +2025,9 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('setUser');$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]), new Collection([$opposing]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();- $name = 'New opposing account #' . rand(1, 10000);+ $name = 'New opposing account #' . random_int(1, 10000);$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -2025,7 +2066,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','notes' => 'I am a note',@@ -2064,7 +2105,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]), new Collection([$opposing]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -2104,7 +2145,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -2144,7 +2185,7 @@ class TransactionControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn($journal)->once();$piggy = $this->user()->piggyBanks()->first();$data = [- 'description' => 'Some deposit #' . rand(1, 1000),+ 'description' => 'Some deposit #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'deposit','piggy_bank_name' => $piggy->name,@@ -2185,7 +2226,7 @@ class TransactionControllerTest extends TestCase$piggy = $this->user()->piggyBanks()->first();$data = [- 'description' => 'Some transfer #' . rand(1, 1000),+ 'description' => 'Some transfer #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'transfer','piggy_bank_id' => $piggy->id,@@ -2225,7 +2266,7 @@ class TransactionControllerTest extends TestCase$piggy = $this->user()->piggyBanks()->first();$data = [- 'description' => 'Some transfer #' . rand(1, 1000),+ 'description' => 'Some transfer #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'transfer','piggy_bank_name' => $piggy->name,@@ -2261,7 +2302,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -2299,7 +2340,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','transactions' => [@@ -2337,9 +2378,9 @@ class TransactionControllerTest extends TestCasepublic function testSuccessStoreTags(){$tags = [- 'TagOne' . rand(1, 1000),- 'TagTwoBlarg' . rand(1, 1000),- 'SomeThreeTag' . rand(1, 1000),+ 'TagOne' . random_int(1, 1000),+ 'TagTwoBlarg' . random_int(1, 1000),+ 'SomeThreeTag' . random_int(1, 1000),];$journal = $this->user()->transactionJournals()->first();$account = $this->user()->accounts()->where('account_type_id', 3)->first();@@ -2351,7 +2392,7 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsById')->andReturn(new Collection([$account]));$journalRepos->shouldReceive('store')->andReturn($journal)->once();$data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','type' => 'withdrawal','tags' => join(',', $tags),@@ -2386,8 +2427,8 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('setUser');$accountRepos->shouldReceive('getAccountsById')->withArgs([[$account->id]])->andReturn(new Collection([$account]));- $data = [- 'description' => 'Some deposit #' . rand(1, 1000),+ $data = [+ 'description' => 'Some deposit #' . random_int(1, 1000),'date' => '2018-01-01','transactions' => [[@@ -2428,8 +2469,8 @@ class TransactionControllerTest extends TestCase$accountRepos->shouldReceive('setUser');$accountRepos->shouldReceive('getAccountsById')->withArgs([[$account->id]])->andReturn(new Collection([$account]));- $data = [- 'description' => 'Some transaction #' . rand(1, 1000),+ $data = [+ 'description' => 'Some transaction #' . random_int(1, 1000),'date' => '2018-01-01','transactions' => [[@@ -2446,7 +2487,6 @@ class TransactionControllerTest extends TestCase} while ($count !== 2);-$transaction = $withdrawal->transactions()->first();$repository->shouldReceive('setUser');$repository->shouldReceive('update')->andReturn($withdrawal)->once();diff --git a/tests/Api/V1/Controllers/UserControllerTest.php b/tests/Api/V1/Controllers/UserControllerTest.phpindex 90b5166189..85e8bc88fb 100644--- a/tests/Api/V1/Controllers/UserControllerTest.php+++ b/tests/Api/V1/Controllers/UserControllerTest.php@@ -57,7 +57,7 @@ class UserControllerTest extends TestCasepublic function testDelete(){// create a user first:- $user = User::create(['email' => 'some@newu' . rand(1, 1000) . 'ser.nl', 'password' => 'hello', 'blocked' => 0]);+ $user = User::create(['email' => 'some@newu' . random_int(1, 1000) . 'ser.nl', 'password' => 'hello', 'blocked' => 0]);// call API$response = $this->delete('/api/v1/users/' . $user->id);@@ -77,7 +77,7 @@ class UserControllerTest extends TestCasePassport::actingAs($this->emptyUser());// create a user first:- $user = User::create(['email' => 'some@newu' . rand(1, 1000) . 'ser.nl', 'password' => 'hello', 'blocked' => 0]);+ $user = User::create(['email' => 'some@newu' . random_int(1, 1000) . 'ser.nl', 'password' => 'hello', 'blocked' => 0]);// call API$response = $this->delete('/api/v1/users/' . $user->id);@@ -130,7 +130,7 @@ class UserControllerTest extends TestCasepublic function testStoreBasic(){$data = [- 'email' => 'some_new@user' . rand(1, 1000) . '.com',+ 'email' => 'some_new@user' . random_int(1, 1000) . '.com','blocked' => 0,];@@ -180,11 +180,11 @@ class UserControllerTest extends TestCasepublic function testUpdate(){// create a user first:- $user = User::create(['email' => 'some@newu' . rand(1, 1000) . 'ser.nl', 'password' => 'hello', 'blocked' => 0]);+ $user = User::create(['email' => 'some@newu' . random_int(1, 1000) . 'ser.nl', 'password' => 'hello', 'blocked' => 0]);// data:$data = [- 'email' => 'some-new@email' . rand(1, 1000) . '.com',+ 'email' => 'some-new@email' . random_int(1, 1000) . '.com','blocked' => 0,];diff --git a/tests/Feature/Controllers/Account/ReconcileControllerTest.php b/tests/Feature/Controllers/Account/ReconcileControllerTest.phpindex 0931402d71..9b40892024 100644--- a/tests/Feature/Controllers/Account/ReconcileControllerTest.php+++ b/tests/Feature/Controllers/Account/ReconcileControllerTest.php@@ -33,6 +33,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;use Illuminate\Support\Collection;use Log;use Tests\TestCase;+use Mockery;/*** Class ConfigurationControllerTest@@ -248,6 +249,8 @@ class ReconcileControllerTest extends TestCase$journalRepos->shouldReceive('store')->andReturn(new TransactionJournal);$repository->shouldReceive('getReconciliation')->andReturn(new Account);$repository->shouldReceive('findNull')->andReturn(new Account);+ $repository->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');+$data = ['transactions' => [1, 2, 3],'reconcile' => 'create',diff --git a/tests/Feature/Controllers/AccountControllerTest.php b/tests/Feature/Controllers/AccountControllerTest.phpindex 7d331a01e6..2234820e49 100644--- a/tests/Feature/Controllers/AccountControllerTest.php+++ b/tests/Feature/Controllers/AccountControllerTest.php@@ -40,7 +40,7 @@ use Log;use Preferences;use Steam;use Tests\TestCase;-+use Mockery;/*** Class AccountControllerTest*@@ -142,6 +142,12 @@ class AccountControllerTest extends TestCase$accountRepos->shouldReceive('getNote')->andReturn($note)->once();$accountRepos->shouldReceive('getOpeningBalanceAmount')->andReturnNull();$accountRepos->shouldReceive('getOpeningBalanceDate')->andReturnNull();+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'accountNumber'])->andReturn('123');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'accountRole'])->andReturn('defaultAsset');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'ccType'])->andReturn('');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'ccMonthlyPaymentDate'])->andReturn('');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'BIC'])->andReturn('BIC');$this->be($this->user());$account = $this->user()->accounts()->where('account_type_id', 3)->whereNull('deleted_at')->first();@@ -236,6 +242,7 @@ class AccountControllerTest extends TestCase{// mock$journalRepos = $this->mock(JournalRepositoryInterface::class);+ $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);$this->session(['start' => '2018-01-01', 'end' => '2017-12-01']);@@ -342,7 +349,7 @@ class AccountControllerTest extends TestCase$this->session(['accounts.create.uri' => 'http://localhost']);$this->be($this->user());$data = [- 'name' => 'new account ' . rand(1000, 9999),+ 'name' => 'new account ' . random_int(1000, 9999),'what' => 'asset',];@@ -368,7 +375,7 @@ class AccountControllerTest extends TestCase$this->session(['accounts.create.uri' => 'http://localhost']);$this->be($this->user());$data = [- 'name' => 'new account ' . rand(1000, 9999),+ 'name' => 'new account ' . random_int(1000, 9999),'what' => 'asset','create_another' => 1,];@@ -395,7 +402,7 @@ class AccountControllerTest extends TestCase$this->session(['accounts.edit.uri' => 'http://localhost/javascript/account']);$this->be($this->user());$data = [- 'name' => 'updated account ' . rand(1000, 9999),+ 'name' => 'updated account ' . random_int(1000, 9999),'active' => 1,'what' => 'asset',];@@ -422,7 +429,7 @@ class AccountControllerTest extends TestCase$this->session(['accounts.edit.uri' => 'http://localhost']);$this->be($this->user());$data = [- 'name' => 'updated account ' . rand(1000, 9999),+ 'name' => 'updated account ' . random_int(1000, 9999),'active' => 1,'what' => 'asset','return_to_edit' => '1',diff --git a/tests/Feature/Controllers/Admin/LinkControllerTest.php b/tests/Feature/Controllers/Admin/LinkControllerTest.phpindex feec43fe8b..46666f3c05 100644--- a/tests/Feature/Controllers/Admin/LinkControllerTest.php+++ b/tests/Feature/Controllers/Admin/LinkControllerTest.php@@ -167,9 +167,9 @@ class LinkControllerTest extends TestCase{$repository = $this->mock(LinkTypeRepositoryInterface::class);$data = [- 'name' => 'test ' . rand(1, 1000),- 'inward' => 'test inward' . rand(1, 1000),- 'outward' => 'test outward' . rand(1, 1000),+ 'name' => 'test ' . random_int(1, 1000),+ 'inward' => 'test inward' . random_int(1, 1000),+ 'outward' => 'test outward' . random_int(1, 1000),];$repository->shouldReceive('store')->once()->andReturn(LinkType::first());$repository->shouldReceive('find')->andReturn(LinkType::first());@@ -189,9 +189,9 @@ class LinkControllerTest extends TestCase{$repository = $this->mock(LinkTypeRepositoryInterface::class);$data = [- 'name' => 'test ' . rand(1, 1000),- 'inward' => 'test inward' . rand(1, 1000),- 'outward' => 'test outward' . rand(1, 1000),+ 'name' => 'test ' . random_int(1, 1000),+ 'inward' => 'test inward' . random_int(1, 1000),+ 'outward' => 'test outward' . random_int(1, 1000),'create_another' => '1',];$repository->shouldReceive('store')->once()->andReturn(new LinkType);@@ -215,9 +215,9 @@ class LinkControllerTest extends TestCase$repository->shouldReceive('update')->once()->andReturn(new $linkType);$data = [- 'name' => 'test ' . rand(1, 1000),- 'inward' => 'test inward' . rand(1, 1000),- 'outward' => 'test outward' . rand(1, 1000),+ 'name' => 'test ' . random_int(1, 1000),+ 'inward' => 'test inward' . random_int(1, 1000),+ 'outward' => 'test outward' . random_int(1, 1000),];$this->session(['link_types.edit.uri' => 'http://localhost']);$this->be($this->user());@@ -236,9 +236,9 @@ class LinkControllerTest extends TestCase$linkType = LinkType::where('editable', 0)->first();$data = [- 'name' => 'test ' . rand(1, 1000),- 'inward' => 'test inward' . rand(1, 1000),- 'outward' => 'test outward' . rand(1, 1000),+ 'name' => 'test ' . random_int(1, 1000),+ 'inward' => 'test inward' . random_int(1, 1000),+ 'outward' => 'test outward' . random_int(1, 1000),'return_to_edit' => '1',];$this->session(['link_types.edit.uri' => 'http://localhost']);@@ -259,9 +259,9 @@ class LinkControllerTest extends TestCase$linkType = LinkType::create(['editable' => 1, 'inward' => 'healox', 'outward' => 'byaex', 'name' => 'Test tyapeX']);$data = [- 'name' => 'test ' . rand(1, 1000),- 'inward' => 'test inward' . rand(1, 1000),- 'outward' => 'test outward' . rand(1, 1000),+ 'name' => 'test ' . random_int(1, 1000),+ 'inward' => 'test inward' . random_int(1, 1000),+ 'outward' => 'test outward' . random_int(1, 1000),'return_to_edit' => '1',];$repository->shouldReceive('update')->once()->andReturn(new $linkType);diff --git a/tests/Feature/Controllers/Admin/UpdateControllerTest.php b/tests/Feature/Controllers/Admin/UpdateControllerTest.phpindex db8f6883c7..42e123cdad 100644--- a/tests/Feature/Controllers/Admin/UpdateControllerTest.php+++ b/tests/Feature/Controllers/Admin/UpdateControllerTest.php@@ -103,14 +103,15 @@ class UpdateControllerTest extends TestCaseFireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn(new Configuration);$version = config('firefly.version');+ $date = new Carbon;+ $date->subDays(5);$releases = [- new Release(['id' => 'x', 'title' => $version . '.1', 'content' => '', 'updated' => new Carbon]),+ new Release(['id' => 'x', 'title' => $version . '.1', 'content' => '', 'updated' => $date]),];$updater = $this->mock(UpdateRequest::class);$updater->shouldReceive('call')->andReturnNull();$updater->shouldReceive('getReleases')->andReturn($releases);- // expect a new release (because of .1)$this->be($this->user());$response = $this->post(route('admin.update-check.manual'));$response->assertStatus(200);@@ -130,15 +131,16 @@ class UpdateControllerTest extends TestCaseFireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn(new Configuration);+ $date = new Carbon;+ $date->subDays(5);$version = config('firefly.version');$releases = [- new Release(['id' => 'x', 'title' => $version, 'content' => '', 'updated' => new Carbon]),+ new Release(['id' => 'x', 'title' => $version, 'content' => '', 'updated' => $date]),];$updater = $this->mock(UpdateRequest::class);$updater->shouldReceive('call')->andReturnNull();$updater->shouldReceive('getReleases')->andReturn($releases);- // expect a new release (because of .1)$this->be($this->user());$response = $this->post(route('admin.update-check.manual'));$response->assertStatus(200);@@ -163,7 +165,6 @@ class UpdateControllerTest extends TestCase$updater->shouldReceive('call')->andThrow(FireflyException::class, 'Something broke.');$updater->shouldReceive('getReleases')->andReturn($releases);- // expect a new release (because of .1)$this->be($this->user());$response = $this->post(route('admin.update-check.manual'));$response->assertStatus(200);diff --git a/tests/Feature/Controllers/AttachmentControllerTest.php b/tests/Feature/Controllers/AttachmentControllerTest.phpindex 11653ed821..b1a0d40979 100644--- a/tests/Feature/Controllers/AttachmentControllerTest.php+++ b/tests/Feature/Controllers/AttachmentControllerTest.php@@ -146,7 +146,7 @@ class AttachmentControllerTest extends TestCase$this->session(['attachments.edit.uri' => 'http://localhost']);$data = [- 'title' => 'Some updated title ' . rand(1000, 9999),+ 'title' => 'Some updated title ' . random_int(1000, 9999),'notes' => 'A','description' => 'B',];diff --git a/tests/Feature/Controllers/BillControllerTest.php b/tests/Feature/Controllers/BillControllerTest.phpindex ff02b86b63..68aabe1da0 100644--- a/tests/Feature/Controllers/BillControllerTest.php+++ b/tests/Feature/Controllers/BillControllerTest.php@@ -235,7 +235,7 @@ class BillControllerTest extends TestCase$attachHelper->shouldReceive('getMessages')->andReturn(new MessageBag);$data = [- 'name' => 'New Bill ' . rand(1000, 9999),+ 'name' => 'New Bill ' . random_int(1000, 9999),'match' => 'some words','amount_min' => '100','amount_currency_id_amount_min' => 1,@@ -270,7 +270,7 @@ class BillControllerTest extends TestCase$data = ['id' => 1,- 'name' => 'Updated Bill ' . rand(1000, 9999),+ 'name' => 'Updated Bill ' . random_int(1000, 9999),'match' => 'some more words','amount_min' => '100','amount_currency_id_amount_min' => 1,diff --git a/tests/Feature/Controllers/BudgetControllerTest.php b/tests/Feature/Controllers/BudgetControllerTest.phpindex e5befa980b..1849152552 100644--- a/tests/Feature/Controllers/BudgetControllerTest.php+++ b/tests/Feature/Controllers/BudgetControllerTest.php@@ -575,14 +575,14 @@ class BudgetControllerTest extends TestCase$repository = $this->mock(BudgetRepositoryInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $repository->shouldReceive('find')->andReturn($budget);+ $repository->shouldReceive('findNull')->andReturn($budget);$repository->shouldReceive('store')->andReturn($budget);$repository->shouldReceive('cleanupBudgets');$this->session(['budgets.create.uri' => 'http://localhost']);$data = [- 'name' => 'New Budget ' . rand(1000, 9999),+ 'name' => 'New Budget ' . random_int(1000, 9999),];$this->be($this->user());$response = $this->post(route('budgets.store'), $data);@@ -600,14 +600,14 @@ class BudgetControllerTest extends TestCase$repository = $this->mock(BudgetRepositoryInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $repository->shouldReceive('find')->andReturn($budget);+ $repository->shouldReceive('findNull')->andReturn($budget);$repository->shouldReceive('update');$repository->shouldReceive('cleanupBudgets');$this->session(['budgets.edit.uri' => 'http://localhost']);$data = [- 'name' => 'Updated Budget ' . rand(1000, 9999),+ 'name' => 'Updated Budget ' . random_int(1000, 9999),'active' => 1,];$this->be($this->user());diff --git a/tests/Feature/Controllers/CategoryControllerTest.php b/tests/Feature/Controllers/CategoryControllerTest.phpindex 862a9d6594..e344bed2ea 100644--- a/tests/Feature/Controllers/CategoryControllerTest.php+++ b/tests/Feature/Controllers/CategoryControllerTest.php@@ -450,13 +450,13 @@ class CategoryControllerTest extends TestCase$repository = $this->mock(CategoryRepositoryInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);- $repository->shouldReceive('find')->andReturn(new Category);+ $repository->shouldReceive('findNull')->andReturn(new Category);$repository->shouldReceive('store')->andReturn(new Category);$this->session(['categories.create.uri' => 'http://localhost']);$data = [- 'name' => 'New Category ' . rand(1000, 9999),+ 'name' => 'New Category ' . random_int(1000, 9999),];$this->be($this->user());$response = $this->post(route('categories.store'), $data);@@ -476,12 +476,12 @@ class CategoryControllerTest extends TestCase$accountRepos = $this->mock(AccountRepositoryInterface::class);$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);$repository->shouldReceive('update');- $repository->shouldReceive('find')->andReturn($category);+ $repository->shouldReceive('findNull')->andReturn($category);$this->session(['categories.edit.uri' => 'http://localhost']);$data = [- 'name' => 'Updated Category ' . rand(1000, 9999),+ 'name' => 'Updated Category ' . random_int(1000, 9999),'active' => 1,];$this->be($this->user());diff --git a/tests/Feature/Controllers/Chart/AccountControllerTest.php b/tests/Feature/Controllers/Chart/AccountControllerTest.phpindex 9b920120fc..9c8a8fae37 100644--- a/tests/Feature/Controllers/Chart/AccountControllerTest.php+++ b/tests/Feature/Controllers/Chart/AccountControllerTest.php@@ -319,7 +319,7 @@ class AccountControllerTest extends TestCase$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));$generator = $this->mock(GeneratorInterface::class);- $generator->shouldReceive('multiSet')->andreturn([]);+ $generator->shouldReceive('multiSet')->andReturn([]);Steam::shouldReceive('balanceInRange')->andReturn(['2012-01-01' => '0']);$this->be($this->user());diff --git a/tests/Feature/Controllers/JavascriptControllerTest.php b/tests/Feature/Controllers/JavascriptControllerTest.phpindex 15cef60f44..645b5a49c2 100644--- a/tests/Feature/Controllers/JavascriptControllerTest.php+++ b/tests/Feature/Controllers/JavascriptControllerTest.php@@ -30,6 +30,7 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;use Illuminate\Support\Collection;use Log;use Tests\TestCase;+use Mockery;/*** Class JavascriptControllerTest@@ -62,6 +63,7 @@ class JavascriptControllerTest extends TestCase$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]))->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->once();$currencyRepos->shouldReceive('findByCodeNull')->withArgs(['EUR'])->andReturn(new TransactionCurrency);+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');$this->be($this->user());$response = $this->get(route('javascript.accounts'));@@ -77,6 +79,8 @@ class JavascriptControllerTest extends TestCase$currency = factory(TransactionCurrency::class)->make();$repository->shouldReceive('get')->andReturn(new Collection([$currency]));++$this->be($this->user());$response = $this->get(route('javascript.currencies'));$response->assertStatus(200);@@ -96,6 +100,7 @@ class JavascriptControllerTest extends TestCase$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);$accountRepos->shouldReceive('findNull')->andReturn(new Account);$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');$this->be($this->user());$this->changeDateRange($this->user(), $range);$response = $this->get(route('javascript.variables'));@@ -116,6 +121,7 @@ class JavascriptControllerTest extends TestCase$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);$accountRepos->shouldReceive('findNull')->andReturn(new Account);$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');$this->be($this->user());$this->changeDateRange($this->user(), $range);diff --git a/tests/Feature/Controllers/Json/BoxControllerTest.php b/tests/Feature/Controllers/Json/BoxControllerTest.phpindex 27e3995c2d..977efbaeac 100644--- a/tests/Feature/Controllers/Json/BoxControllerTest.php+++ b/tests/Feature/Controllers/Json/BoxControllerTest.php@@ -31,6 +31,7 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;use Illuminate\Support\Collection;use Log;+use Mockery;use Tests\TestCase;/**@@ -112,6 +113,9 @@ class BoxControllerTest extends TestCase$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);$accountRepos->shouldReceive('getActiveAccountsByType')->andReturn(new Collection([$this->user()->accounts()->first()]));$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(), 'accountRole'])->andReturn('ccAsset');+$this->be($this->user());$response = $this->get(route('json.box.net-worth'));$response->assertStatus(200);@@ -126,6 +130,8 @@ class BoxControllerTest extends TestCase$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);$accountRepos->shouldReceive('getActiveAccountsByType')->andReturn(new Collection([$this->user()->accounts()->first()]));$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');+ $accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(), 'accountRole'])->andReturn('ccAsset');$start = new Carbon;$start->addMonths(6)->startOfMonth();diff --git a/tests/Feature/Controllers/PiggyBankControllerTest.php b/tests/Feature/Controllers/PiggyBankControllerTest.phpindex 31a8043c5c..bd78799224 100644--- a/tests/Feature/Controllers/PiggyBankControllerTest.php+++ b/tests/Feature/Controllers/PiggyBankControllerTest.php@@ -366,7 +366,7 @@ class PiggyBankControllerTest extends TestCase$this->session(['piggy-banks.create.uri' => 'http://localhost']);$data = [- 'name' => 'Piggy ' . rand(999, 10000),+ 'name' => 'Piggy ' . random_int(999, 10000),'targetamount' => '100.123','account_id' => 2,'amount_currency_id_targetamount' => 1,@@ -393,7 +393,7 @@ class PiggyBankControllerTest extends TestCase$this->session(['piggy-banks.edit.uri' => 'http://localhost']);$data = ['id' => 3,- 'name' => 'Updated Piggy ' . rand(999, 10000),+ 'name' => 'Updated Piggy ' . random_int(999, 10000),'targetamount' => '100.123','account_id' => 2,'amount_currency_id_targetamount' => 1,diff --git a/tests/Feature/Controllers/Popup/ReportControllerTest.php b/tests/Feature/Controllers/Popup/ReportControllerTest.phpindex 3f80005cfe..3fe609c251 100644--- a/tests/Feature/Controllers/Popup/ReportControllerTest.php+++ b/tests/Feature/Controllers/Popup/ReportControllerTest.php@@ -115,8 +115,8 @@ class ReportControllerTest extends TestCase$account = factory(Account::class)->make();$popupHelper->shouldReceive('balanceForNoBudget')->once()->andReturn(new Collection);- $budgetRepos->shouldReceive('find')->andReturn(new Budget)->once()->withArgs([0]);- $accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);+ $budgetRepos->shouldReceive('findNull')->andReturn(new Budget)->once()->withArgs([0]);+ $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);$this->be($this->user());@@ -151,8 +151,8 @@ class ReportControllerTest extends TestCase$budget = factory(Budget::class)->make();$account = factory(Account::class)->make();- $budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);- $accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);+ $budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);+ $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);$popupHelper->shouldReceive('balanceForBudget')->once()->andReturn(new Collection);$this->be($this->user());@@ -188,8 +188,8 @@ class ReportControllerTest extends TestCase$budget = factory(Budget::class)->make();$account = factory(Account::class)->make();- $budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);- $accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);+ $budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);+ $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);$popupHelper->shouldReceive('balanceDifference')->once()->andReturn(new Collection);$this->be($this->user());@@ -224,8 +224,8 @@ class ReportControllerTest extends TestCase$budget = factory(Budget::class)->make();$account = factory(Account::class)->make();- $budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);- $accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);+ $budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);+ $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);$this->be($this->user());$arguments = [@@ -259,7 +259,7 @@ class ReportControllerTest extends TestCase$popupHelper = $this->mock(PopupReportInterface::class);$budget = factory(Budget::class)->make();- $budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);+ $budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);$popupHelper->shouldReceive('byBudget')->andReturn(new Collection);$this->be($this->user());@@ -289,11 +289,10 @@ class ReportControllerTest extends TestCase$budgetRepos = $this->mock(BudgetRepositoryInterface::class);$accountRepos = $this->mock(AccountRepositoryInterface::class);$categoryRepos = $this->mock(CategoryRepositoryInterface::class);- $categoryRepos = $this->mock(CategoryRepositoryInterface::class);$popupHelper = $this->mock(PopupReportInterface::class);$category = factory(Category::class)->make();- $categoryRepos->shouldReceive('find')->andReturn($category)->once()->withArgs([1]);+ $categoryRepos->shouldReceive('findNull')->andReturn($category)->once()->withArgs([1]);$popupHelper->shouldReceive('byCategory')->andReturn(new Collection);$this->be($this->user());@@ -327,7 +326,7 @@ class ReportControllerTest extends TestCase$accountRepos = $this->mock(AccountRepositoryInterface::class);$account = factory(Account::class)->make();- $accountRepos->shouldReceive('find')->withArgs([1])->andReturn($account)->once();+ $accountRepos->shouldReceive('findNull')->withArgs([1])->andReturn($account)->once();$popupHelper->shouldReceive('byExpenses')->andReturn(new Collection);$this->be($this->user());@@ -361,7 +360,7 @@ class ReportControllerTest extends TestCase$accountRepos = $this->mock(AccountRepositoryInterface::class);$account = factory(Account::class)->make();- $accountRepos->shouldReceive('find')->withArgs([1])->andReturn($account)->once();+ $accountRepos->shouldReceive('findNull')->withArgs([1])->andReturn($account)->once();$popupHelper->shouldReceive('byIncome')->andReturn(new Collection);$this->be($this->user());diff --git a/tests/Feature/Controllers/TagControllerTest.php b/tests/Feature/Controllers/TagControllerTest.phpindex 8d0b07287f..75d7001faf 100644--- a/tests/Feature/Controllers/TagControllerTest.php+++ b/tests/Feature/Controllers/TagControllerTest.php@@ -267,7 +267,7 @@ class TagControllerTest extends TestCase$this->session(['tags.create.uri' => 'http://localhost']);$data = [- 'tag' => 'Hello new tag' . rand(999, 10000),+ 'tag' => 'Hello new tag' . random_int(999, 10000),'tagMode' => 'nothing','tag_position_has_tag' => 'true',@@ -292,7 +292,7 @@ class TagControllerTest extends TestCase$this->session(['tags.edit.uri' => 'http://localhost']);$data = ['id' => 1,- 'tag' => 'Hello updated tag' . rand(999, 10000),+ 'tag' => 'Hello updated tag' . random_int(999, 10000),'tagMode' => 'nothing',];diff --git a/tests/Feature/Controllers/TransactionControllerTest.php b/tests/Feature/Controllers/TransactionControllerTest.phpindex 7e41431863..1e532ad5e1 100644--- a/tests/Feature/Controllers/TransactionControllerTest.php+++ b/tests/Feature/Controllers/TransactionControllerTest.php@@ -61,14 +61,19 @@ class TransactionControllerTest extends TestCase*/public function testIndex(){+ $date = new Carbon;+ $this->session(['start' => $date, 'end' => clone $date]);+// mock stuff+ $transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();$repository = $this->mock(JournalRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);- $repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);+ $repository->shouldReceive('first')->times(2)->andReturn($transfer);$collector->shouldReceive('setTypes')->andReturnSelf();$collector->shouldReceive('setLimit')->andReturnSelf();$collector->shouldReceive('setPage')->andReturnSelf();+ $collector->shouldReceive('addFilter')->andReturnSelf();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();$collector->shouldReceive('withBudgetInformation')->andReturnSelf();@@ -90,16 +95,21 @@ class TransactionControllerTest extends TestCase*/public function testIndexAll(){+ $date = new Carbon;+ $this->session(['start' => $date, 'end' => clone $date]);+// mock stuff+ $transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();$repository = $this->mock(JournalRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);- $repository->shouldReceive('first')->twice()->andReturn(new TransactionJournal);+ $repository->shouldReceive('first')->twice()->andReturn($transfer);$collector->shouldReceive('setTypes')->andReturnSelf();$collector->shouldReceive('setLimit')->andReturnSelf();$collector->shouldReceive('setPage')->andReturnSelf();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();+ $collector->shouldReceive('addFilter')->andReturnSelf();$collector->shouldReceive('withBudgetInformation')->andReturnSelf();$collector->shouldReceive('withCategoryInformation')->andReturnSelf();$collector->shouldReceive('withOpposingAccount')->andReturnSelf();@@ -108,7 +118,7 @@ class TransactionControllerTest extends TestCase$collector->shouldReceive('getJournals')->andReturn(new Collection);$this->be($this->user());- $response = $this->get(route('transactions.index', ['transfer', 'all']));+ $response = $this->get(route('transactions.index.all', ['transfer']));$response->assertStatus(200);// has bread crumb$response->assertSee('<ol class="breadcrumb">');@@ -133,12 +143,14 @@ class TransactionControllerTest extends TestCase// mock stuff$repository = $this->mock(JournalRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);- $repository->shouldReceive('first')->twice()->andReturn(new TransactionJournal);+ $transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();+ $repository->shouldReceive('first')->twice()->andReturn($transfer);$collector->shouldReceive('setTypes')->andReturnSelf();$collector->shouldReceive('setLimit')->andReturnSelf();$collector->shouldReceive('setPage')->andReturnSelf();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();+ $collector->shouldReceive('addFilter')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();$collector->shouldReceive('withBudgetInformation')->andReturnSelf();$collector->shouldReceive('withCategoryInformation')->andReturnSelf();@@ -173,11 +185,13 @@ class TransactionControllerTest extends TestCase// mock stuff$repository = $this->mock(JournalRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);- $repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);+ $transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();+ $repository->shouldReceive('first')->twice()->andReturn($transfer);$collector->shouldReceive('setTypes')->andReturnSelf();$collector->shouldReceive('setLimit')->andReturnSelf();$collector->shouldReceive('setPage')->andReturnSelf();+ $collector->shouldReceive('addFilter')->andReturnSelf();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();$collector->shouldReceive('withBudgetInformation')->andReturnSelf();@@ -213,11 +227,13 @@ class TransactionControllerTest extends TestCase// mock stuff$repository = $this->mock(JournalRepositoryInterface::class);$collector = $this->mock(JournalCollectorInterface::class);- $repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);+ $transfer = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 3)->first();+ $repository->shouldReceive('first')->twice()->andReturn($transfer);$collector->shouldReceive('setTypes')->andReturnSelf();$collector->shouldReceive('setLimit')->andReturnSelf();$collector->shouldReceive('setPage')->andReturnSelf();+ $collector->shouldReceive('addFilter')->andReturnSelf();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();$collector->shouldReceive('setRange')->andReturnSelf();$collector->shouldReceive('withBudgetInformation')->andReturnSelf();diff --git a/tests/Unit/Factory/AccountFactoryTest.php b/tests/Unit/Factory/AccountFactoryTest.phpindex 453db5b708..79368a74ce 100644--- a/tests/Unit/Factory/AccountFactoryTest.php+++ b/tests/Unit/Factory/AccountFactoryTest.php@@ -48,7 +48,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => null,- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',@@ -82,7 +82,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => null,- 'name' => 'Basic CC account #' . rand(1, 1000),+ 'name' => 'Basic CC account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'ccAsset',@@ -119,7 +119,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'expense','iban' => null,- 'name' => 'Basic expense account #' . rand(1, 1000),+ 'name' => 'Basic expense account #' . random_int(1, 1000),'virtualBalance' => '1243','active' => true,'accountRole' => 'defaultAsset',@@ -153,7 +153,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => null,- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',@@ -194,7 +194,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => null,- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',@@ -234,7 +234,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => 'NL18RABO0326747238',- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',@@ -268,7 +268,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => 'NL1XRABO032674X238',- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',@@ -302,7 +302,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => null,- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',@@ -343,7 +343,7 @@ class AccountFactoryTest extends TestCase'account_type_id' => null,'accountType' => 'asset','iban' => null,- 'name' => 'Basic asset account #' . rand(1, 1000),+ 'name' => 'Basic asset account #' . random_int(1, 1000),'virtualBalance' => null,'active' => true,'accountRole' => 'defaultAsset',diff --git a/tests/Unit/Factory/BillFactoryTest.php b/tests/Unit/Factory/BillFactoryTest.phpindex 56775495a9..7b8bf5f07e 100644--- a/tests/Unit/Factory/BillFactoryTest.php+++ b/tests/Unit/Factory/BillFactoryTest.php@@ -42,8 +42,8 @@ class BillFactoryTest extends TestCasepublic function testCreateBasic(){$data = [- 'name' => 'Some new bill #' . rand(1, 1000),- 'match' => 'i,am,word' . rand(1, 1000),+ 'name' => 'Some new bill #' . random_int(1, 1000),+ 'match' => 'i,am,word' . random_int(1, 1000),'amount_min' => '5','amount_max' => '10','date' => '2018-01-01',@@ -77,8 +77,8 @@ class BillFactoryTest extends TestCasepublic function testCreateEmptyNotes(){$data = [- 'name' => 'Some new bill #' . rand(1, 1000),- 'match' => 'i,am,word' . rand(1, 1000),+ 'name' => 'Some new bill #' . random_int(1, 1000),+ 'match' => 'i,am,word' . random_int(1, 1000),'amount_min' => '5','amount_max' => '10','date' => '2018-01-01',@@ -146,7 +146,7 @@ class BillFactoryTest extends TestCase/** @var BillFactory $factory */$factory = app(BillFactory::class);$factory->setUser($this->user());- $piggy = $factory->find(null, 'I dont exist' . rand(1, 1000));+ $piggy = $factory->find(null, 'I dont exist' . random_int(1, 1000));$this->assertNull($piggy);}diff --git a/tests/Unit/Factory/BudgetFactoryTest.php b/tests/Unit/Factory/BudgetFactoryTest.phpindex 121cc02541..d5828fd31a 100644--- a/tests/Unit/Factory/BudgetFactoryTest.php+++ b/tests/Unit/Factory/BudgetFactoryTest.php@@ -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.' . rand(1, 000)));+ $this->assertNull($factory->find(null, 'I dont exist.' . random_int(1, 1000)));}}diff --git a/tests/Unit/Factory/CategoryFactoryTest.php b/tests/Unit/Factory/CategoryFactoryTest.phpindex cb10c1a114..4bb8a6ddb1 100644--- a/tests/Unit/Factory/CategoryFactoryTest.php+++ b/tests/Unit/Factory/CategoryFactoryTest.php@@ -67,7 +67,7 @@ class CategoryFactoryTest extends TestCasepublic function testFindOrCreateInvalidID(){$existing = $this->user()->categories()->max('id');- $existing = $existing + 4;+ $existing += 4;/** @var CategoryFactory $factory */$factory = app(CategoryFactory::class);@@ -80,7 +80,7 @@ class CategoryFactoryTest extends TestCase*/public function testFindOrCreateNewName(){- $name = 'Some new category #' . rand(1, 1000);+ $name = 'Some new category #' . random_int(1, 1000);/** @var CategoryFactory $factory */$factory = app(CategoryFactory::class);diff --git a/tests/Unit/Factory/PiggyBankFactoryTest.php b/tests/Unit/Factory/PiggyBankFactoryTest.phpindex 89f4eb055d..7905dd06dd 100644--- a/tests/Unit/Factory/PiggyBankFactoryTest.php+++ b/tests/Unit/Factory/PiggyBankFactoryTest.php@@ -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.' . rand(1, 000)));+ $this->assertNull($factory->find(null, 'I dont exist.' . random_int(1, 1000)));}}diff --git a/tests/Unit/Factory/TagFactoryTest.php b/tests/Unit/Factory/TagFactoryTest.phpindex 67b7515316..41e239e392 100644--- a/tests/Unit/Factory/TagFactoryTest.php+++ b/tests/Unit/Factory/TagFactoryTest.php@@ -51,7 +51,7 @@ class TagFactoryTest extends TestCase*/public function testFindOrCreateNew(){- $tag = 'Some new tag#' . rand(1, 1000);+ $tag = 'Some new tag#' . random_int(1, 1000);/** @var TagFactory $factory */$factory = app(TagFactory::class);$factory->setUser($this->user());diff --git a/tests/Unit/Helpers/MetaPieChartTest.php b/tests/Unit/Helpers/MetaPieChartTest.phpindex 1b87ede22c..726fa3d5fa 100644--- a/tests/Unit/Helpers/MetaPieChartTest.php+++ b/tests/Unit/Helpers/MetaPieChartTest.php@@ -92,8 +92,8 @@ class MetaPieChartTest extends TestCase$keys = array_keys($chart);$this->assertEquals($keys[0], $accounts[1]->name);$this->assertEquals($keys[1], $accounts[2]->name);- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[1]->name]));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[2]->name]));$this->assertTrue(true);}@@ -149,9 +149,9 @@ class MetaPieChartTest extends TestCase$keys = array_keys($chart);$this->assertEquals($keys[0], $accounts[1]->name);$this->assertEquals($keys[1], $accounts[2]->name);- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));- $this->assertTrue(0 === bccomp('-5000', $chart['Everything else']));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[1]->name]));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[2]->name]));+ $this->assertSame(0, bccomp('-5000', $chart['Everything else']));$this->assertTrue(true);}@@ -203,8 +203,8 @@ class MetaPieChartTest extends TestCase$keys = array_keys($chart);$this->assertEquals($keys[0], $accounts[1]->name);$this->assertEquals($keys[1], $accounts[2]->name);- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[1]->name]));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[2]->name]));$this->assertTrue(true);}@@ -259,9 +259,9 @@ class MetaPieChartTest extends TestCase$keys = array_keys($chart);$this->assertEquals($keys[0], $accounts[1]->name);$this->assertEquals($keys[1], $accounts[2]->name);- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));- $this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));- $this->assertTrue(0 === bccomp('1000', $chart['Everything else']));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[1]->name]));+ $this->assertSame(0, bccomp('1000', $chart[$accounts[2]->name]));+ $this->assertSame(0, bccomp('1000', $chart['Everything else']));$this->assertTrue(true);}diff --git a/tests/Unit/Import/Configuration/FileConfiguratorTest.php b/tests/Unit/Import/Configuration/FileConfiguratorTest.phpindex b57c28f9e5..a5bf52d6fd 100644--- a/tests/Unit/Import/Configuration/FileConfiguratorTest.php+++ b/tests/Unit/Import/Configuration/FileConfiguratorTest.php@@ -679,7 +679,7 @@ class FileConfiguratorTest extends TestCase$job = new ImportJob;$job->file_type = 'file';$job->status = 'new';- $job->key = 'x' . rand(1, 100000);+ $job->key = 'x' . random_int(1, 100000);$job->user()->associate($this->user());$job->configuration = $config;diff --git a/tests/Unit/Import/FileProcessor/CsvProcessorTest.php b/tests/Unit/Import/FileProcessor/CsvProcessorTest.phpindex 3c4370b2fa..f98d0b7692 100644--- a/tests/Unit/Import/FileProcessor/CsvProcessorTest.php+++ b/tests/Unit/Import/FileProcessor/CsvProcessorTest.php@@ -337,7 +337,7 @@ class CsvProcessorTest extends TestCase$job = new ImportJob;$job->file_type = 'file';$job->status = 'new';- $job->key = 'x' . rand(1, 100000);+ $job->key = 'x' . random_int(1, 100000);$job->user()->associate($this->user());$job->configuration = $config;diff --git a/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php b/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.phpindex 0dcbf1e1dc..aaefb028fb 100644--- a/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php+++ b/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php@@ -40,7 +40,7 @@ class AccountDestroyServiceTest extends TestCasepublic function testDestroyBasic(){$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);/** @var AccountDestroyService $service */@@ -57,7 +57,7 @@ class AccountDestroyServiceTest extends TestCase{// create objects:$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);Transaction::create(['account_id' => $account->id, 'transaction_journal_id' => 1, 'amount' => 10, 'transaction_currency_id' => 1]);@@ -79,11 +79,11 @@ class AccountDestroyServiceTest extends TestCasepublic function testDestroyMove(){$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);$move = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);$transaction = Transaction::create(['account_id' => $account->id, 'transaction_journal_id' => 1, 'amount' => 10, 'transaction_currency_id' => 1]);diff --git a/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php b/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.phpindex 4f7acf8beb..93f3a7d6b8 100644--- a/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php+++ b/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php@@ -46,7 +46,7 @@ class AccountUpdateServiceTest extends TestCase{/** @var Account $account */$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);$opposing = $this->user()->accounts()->first();@@ -67,7 +67,7 @@ class AccountUpdateServiceTest extends TestCase$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,@@ -96,7 +96,7 @@ class AccountUpdateServiceTest extends TestCase/** @var Account $account */$account = $this->user()->accounts()->first();$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,@@ -119,7 +119,7 @@ class AccountUpdateServiceTest extends TestCase/** @var Account $account */$account = $this->user()->accounts()->first();$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,@@ -149,7 +149,7 @@ class AccountUpdateServiceTest extends TestCase$note->save();$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,@@ -174,7 +174,7 @@ class AccountUpdateServiceTest extends TestCase{/** @var Account $account */$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);$opposing = $this->user()->accounts()->first();@@ -195,7 +195,7 @@ class AccountUpdateServiceTest extends TestCase$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,@@ -229,7 +229,7 @@ class AccountUpdateServiceTest extends TestCase/** @var Account $account */$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);$opposing = $this->user()->accounts()->first();@@ -250,7 +250,7 @@ class AccountUpdateServiceTest extends TestCase$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,@@ -281,11 +281,11 @@ class AccountUpdateServiceTest extends TestCase{/** @var Account $account */$account = Account::create(- ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . rand(1, 1000),+ ['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),'virtual_balance' => '0', 'iban' => null, 'active' => true]);$data = [- 'name' => 'Some new name #' . rand(1, 1000),+ 'name' => 'Some new name #' . random_int(1, 1000),'active' => true,'virtualBalance' => '0','iban' => null,diff --git a/tests/Unit/Services/Internal/Update/JournalUpdateServiceTest.php b/tests/Unit/Services/Internal/Update/JournalUpdateServiceTest.phpindex ef52e5067b..80bdd4b213 100644--- a/tests/Unit/Services/Internal/Update/JournalUpdateServiceTest.php+++ b/tests/Unit/Services/Internal/Update/JournalUpdateServiceTest.php@@ -65,7 +65,7 @@ class JournalUpdateServiceTest extends TestCase/** @var TransactionJournal $journal */$journal = $this->user()->transactionJournals()->where('transaction_type_id', 2)->first();$data = [- 'description' => 'Updated journal #' . rand(1, 1000),+ 'description' => 'Updated journal #' . random_int(1, 1000),'date' => new Carbon('2018-01-01'),'bill_id' => null,'bill_name' => null,@@ -107,7 +107,7 @@ class JournalUpdateServiceTest extends TestCase/** @var TransactionJournal $journal */$journal = $this->user()->transactionJournals()->inRandomOrder()->where('transaction_type_id', 2)->first();$data = [- 'description' => 'Updated journal #' . rand(1, 1000),+ 'description' => 'Updated journal #' . random_int(1, 1000),'date' => new Carbon('2018-01-01'),'bill_id' => null,'bill_name' => null,@@ -199,7 +199,7 @@ class JournalUpdateServiceTest extends TestCase/** @var TransactionJournal $journal */$journal = $this->user()->transactionJournals()->skip(4)->where('transaction_type_id', 1)->first();$data = [- 'description' => 'Updated journal #' . rand(1, 1000),+ 'description' => 'Updated journal #' . random_int(1, 1000),'date' => new Carbon('2018-01-01'),'bill_id' => null,'bill_name' => null,diff --git a/tests/Unit/TransactionRules/Actions/AddTagTest.php b/tests/Unit/TransactionRules/Actions/AddTagTest.phpindex 948ffc4d67..3104d86475 100644--- a/tests/Unit/TransactionRules/Actions/AddTagTest.php+++ b/tests/Unit/TransactionRules/Actions/AddTagTest.php@@ -59,7 +59,7 @@ class AddTagTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();$ruleAction = new RuleAction;- $ruleAction->action_value = 'TestTag-' . rand(1, 1000);+ $ruleAction->action_value = 'TestTag-' . random_int(1, 1000);$action = new AddTag($ruleAction);$result = $action->act($journal);$this->assertTrue($result);diff --git a/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php b/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.phpindex 472697d372..a01343cba9 100644--- a/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php+++ b/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php@@ -39,8 +39,8 @@ class PrependDescriptionTest extends TestCasepublic function testAct(){// get journal, give fixed description- $description = 'text' . rand(1, 1000);- $prepend = 'prepend' . rand(1, 1234);+ $description = 'text' . random_int(1, 1000);+ $prepend = 'prepend' . random_int(1, 1234);$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();$journal->description = $description;$journal->save();diff --git a/tests/Unit/TransactionRules/Actions/RemoveTagTest.php b/tests/Unit/TransactionRules/Actions/RemoveTagTest.phpindex 2a0ea6ccff..9753b25317 100644--- a/tests/Unit/TransactionRules/Actions/RemoveTagTest.php+++ b/tests/Unit/TransactionRules/Actions/RemoveTagTest.php@@ -57,7 +57,7 @@ class RemoveTagTest extends TestCaseforeach ($journal->tags()->get() as $tag) {$this->assertNotEquals($firstTag->id, $tag->id);}- $this->assertEquals(($originalCount - 1), $journal->tags()->count());+ $this->assertEquals($originalCount - 1, $journal->tags()->count());}/**@@ -75,7 +75,7 @@ class RemoveTagTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = rand(1, 1234) . 'nosuchtag';+ $ruleAction->action_value = random_int(1, 1234) . 'nosuchtag';$action = new RemoveTag($ruleAction);$result = $action->act($journal);$this->assertTrue($result);diff --git a/tests/Unit/TransactionRules/Actions/SetDescriptionTest.php b/tests/Unit/TransactionRules/Actions/SetDescriptionTest.phpindex 4f329f772c..d6320379b4 100644--- a/tests/Unit/TransactionRules/Actions/SetDescriptionTest.php+++ b/tests/Unit/TransactionRules/Actions/SetDescriptionTest.php@@ -39,8 +39,8 @@ class SetDescriptionTest extends TestCasepublic function testAct(){// get journal, give fixed description- $description = 'text' . rand(1, 1000);- $newDescription = 'new description' . rand(1, 1234);+ $description = 'text' . random_int(1, 1000);+ $newDescription = 'new description' . random_int(1, 1234);$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();$journal->description = $description;$journal->save();diff --git a/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php b/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.phpindex fc25d63627..7e8d397689 100644--- a/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php+++ b/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php@@ -103,7 +103,7 @@ class SetDestinationAccountTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'Not existing asset account #' . rand(1, 1000);+ $ruleAction->action_value = 'Not existing asset account #' . random_int(1, 1000);$action = new SetDestinationAccount($ruleAction);$result = $action->act($journal);$this->assertFalse($result);@@ -134,7 +134,7 @@ class SetDestinationAccountTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'Not existing expense account #' . rand(1, 1000);+ $ruleAction->action_value = 'Not existing expense account #' . random_int(1, 1000);$action = new SetDestinationAccount($ruleAction);$result = $action->act($journal);@@ -202,7 +202,7 @@ class SetDestinationAccountTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'Some new asset ' . rand(1, 1000);+ $ruleAction->action_value = 'Some new asset ' . random_int(1, 1000);$action = new SetDestinationAccount($ruleAction);$result = $action->act($journal);$this->assertFalse($result);diff --git a/tests/Unit/TransactionRules/Actions/SetNotesTest.php b/tests/Unit/TransactionRules/Actions/SetNotesTest.phpindex 089bcf9b35..bbe6c8702d 100644--- a/tests/Unit/TransactionRules/Actions/SetNotesTest.php+++ b/tests/Unit/TransactionRules/Actions/SetNotesTest.php@@ -52,7 +52,7 @@ class SetNotesTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'These are new notes ' . rand(1, 1234);+ $ruleAction->action_value = 'These are new notes ' . random_int(1, 1234);$action = new SetNotes($ruleAction);$result = $action->act($journal);$this->assertTrue($result);@@ -75,7 +75,7 @@ class SetNotesTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'These are new notes ' . rand(1, 1234);+ $ruleAction->action_value = 'These are new notes ' . random_int(1, 1234);$action = new SetNotes($ruleAction);$result = $action->act($journal);$this->assertTrue($result);diff --git a/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.php b/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.phpindex 9042e0aa56..b31de17f98 100644--- a/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.php+++ b/tests/Unit/TransactionRules/Actions/SetSourceAccountTest.php@@ -104,7 +104,7 @@ class SetSourceAccountTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'Some new revenue #' . rand(1, 1000);+ $ruleAction->action_value = 'Some new revenue #' . random_int(1, 1000);$action = new SetSourceAccount($ruleAction);$result = $action->act($journal);$this->assertTrue($result);@@ -173,7 +173,7 @@ class SetSourceAccountTest extends TestCase// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'Some new account #' . rand(1, 1000);+ $ruleAction->action_value = 'Some new account #' . random_int(1, 1000);$action = new SetSourceAccount($ruleAction);$result = $action->act($journal);$this->assertFalse($result);@@ -196,7 +196,7 @@ class SetSourceAccountTest extends TestCase$accountRepos->shouldReceive('setUser');// fire the action:$ruleAction = new RuleAction;- $ruleAction->action_value = 'Some new asset ' . rand(1, 1000);+ $ruleAction->action_value = 'Some new asset ' . random_int(1, 1000);$action = new SetSourceAccount($ruleAction);$result = $action->act($journal);$this->assertFalse($result);diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.phpindex 042550bb3c..bff1abe830 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountContainsTest.php@@ -56,7 +56,7 @@ class FromAccountContainsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = FromAccountContains::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = FromAccountContains::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.phpindex e0d78b94d3..f158707b9f 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountEndsTest.php@@ -74,7 +74,7 @@ class FromAccountEndsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = FromAccountEnds::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = FromAccountEnds::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.phpindex 34d74c0b8f..d2a91b8b71 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php@@ -56,7 +56,7 @@ class FromAccountIsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = FromAccountIs::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = FromAccountIs::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.phpindex fc0e1810a8..324dca9719 100644--- a/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php+++ b/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php@@ -66,7 +66,7 @@ class FromAccountStartsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = FromAccountStarts::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = FromAccountStarts::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.phpindex 405bec7e14..d161459c5d 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountContainsTest.php@@ -50,7 +50,7 @@ class ToAccountContainsTest extends TestCasepublic function testTriggeredNot(){$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = ToAccountContains::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = ToAccountContains::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.phpindex a9667d30ff..15b0ff8ded 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountEndsTest.php@@ -74,7 +74,7 @@ class ToAccountEndsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = ToAccountEnds::makeFromStrings(strval(rand(1, 234)), false);+ $trigger = ToAccountEnds::makeFromStrings(strval(random_int(1, 234)), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.phpindex c2c8360163..e8ae02cdff 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php@@ -52,7 +52,7 @@ class ToAccountIsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = ToAccountIs::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = ToAccountIs::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.phpindex afd8ea8715..f99844c634 100644--- a/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php+++ b/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php@@ -74,7 +74,7 @@ class ToAccountStartsTest extends TestCase{$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();- $trigger = ToAccountStarts::makeFromStrings('some name' . rand(1, 234), false);+ $trigger = ToAccountStarts::makeFromStrings('some name' . random_int(1, 234), false);$result = $trigger->triggered($journal);$this->assertFalse($result);}diff --git a/tests/Unit/Transformers/AccountTransformerTest.php b/tests/Unit/Transformers/AccountTransformerTest.phpindex 3a3557c16e..90d2e76505 100644--- a/tests/Unit/Transformers/AccountTransformerTest.php+++ b/tests/Unit/Transformers/AccountTransformerTest.php@@ -59,7 +59,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -96,7 +96,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -128,7 +128,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -142,7 +142,7 @@ class AccountTransformerTest extends TestCase'noteable_id' => $account->id,'noteable_type' => Account::class,'title' => null,- 'text' => 'I am a note #' . rand(1, 1000),+ 'text' => 'I am a note #' . random_int(1, 1000),]);@@ -220,7 +220,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -233,7 +233,7 @@ class AccountTransformerTest extends TestCase'noteable_id' => $account->id,'noteable_type' => Account::class,'title' => null,- 'text' => 'I am a note #' . rand(1, 1000),+ 'text' => 'I am a note #' . random_int(1, 1000),]);@@ -310,7 +310,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -369,7 +369,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -408,7 +408,7 @@ class AccountTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -421,7 +421,7 @@ class AccountTransformerTest extends TestCase'noteable_id' => $account->id,'noteable_type' => Account::class,'title' => null,- 'text' => 'I am a note #' . rand(1, 1000),+ 'text' => 'I am a note #' . random_int(1, 1000),]);diff --git a/tests/Unit/Transformers/AttachmentTransformerTest.php b/tests/Unit/Transformers/AttachmentTransformerTest.phpindex b873db33e3..e7b8034c3a 100644--- a/tests/Unit/Transformers/AttachmentTransformerTest.php+++ b/tests/Unit/Transformers/AttachmentTransformerTest.php@@ -41,7 +41,7 @@ class AttachmentTransformerTest extends TestCase*/public function testBasic(){- $md5 = md5('hello' . rand(1, 10000));+ $md5 = md5('hello' . random_int(1, 10000));$attachment = Attachment::create(['user_id' => $this->user()->id,diff --git a/tests/Unit/Transformers/BillTransformerTest.php b/tests/Unit/Transformers/BillTransformerTest.phpindex c81a26d345..75cee9e995 100644--- a/tests/Unit/Transformers/BillTransformerTest.php+++ b/tests/Unit/Transformers/BillTransformerTest.php@@ -50,8 +50,8 @@ class BillTransformerTest extends TestCase$bill = Bill::create(['user_id' => $this->user()->id,- 'name' => 'Some bill ' . rand(1, 10000),- 'match' => 'word,' . rand(1, 10000),+ 'name' => 'Some bill ' . random_int(1, 10000),+ 'match' => 'word,' . random_int(1, 10000),'amount_min' => 12.34,'amount_max' => 45.67,'date' => '2018-01-02',@@ -78,8 +78,8 @@ class BillTransformerTest extends TestCase$bill = Bill::create(['user_id' => $this->user()->id,- 'name' => 'Some bill ' . rand(1, 10000),- 'match' => 'word,' . rand(1, 10000),+ 'name' => 'Some bill ' . random_int(1, 10000),+ 'match' => 'word,' . random_int(1, 10000),'amount_min' => 12.34,'amount_max' => 45.67,'date' => '2018-01-02',@@ -88,7 +88,7 @@ class BillTransformerTest extends TestCase'active' => 1,]);- $noteText = 'I are a note ' . rand(1, 10000);+ $noteText = 'I are a note ' . random_int(1, 10000);Note::create(['noteable_id' => $bill->id,@@ -122,8 +122,8 @@ class BillTransformerTest extends TestCase$bill = Bill::create(['user_id' => $this->user()->id,- 'name' => 'Some bill ' . rand(1, 10000),- 'match' => 'word,' . rand(1, 10000),+ 'name' => 'Some bill ' . random_int(1, 10000),+ 'match' => 'word,' . random_int(1, 10000),'amount_min' => 12.34,'amount_max' => 45.67,'date' => '2018-01-02',diff --git a/tests/Unit/Transformers/BudgetTransformerTest.php b/tests/Unit/Transformers/BudgetTransformerTest.phpindex 17721c909d..a9554212b3 100644--- a/tests/Unit/Transformers/BudgetTransformerTest.php+++ b/tests/Unit/Transformers/BudgetTransformerTest.php@@ -45,7 +45,7 @@ class BudgetTransformerTest extends TestCase$budget = Budget::create(['user_id' => $this->user()->id,- 'name' => 'Some budget ' . rand(1, 10000),+ 'name' => 'Some budget ' . random_int(1, 10000),'active' => 1,]);diff --git a/tests/Unit/Transformers/CategoryTransformerTest.php b/tests/Unit/Transformers/CategoryTransformerTest.phpindex 175ea4f4c7..68cdae5e43 100644--- a/tests/Unit/Transformers/CategoryTransformerTest.php+++ b/tests/Unit/Transformers/CategoryTransformerTest.php@@ -45,7 +45,7 @@ class CategoryTransformerTest extends TestCase$category = Category::create(['user_id' => $this->user()->id,- 'name' => 'Some budget ' . rand(1, 10000),+ 'name' => 'Some budget ' . random_int(1, 10000),'active' => 1,]);diff --git a/tests/Unit/Transformers/PiggyBankEventTransformerTest.php b/tests/Unit/Transformers/PiggyBankEventTransformerTest.phpindex 6376f3eb5f..967f2b2dde 100644--- a/tests/Unit/Transformers/PiggyBankEventTransformerTest.php+++ b/tests/Unit/Transformers/PiggyBankEventTransformerTest.php@@ -50,7 +50,7 @@ class PiggyBankEventTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -60,7 +60,7 @@ class PiggyBankEventTransformerTest extends TestCase$piggy = PiggyBank::create(['account_id' => $account->id,- 'name' => 'Some random piggy #' . rand(1, 10000),+ 'name' => 'Some random piggy #' . random_int(1, 10000),'targetamount' => '1000','startdate' => '2018-01-01','targetdate' => '2018-01-31',@@ -99,7 +99,7 @@ class PiggyBankEventTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -119,7 +119,7 @@ class PiggyBankEventTransformerTest extends TestCase$piggy = PiggyBank::create(['account_id' => $account->id,- 'name' => 'Some random piggy #' . rand(1, 10000),+ 'name' => 'Some random piggy #' . random_int(1, 10000),'targetamount' => '1000','startdate' => '2018-01-01','targetdate' => '2018-01-31',diff --git a/tests/Unit/Transformers/PiggyBankTransformerTest.php b/tests/Unit/Transformers/PiggyBankTransformerTest.phpindex fc78472081..db311a65ae 100644--- a/tests/Unit/Transformers/PiggyBankTransformerTest.php+++ b/tests/Unit/Transformers/PiggyBankTransformerTest.php@@ -56,7 +56,7 @@ class PiggyBankTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -66,7 +66,7 @@ class PiggyBankTransformerTest extends TestCase$piggy = PiggyBank::create(['account_id' => $account->id,- 'name' => 'Some random piggy #' . rand(1, 10000),+ 'name' => 'Some random piggy #' . random_int(1, 10000),'targetamount' => '1000','startdate' => '2018-01-01','targetdate' => '2018-01-31',@@ -104,7 +104,7 @@ class PiggyBankTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -123,7 +123,7 @@ class PiggyBankTransformerTest extends TestCase$piggy = PiggyBank::create(['account_id' => $account->id,- 'name' => 'Some random piggy #' . rand(1, 10000),+ 'name' => 'Some random piggy #' . random_int(1, 10000),'targetamount' => '1000','startdate' => '2018-01-01','targetdate' => '2018-01-31',@@ -161,7 +161,7 @@ class PiggyBankTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -180,7 +180,7 @@ class PiggyBankTransformerTest extends TestCase$piggy = PiggyBank::create(['account_id' => $account->id,- 'name' => 'Some random piggy #' . rand(1, 10000),+ 'name' => 'Some random piggy #' . random_int(1, 10000),'targetamount' => '1000','startdate' => '2018-01-01','targetdate' => '2018-01-31',diff --git a/tests/Unit/Transformers/TagTransformerTest.php b/tests/Unit/Transformers/TagTransformerTest.phpindex b44b9b3fc2..16326f0a10 100644--- a/tests/Unit/Transformers/TagTransformerTest.php+++ b/tests/Unit/Transformers/TagTransformerTest.php@@ -44,7 +44,7 @@ class TagTransformerTest extends TestCase$tag = Tag::create(['user_id' => $this->user()->id,- 'tag' => 'Some tag ' . rand(1, 1000),+ 'tag' => 'Some tag ' . random_int(1, 1000),'tagMode' => 'nothing','date' => '2018-01-01','description' => 'Some tag',diff --git a/tests/Unit/Transformers/TransactionTransformerTest.php b/tests/Unit/Transformers/TransactionTransformerTest.phpindex 2db67d4b79..6c891c424d 100644--- a/tests/Unit/Transformers/TransactionTransformerTest.php+++ b/tests/Unit/Transformers/TransactionTransformerTest.php@@ -57,7 +57,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -70,7 +70,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -141,7 +141,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -154,7 +154,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 5, // revenue account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -225,7 +225,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -238,7 +238,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 5, // revenue account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -272,7 +272,7 @@ class TransactionTransformerTest extends TestCase$budget = Budget::create(['user_id' => $this->user()->id,- 'name' => 'Random budget #' . rand(1, 1000),+ 'name' => 'Random budget #' . random_int(1, 1000),'active' => 1,]);@@ -318,7 +318,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -331,7 +331,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -410,7 +410,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -423,7 +423,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -448,7 +448,7 @@ class TransactionTransformerTest extends TestCase$budget = Budget::create(['user_id' => $this->user()->id,- 'name' => 'Random budget #' . rand(1, 1000),+ 'name' => 'Random budget #' . random_int(1, 1000),'active' => 1,]);@@ -508,7 +508,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -521,7 +521,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -546,7 +546,7 @@ class TransactionTransformerTest extends TestCase$category = Category::create(['user_id' => $this->user()->id,- 'name' => 'Random category #' . rand(1, 1000),+ 'name' => 'Random category #' . random_int(1, 1000),'active' => 1,]);@@ -606,7 +606,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -691,7 +691,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -776,7 +776,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -861,7 +861,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -946,7 +946,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -959,7 +959,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -984,7 +984,7 @@ class TransactionTransformerTest extends TestCase$budget = Budget::create(['user_id' => $this->user()->id,- 'name' => 'Random budget #' . rand(1, 1000),+ 'name' => 'Random budget #' . random_int(1, 1000),'active' => 1,]);@@ -1046,7 +1046,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1059,7 +1059,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1084,7 +1084,7 @@ class TransactionTransformerTest extends TestCase$category = Category::create(['user_id' => $this->user()->id,- 'name' => 'Random category #' . rand(1, 1000),+ 'name' => 'Random category #' . random_int(1, 1000),'active' => 1,]);@@ -1145,7 +1145,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1158,7 +1158,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 4, // expense account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1229,7 +1229,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1242,7 +1242,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1313,7 +1313,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,@@ -1326,7 +1326,7 @@ class TransactionTransformerTest extends TestCase['user_id' => $this->user()->id,'account_type_id' => 3, // asset account- 'name' => 'Random name #' . rand(1, 10000),+ 'name' => 'Random name #' . random_int(1, 10000),'virtual_balance' => 12.34,'iban' => 'NL85ABNA0466812694','active' => 1,