From ee67f60652cbdbde3f481336a8a3c5162665c7c0 Mon Sep 17 00:00:00 2001 From: Dario Rekowski on RockPI Date: Mon, 28 Jun 2021 09:34:44 +0000 Subject: [PATCH] fix test again --- .../TestCase/Controller/AppRequestControllerTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/community_server/tests/TestCase/Controller/AppRequestControllerTest.php b/community_server/tests/TestCase/Controller/AppRequestControllerTest.php index f5939d2eb..d79c14c0f 100644 --- a/community_server/tests/TestCase/Controller/AppRequestControllerTest.php +++ b/community_server/tests/TestCase/Controller/AppRequestControllerTest.php @@ -288,9 +288,14 @@ class AppRequestControllerTest extends TestCase } // decay balance variy always if(isset($expected['transactions'])) { + $dynamic_transaction_fields = ['decay_duration', 'balance']; foreach($expected['transactions'] as $i => $transaction) { - if(isset($transaction['type']) && isset($transaction['balance']) && $transaction['type'] == 'decay') { - $expected['transactions'][$i]['balance'] = $json->transactions[$i]['balance']; + if(isset($transaction['type']) && $transaction['type'] == 'decay') { + foreach($dynamic_transaction_fields as $field) { + if(isset($transaction[$field])) { + $expected['transactions'][$i][$field] = $json->transactions[$i][$field]; + } + } } } }