From 115e8108ca36046e1f39b0446e069d4f9d965449 Mon Sep 17 00:00:00 2001 From: Dario Rekowski on RockPI Date: Tue, 1 Jun 2021 10:28:53 +0000 Subject: [PATCH] fix broken tests --- community_server/config/routes.php | 2 +- .../Fixture/TransactionCreationsFixture.php | 17 +++++------------ .../Transactions/TransactionCreationTest.php | 4 ++++ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/community_server/config/routes.php b/community_server/config/routes.php index 3b0dfedc1..791692e96 100644 --- a/community_server/config/routes.php +++ b/community_server/config/routes.php @@ -66,7 +66,7 @@ Router::scope('/', function (RouteBuilder $routes) { return true; } $allowedIpLocalhost = ['127.0.0.1', 'localhost', '', '::1']; - if(in_array($clientIp, $allowedIpLocalhost)) { + if(in_array($request->clientIp(), $allowedIpLocalhost)) { return true; } $allowedCaller = Configure::read('API.allowedCaller'); diff --git a/community_server/tests/Fixture/TransactionCreationsFixture.php b/community_server/tests/Fixture/TransactionCreationsFixture.php index ddd266096..15a30cd43 100644 --- a/community_server/tests/Fixture/TransactionCreationsFixture.php +++ b/community_server/tests/Fixture/TransactionCreationsFixture.php @@ -1,12 +1,10 @@ records = [ - [ - 'id' => 1, - 'transaction_id' => 1, - 'state_user_id' => 1, - 'amount' => 1, - 'ident_hash' => 'Lorem ipsum dolor sit amet', - 'target_date' => 1622472043, - ], + $sql = [ + [2, 1, 4, 10000000, '0000000000000000000000000000000000000000000000000000000000000000', '2021-01-01 00:00:00'], + [3, 2, 1, 10000000, '0000000000000000000000000000000000000000000000000000000000000000', '2021-01-01 00:00:00'] ]; + $this->records = $this->sqlEntrysToRecords($sql, $this->fields); parent::init(); } } diff --git a/community_server/tests/TestCase/Model/Transactions/TransactionCreationTest.php b/community_server/tests/TestCase/Model/Transactions/TransactionCreationTest.php index 2e62dca0c..e53549a42 100644 --- a/community_server/tests/TestCase/Model/Transactions/TransactionCreationTest.php +++ b/community_server/tests/TestCase/Model/Transactions/TransactionCreationTest.php @@ -30,6 +30,10 @@ class TransactionCreationTest extends TestCase parent::setUp(); } + public function testDummy() + { + $this->assertEquals(true, true); + }