mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Expand API test to bill store.
This commit is contained in:
@@ -61,7 +61,7 @@ class StoreControllerTest extends TestCase
|
||||
}
|
||||
// run account store with a minimal data set:
|
||||
$route = 'api.v1.accounts.store';
|
||||
$this->submitAndCompare($route, $submission);
|
||||
$this->storeAndCompare($route, $submission);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,79 +106,81 @@ class StoreControllerTest extends TestCase
|
||||
*/
|
||||
private function optionalSets(): array
|
||||
{
|
||||
$faker = Factory::create();
|
||||
$currencies = [
|
||||
$faker = Factory::create();
|
||||
$currencies = [
|
||||
1 => 'EUR',
|
||||
2 => 'HUF',
|
||||
3 => 'GBP',
|
||||
4 => 'UAH',
|
||||
];
|
||||
$rand = rand(1, 4);
|
||||
$rand = rand(1, 4);
|
||||
// rand
|
||||
|
||||
|
||||
return [
|
||||
'active' => [
|
||||
'active' => [
|
||||
'fields' => [
|
||||
'active' => $faker->boolean,
|
||||
],
|
||||
],
|
||||
// 'iban' => [
|
||||
// 'fields' => [
|
||||
// 'iban' => $faker->iban(),
|
||||
// ],
|
||||
// ],
|
||||
// 'bic' => [
|
||||
// 'fields' => [
|
||||
// 'bic' => $faker->swiftBicNumber,
|
||||
// ],
|
||||
// ],
|
||||
// 'account_number' => [
|
||||
// 'fields' => [
|
||||
// 'account_number' => $faker->iban(),
|
||||
// ],
|
||||
// ],
|
||||
// 'ob' => [
|
||||
// 'fields' => [
|
||||
// 'opening_balance' => $this->getRandomAmount(),
|
||||
// 'opening_balance_date' => $this->getRandomDateString(),
|
||||
// ],
|
||||
// ],
|
||||
// 'virtual_balance' => [
|
||||
// 'fields' => [
|
||||
// 'virtual_balance' => $this->getRandomAmount(),
|
||||
// ],
|
||||
// ],
|
||||
// 'currency_id' => [
|
||||
// 'fields' => [
|
||||
// 'currency_id' => $rand,
|
||||
// ],
|
||||
// ],
|
||||
// 'currency_code' => [
|
||||
// 'fields' => [
|
||||
// 'currency_code' => $currencies[$rand],
|
||||
// ],
|
||||
// ],
|
||||
// 'order' => [
|
||||
// 'fields' => [
|
||||
// 'order' => $faker->numberBetween(1, 5),
|
||||
// ],
|
||||
// ],
|
||||
// 'include_net_worth' => [
|
||||
// 'fields' => [
|
||||
// 'include_net_worth' => $faker->boolean,
|
||||
// ],
|
||||
// ],
|
||||
// 'notes' => [
|
||||
// 'fields' => [
|
||||
// 'notes' => join(' ', $faker->words(5)),
|
||||
// ],
|
||||
// ],
|
||||
// 'location' => [
|
||||
// 'fields' => [
|
||||
// 'latitude' => $faker->latitude,
|
||||
// 'longitude' => $faker->longitude,
|
||||
// 'zoom_level' => $faker->numberBetween(1, 10),
|
||||
// ],
|
||||
// ],
|
||||
'iban' => [
|
||||
'fields' => [
|
||||
'iban' => $faker->iban(),
|
||||
],
|
||||
],
|
||||
'bic' => [
|
||||
'fields' => [
|
||||
'bic' => $faker->swiftBicNumber,
|
||||
],
|
||||
],
|
||||
'account_number' => [
|
||||
'fields' => [
|
||||
'account_number' => $faker->iban(),
|
||||
],
|
||||
],
|
||||
'ob' => [
|
||||
'fields' => [
|
||||
'opening_balance' => $this->getRandomAmount(),
|
||||
'opening_balance_date' => $this->getRandomDateString(),
|
||||
],
|
||||
],
|
||||
'virtual_balance' => [
|
||||
'fields' => [
|
||||
'virtual_balance' => $this->getRandomAmount(),
|
||||
],
|
||||
],
|
||||
'currency_id' => [
|
||||
'fields' => [
|
||||
'currency_id' => $rand,
|
||||
],
|
||||
],
|
||||
'currency_code' => [
|
||||
'fields' => [
|
||||
'currency_code' => $currencies[$rand],
|
||||
],
|
||||
],
|
||||
'order' => [
|
||||
'fields' => [
|
||||
'order' => $faker->numberBetween(1, 5),
|
||||
],
|
||||
],
|
||||
'include_net_worth' => [
|
||||
'fields' => [
|
||||
'include_net_worth' => $faker->boolean,
|
||||
],
|
||||
],
|
||||
'notes' => [
|
||||
'fields' => [
|
||||
'notes' => join(' ', $faker->words(5)),
|
||||
],
|
||||
],
|
||||
'location' => [
|
||||
'fields' => [
|
||||
'latitude' => $faker->latitude,
|
||||
'longitude' => $faker->longitude,
|
||||
'zoom_level' => $faker->numberBetween(1, 10),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,7 @@ class UpdateControllerTest extends TestCase
|
||||
$accountRoles = ['defaultAsset', 'sharedAsset', 'savingAsset'];
|
||||
$accountRole = $accountRoles[rand(0, count($accountRoles) - 1)];
|
||||
|
||||
$liabilityRoles = ['loan', 'debt', 'asset'];
|
||||
$liabilityRoles = ['loan', 'debt', 'mortgage'];
|
||||
$liabilityRole = $liabilityRoles[rand(0, count($liabilityRoles) - 1)];
|
||||
|
||||
$interestPeriods = ['daily', 'monthly', 'yearly'];
|
||||
@@ -179,7 +179,7 @@ class UpdateControllerTest extends TestCase
|
||||
'notes' => [
|
||||
'id' => 1,
|
||||
'fields' => [
|
||||
'notes' => ['test_value' => $faker->randomAscii],
|
||||
'notes' => ['test_value' => join(' ', $faker->words(3))],
|
||||
],
|
||||
'extra_ignore' => [],
|
||||
],
|
||||
|
Reference in New Issue
Block a user