fix broken tests

This commit is contained in:
Dario Rekowski on RockPI 2021-06-01 10:28:53 +00:00
parent f1855832bc
commit 115e8108ca
3 changed files with 10 additions and 13 deletions

View File

@ -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');

View File

@ -1,12 +1,10 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TransactionCreationsFixture
*/
class TransactionCreationsFixture extends TestFixture
class TransactionCreationsFixture extends BaseTestFixture
{
/**
* Fields
@ -37,16 +35,11 @@ class TransactionCreationsFixture extends TestFixture
*/
public function init()
{
$this->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();
}
}

View File

@ -30,6 +30,10 @@ class TransactionCreationTest extends TestCase
parent::setUp();
}
public function testDummy()
{
$this->assertEquals(true, true);
}