Fix some edge cases in recurrences.

This commit is contained in:
James Cole
2021-03-15 19:51:55 +01:00
parent a0b46d9d8a
commit d5ee87ddee
8 changed files with 92 additions and 23 deletions

View File

@@ -212,10 +212,10 @@ class UpdateControllerTest extends TestCase
// now loop fields, enough to create sets I guess?
// TODO maybe do some permutation stuff here?
$extraTransaction = [
'currency_id' => $faker->numberBetween(1, 4),
'foreign_currency_id' => $faker->numberBetween(4, 6),
'currency_id' => (string)$faker->numberBetween(1, 4),
'foreign_currency_id' => (string)$faker->numberBetween(4, 6),
'source_id' => $faker->numberBetween(1, 3),
'destination_id' => $faker->numberBetween(8),
'destination_id' => $faker->numberBetween(8, 8),
'amount' => number_format($faker->randomFloat(2, 10, 100), 2),
'foreign_amount' => number_format($faker->randomFloat(2, 10, 100), 2),
'description' => $faker->uuid,

View File

@@ -196,7 +196,7 @@ trait TestHelpers
if (array_key_exists($rKey, $submissionArray)) {
// comparison must be on array:
if (is_array($submissionArray[$rKey]) && is_array($rValue)) {
$this->compareArray($originalAttributes, $rKey, $submissionArray[$rKey], $rValue);
$this->compareArray($submissionArray, $rKey, $submissionArray[$rKey], $rValue);
}
if (!is_array($submissionArray[$rKey]) && !is_array($rValue)) {
@@ -261,7 +261,7 @@ trait TestHelpers
$responseBody = $response->content();
$responseJson = json_decode($responseBody, true);
$status = $response->getStatusCode();
$this->assertEquals($status, 200, sprintf("Submission: %s\nResponse: %s", json_encode($submission), $responseBody));
$this->assertEquals($status, 200, sprintf("Submission:\n%s\nResponse: %s", json_encode($submission), $responseBody));
$response->assertHeader('Content-Type', 'application/vnd.api+json');