From 1952844c805655fa90fe4bc02ac38600041ff869 Mon Sep 17 00:00:00 2001 From: einhorn_b Date: Thu, 23 Sep 2021 16:44:23 +0200 Subject: [PATCH] reset php changes --- .../src/Controller/AppController.php | 16 +++++++-------- .../JsonRequestHandlerController.php | 6 +++--- .../Controller/StateUserRolesController.php | 4 ++-- .../src/Controller/StateUsersController.php | 18 ++++++++--------- .../TransactionCreationsController.php | 20 +++++++++---------- .../src/Model/Entity/StateUser.php | 14 +++++++------ .../src/Model/Table/AdminErrorsTable.php | 4 ++-- .../src/Model/Table/StateUsersTable.php | 16 +++++++++++---- .../Model/Transactions/TransactionBase.php | 6 +++--- .../Transactions/TransactionCreation.php | 4 ++-- .../Transactions/TransactionTransfer.php | 4 ++-- ...{UserFixture.php => StateUsersFixture.php} | 20 +++++++++---------- .../Controller/AdminErrorsControllerTest.php | 2 +- .../JsonRequestHandlerControllerTest.php | 2 +- .../Controller/ProfilesControllerTest.php | 2 +- .../StateBalancesControllerTest.php | 2 +- .../Controller/StateErrorsControllerTest.php | 2 +- .../StateUserTransactionsControllerTest.php | 2 +- .../TransactionCreationsControllerTest.php | 2 +- .../Model/Table/AdminErrorsTableTest.php | 2 +- .../Model/Table/StateBalancesTableTest.php | 2 +- .../Model/Table/StateErrorsTableTest.php | 2 +- .../Table/StateUserTransactionsTableTest.php | 2 +- .../Model/Table/StateUsersTableTest.php | 6 +++--- 24 files changed, 85 insertions(+), 75 deletions(-) rename community_server/tests/Fixture/{UserFixture.php => StateUsersFixture.php} (55%) diff --git a/community_server/src/Controller/AppController.php b/community_server/src/Controller/AppController.php index 2c4b2b5e5..e70b8e7bd 100644 --- a/community_server/src/Controller/AppController.php +++ b/community_server/src/Controller/AppController.php @@ -223,22 +223,22 @@ class AppController extends Controller $public_key_bin = hex2bin($json['user']['public_hex']); $stateUserQuery = $stateUserTable ->find('all') - ->where(['pubkey' => $public_key_bin]) + ->where(['public_key' => $public_key_bin]) ->contain('StateBalances', function ($q) { return $q->order(['record_date' => 'DESC']) ->limit(1); }); if ($stateUserQuery->count() == 1) { $stateUser = $stateUserQuery->first(); - if ($stateUser->firstName != $json['user']['first_name'] || - $stateUser->lastName != $json['user']['last_name'] || + if ($stateUser->first_name != $json['user']['first_name'] || + $stateUser->last_name != $json['user']['last_name'] || $stateUser->disabled != $json['user']['disabled'] || //$stateUser->username != $json['user']['username'] || // -> throws error $stateUser->email != $json['user']['email'] ) { - $stateUser->firstName = $json['user']['first_name']; - $stateUser->lastName = $json['user']['last_name']; + $stateUser->first_name = $json['user']['first_name']; + $stateUser->last_name = $json['user']['last_name']; $stateUser->disabled = intval($json['user']['disabled']); //$stateUser->username = $json['user']['username']; $stateUser->email = $json['user']['email']; @@ -250,9 +250,9 @@ class AppController extends Controller //echo $stateUser['id']; } else { $newStateUser = $stateUserTable->newEntity(); - $newStateUser->pubkey = $public_key_bin; - $newStateUser->firstName = $json['user']['first_name']; - $newStateUser->lastName = $json['user']['last_name']; + $newStateUser->public_key = $public_key_bin; + $newStateUser->first_name = $json['user']['first_name']; + $newStateUser->last_name = $json['user']['last_name']; $newStateUser->disabled = intval($json['user']['disabled']); //$newStateUser->username = $json['user']['username']; $newStateUser->email = $json['user']['email']; diff --git a/community_server/src/Controller/JsonRequestHandlerController.php b/community_server/src/Controller/JsonRequestHandlerController.php index 150cce4ae..611984118 100644 --- a/community_server/src/Controller/JsonRequestHandlerController.php +++ b/community_server/src/Controller/JsonRequestHandlerController.php @@ -308,7 +308,7 @@ class JsonRequestHandlerController extends AppController { $stateError = $stateErrorTable->newEntity(); // $pubkey = hex2bin($jsonData->public_key); - $user_query = $stateUsersTable->find('all')->select(['id'])->where(['pubkey' => $pubkey]); + $user_query = $stateUsersTable->find('all')->select(['id'])->where(['public_key' => $pubkey]); if($user_query->count() != 1) { return $this->returnJson(['state' => 'error', 'msg' => 'user not found', 'details' => 'user pubkey hex:' . $jsonData->public_key]); } @@ -412,7 +412,7 @@ class JsonRequestHandlerController extends AppController { //$pubkeys->sender //$pubkeys->receiver $stateUserTable = TableRegistry::getTableLocator()->get('StateUsers'); - $user = $stateUserTable->find('all')->where(['pubkey' => hex2bin($pubkeys->sender)])->contain(['StateBalances']); + $user = $stateUserTable->find('all')->where(['public_key' => hex2bin($pubkeys->sender)])->contain(['StateBalances']); if(!$user->count()) { return $this->returnJson(['state' => 'not found', 'msg' => 'user not found or empty balance']); } @@ -461,7 +461,7 @@ class JsonRequestHandlerController extends AppController { private function userDelete($userPubkeyHex) { $stateUserTable = TableRegistry::getTableLocator()->get('StateUsers'); - $user = $stateUserTable->find('all')->where(['pubkey' => hex2bin($userPubkeyHex)]); + $user = $stateUserTable->find('all')->where(['public_key' => hex2bin($userPubkeyHex)]); if(!$user || $user->count == 0) { return $this->returnJson(['state' => 'error', 'msg' => 'user not found']); } diff --git a/community_server/src/Controller/StateUserRolesController.php b/community_server/src/Controller/StateUserRolesController.php index 80b168f35..9238c7ad6 100644 --- a/community_server/src/Controller/StateUserRolesController.php +++ b/community_server/src/Controller/StateUserRolesController.php @@ -132,7 +132,7 @@ class StateUserRolesController extends AppController $public_hex = hex2bin($requestData['public_hex']); - $stateUser = $this->StateUsers->find('all')->where(['pubkey' => $public_hex])->first(); + $stateUser = $this->StateUsers->find('all')->where(['public_key' => $public_hex])->first(); foreach($requestData['role_id'] as $role_id) { @@ -158,7 +158,7 @@ class StateUserRolesController extends AppController $publichex = hex2bin($public_hex); - $stateUser = $this->StateUsers->find('all')->where(['pubkey' => $publichex])->first(); + $stateUser = $this->StateUsers->find('all')->where(['public_key' => $publichex])->first(); $stateUserRoles = $this->StateUserRoles->find('all')->where(['state_user_id' => $stateUser->id])->all(); diff --git a/community_server/src/Controller/StateUsersController.php b/community_server/src/Controller/StateUsersController.php index 25171f462..fc6ec8614 100644 --- a/community_server/src/Controller/StateUsersController.php +++ b/community_server/src/Controller/StateUsersController.php @@ -182,15 +182,15 @@ class StateUsersController extends AppController if($account_state == 'email not activated') { if(count($pubkeySorted) > 0) { - $communityUsers->where(['hex(pubkey) IN' => array_keys($pubkeySorted)]); + $communityUsers->where(['hex(public_key) IN' => array_keys($pubkeySorted)]); } else { $communityUsers = null; } } else { $globalSearch = '%' . $searchString . '%'; $communityUsers->where(['OR' => [ - 'firstName LIKE' => $globalSearch, - 'lastName LIKE' => $globalSearch, + 'first_name LIKE' => $globalSearch, + 'last_name LIKE' => $globalSearch, 'email LIKE' => $globalSearch ]]); } @@ -199,7 +199,7 @@ class StateUsersController extends AppController //var_dump($communityUsers->toArray()); if($communityUsers) { foreach($communityUsers as $u) { - $pubkey_hex = bin2hex(stream_get_contents($u->pubkey)); + $pubkey_hex = bin2hex(stream_get_contents($u->public_key)); $u->public_hex = $pubkey_hex; if(!isset($pubkeySorted[$pubkey_hex])) { $pubkeySorted[$pubkey_hex] = ['login' => [], 'community' => []]; @@ -229,9 +229,9 @@ class StateUsersController extends AppController $color = 'danger'; if(count($user['community']) == 1) { $c_user = $user['community'][0]; - $finalUser['name'] = $c_user->firstName . ' ' . $c_user->lastName; - $finalUser['first_name'] = $c_user->firstName; - $finalUser['last_name'] = $c_user->lastName; + $finalUser['name'] = $c_user->first_name . ' ' . $c_user->last_name; + $finalUser['first_name'] = $c_user->first_name; + $finalUser['last_name'] = $c_user->last_name; $finalUser['email'] = $c_user->email; } } else if(count($user['login']) == 1) { @@ -415,7 +415,7 @@ class StateUsersController extends AppController //$user = $jsonData['user']; //var_dump($jsonData); $pubkey = hex2bin($jsonData['pubkeyhex']); - $stateUsers = $this->StateUsers->find('all')->where(['pubkey' => $pubkey]); + $stateUsers = $this->StateUsers->find('all')->where(['public_key' => $pubkey]); if($stateUsers->count() != 1) { return $this->returnJson(['state' => 'error', 'msg' => 'invalid result count']); } @@ -448,7 +448,7 @@ class StateUsersController extends AppController $pubkey = hex2bin($jsonData['pubkeyhex']); $stateUsers = $this->StateUsers ->find('all') - ->where(['pubkey' => $pubkey]) + ->where(['public_key' => $pubkey]) ->select(['id']); if($stateUsers->count() != 1) { return $this->returnJson(['state' => 'error', 'msg' => 'invalid result count']); diff --git a/community_server/src/Controller/TransactionCreationsController.php b/community_server/src/Controller/TransactionCreationsController.php index f024e5cb4..d02320d25 100644 --- a/community_server/src/Controller/TransactionCreationsController.php +++ b/community_server/src/Controller/TransactionCreationsController.php @@ -101,7 +101,7 @@ class TransactionCreationsController extends AppController $receiverProposal = []; foreach ($stateUsers as $stateUser) { $name = $stateUser->email; - $keyHex = bin2hex(stream_get_contents($stateUser->pubkey)); + $keyHex = bin2hex(stream_get_contents($stateUser->public_key)); if ($name === null) { $name = $stateUser->first_name . ' ' . $stateUser->last_name; } @@ -241,14 +241,14 @@ class TransactionCreationsController extends AppController $this->log("search for text: ".$requestData['searchText'], 'debug'); $stateUsers = $stateUserTable ->find('all') - ->select(['id', 'firstName', 'lastName', 'email']) - ->order(['firstName', 'lastName']) + ->select(['id', 'first_name', 'last_name', 'email']) + ->order(['first_name', 'last_name']) ->where( ['AND' => [ 'disabled' => 0, 'OR' => [ - 'LOWER(firstName) LIKE' => '%'.strtolower($requestData['searchText']).'%', - 'LOWER(lastName) LIKE' => '%'.strtolower($requestData['searchText']).'%', + 'LOWER(first_name) LIKE' => '%'.strtolower($requestData['searchText']).'%', + 'LOWER(last_name) LIKE' => '%'.strtolower($requestData['searchText']).'%', 'LOWER(email) LIKE' => '%'.strtolower($requestData['searchText']).'%' ] ] @@ -265,10 +265,10 @@ class TransactionCreationsController extends AppController } else { $stateUsers = $stateUserTable ->find('all') - ->select(['id', 'firstName', 'lastName', 'email']) + ->select(['id', 'first_name', 'last_name', 'email']) //->order(['id']) ->where(['disabled' => 0]) - ->order(['firstName', 'lastName']) + ->order(['first_name', 'last_name']) ->contain(['TransactionCreations' => [ 'fields' => [ 'TransactionCreations.amount', @@ -300,7 +300,7 @@ class TransactionCreationsController extends AppController //if($sumAmount < 20000000) { array_push($possibleReceivers, [ - 'name' => $stateUser->firstName . ' ' . $stateUser->lastName, + 'name' => $stateUser->first_name . ' ' . $stateUser->last_name, 'id' => $stateUser->id, 'email' => $stateUser->email, 'amount' => $sumAmount, @@ -353,7 +353,7 @@ class TransactionCreationsController extends AppController } $receiverUsers = $stateUserTable->find('all') ->where(['id IN' => array_keys($users)]) - ->select(['pubkey', 'email', 'id']) + ->select(['public_key', 'email', 'id']) ->contain(false); foreach ($receiverUsers as $receiverUser) { @@ -371,7 +371,7 @@ class TransactionCreationsController extends AppController } else { $pendings[$id] = $localAmountCent; } - $pubKeyHex = bin2hex(stream_get_contents($receiverUser->pubkey)); + $pubKeyHex = bin2hex(stream_get_contents($receiverUser->public_key)); $requestAnswear = $this->JsonRequestClient->sendRequest(json_encode([ 'session_id' => $session->read('session_id'), 'email' => $receiverUser->email, diff --git a/community_server/src/Model/Entity/StateUser.php b/community_server/src/Model/Entity/StateUser.php index 374e8d608..5fac7cda7 100644 --- a/community_server/src/Model/Entity/StateUser.php +++ b/community_server/src/Model/Entity/StateUser.php @@ -30,14 +30,16 @@ class StateUser extends Entity * @var array */ protected $_accessible = [ - 'groupId' => true, - 'pubkey' => true, + 'index_id' => true, + 'state_group_id' => true, + 'public_key' => true, 'email' => true, - 'firstName' => true, - 'lastName' => true, + 'first_name' => true, + 'last_name' => true, 'disabled' => true, 'username' => true, 'index' => true, + 'state_group' => true, 'state_balances' => true, 'state_created' => true, 'transaction_creations' => true, @@ -46,11 +48,11 @@ class StateUser extends Entity public function getEmailWithName() { - return $this->firstName . ' ' . $this->lastName . ' <' . $this->email . '>'; + return $this->first_name . ' ' . $this->last_name . ' <' . $this->email . '>'; } public function getNames() { - return $this->firstName . ' ' . $this->lastName; + return $this->first_name . ' ' . $this->last_name; } } diff --git a/community_server/src/Model/Table/AdminErrorsTable.php b/community_server/src/Model/Table/AdminErrorsTable.php index 7074921b5..e6263d8ff 100644 --- a/community_server/src/Model/Table/AdminErrorsTable.php +++ b/community_server/src/Model/Table/AdminErrorsTable.php @@ -40,7 +40,7 @@ class AdminErrorsTable extends Table $this->addBehavior('Timestamp'); - $this->belongsTo('User', [ + $this->belongsTo('StateUsers', [ 'foreignKey' => 'state_user_id', 'joinType' => 'INNER' ]); @@ -100,7 +100,7 @@ class AdminErrorsTable extends Table */ public function buildRules(RulesChecker $rules) { - $rules->add($rules->existsIn(['state_user_id'], 'User')); + $rules->add($rules->existsIn(['state_user_id'], 'StateUsers')); return $rules; } diff --git a/community_server/src/Model/Table/StateUsersTable.php b/community_server/src/Model/Table/StateUsersTable.php index 729b7800a..5b01609f3 100644 --- a/community_server/src/Model/Table/StateUsersTable.php +++ b/community_server/src/Model/Table/StateUsersTable.php @@ -37,10 +37,18 @@ class StateUsersTable extends Table { parent::initialize($config); - $this->setTable('user'); + $this->setTable('state_users'); $this->setDisplayField('email'); $this->setPrimaryKey('id'); + /*$this->belongsTo('Indices', [ + 'foreignKey' => 'index_id', + 'joinType' => 'INNER' + ]);*/ + $this->belongsTo('StateGroups', [ + 'foreignKey' => 'state_group_id', + 'joinType' => 'INNER' + ]); $this->hasMany('StateBalances', [ 'foreignKey' => 'state_user_id' ]); @@ -72,8 +80,8 @@ class StateUsersTable extends Table ->allowEmptyString('id', null, 'create'); $validator - ->requirePresence('pubkey', 'create') - ->notEmptyString('pubkey'); + ->requirePresence('public_key', 'create') + ->notEmptyString('public_key'); return $validator; } @@ -116,7 +124,7 @@ class StateUsersTable extends Table $involvedUser = $this->find('all', [ 'contain' => [], 'where' => ['id IN' => $involvedUserIds], - 'fields' => ['id', 'firstName', 'lastName', 'email'], + 'fields' => ['id', 'first_name', 'last_name', 'email'], ]); //var_dump($involvedUser->toArray()); $involvedUserIndices = []; diff --git a/community_server/src/Model/Transactions/TransactionBase.php b/community_server/src/Model/Transactions/TransactionBase.php index 8c2709a96..6b3817201 100644 --- a/community_server/src/Model/Transactions/TransactionBase.php +++ b/community_server/src/Model/Transactions/TransactionBase.php @@ -49,13 +49,13 @@ class TransactionBase { protected function getStateUserId($publicKey) { $stateUsersTable = self::getTable('state_users'); - $stateUser = $stateUsersTable->find('all')->select(['id'])->where(['pubkey' => $publicKey])->first(); + $stateUser = $stateUsersTable->find('all')->select(['id'])->where(['public_key' => $publicKey])->first(); if($stateUser) { return $stateUser->id; } // create new entry $stateUserEntity = $stateUsersTable->newEntity(); - $stateUserEntity->pubkey = $publicKey; + $stateUserEntity->public_key = $publicKey; if($stateUsersTable->save($stateUserEntity)) { return $stateUserEntity->id; } else { @@ -77,7 +77,7 @@ class TransactionBase { protected function getStateUserFromPublickey($publicKey) { $stateUsersTable = self::getTable('state_users'); - $stateUser = $stateUsersTable->find('all')->where(['pubkey' => $publicKey])->first(); + $stateUser = $stateUsersTable->find('all')->where(['public_key' => $publicKey])->first(); if($stateUser) { return $stateUser; } diff --git a/community_server/src/Model/Transactions/TransactionCreation.php b/community_server/src/Model/Transactions/TransactionCreation.php index a8263c60d..87f2d2104 100644 --- a/community_server/src/Model/Transactions/TransactionCreation.php +++ b/community_server/src/Model/Transactions/TransactionCreation.php @@ -95,7 +95,7 @@ class TransactionCreation extends TransactionBase { $existingCreations2 = $this->transactionCreationsTable ->find('all') ->select(['amount', 'state_user_id', 'target_date']) - ->contain(['StateUsers' => ['fields' => ['StateUsers.pubkey']]]); + ->contain(['StateUsers' => ['fields' => ['StateUsers.public_key']]]); $q = $existingCreations2; $targetDate = $this->protoTransactionCreation->getTargetDate(); @@ -230,7 +230,7 @@ class TransactionCreation extends TransactionBase { $receiverAmount = new \Proto\Gradido\TransferAmount(); - $receiverAmount->setPubkey(stream_get_contents($stateUser->pubkey)); + $receiverAmount->setPubkey(stream_get_contents($stateUser->public_key)); $receiverAmount->setAmount($transactionCreationEntity->amount); $protoCreation->setReceiver($receiverAmount); diff --git a/community_server/src/Model/Transactions/TransactionTransfer.php b/community_server/src/Model/Transactions/TransactionTransfer.php index 2bd470e73..dc1606f55 100644 --- a/community_server/src/Model/Transactions/TransactionTransfer.php +++ b/community_server/src/Model/Transactions/TransactionTransfer.php @@ -96,7 +96,7 @@ class TransactionTransfer extends TransactionBase { $user = $stateUsersTable ->find('all') ->select(['id']) - ->where(['pubkey' => $senderPublic]) + ->where(['public_key' => $senderPublic]) ->contain(['StateBalances' => ['fields' => ['amount', 'state_user_id']]])->first(); if(!$user) { $this->addError($functionName, 'couldn\'t find sender in db' ); @@ -114,7 +114,7 @@ class TransactionTransfer extends TransactionBase { return false; } // check if receiver exist - $receiver_user = $stateUsersTable->find('all')->select(['id'])->where(['pubkey' => $receiver_public_key])->first(); + $receiver_user = $stateUsersTable->find('all')->select(['id'])->where(['public_key' => $receiver_public_key])->first(); if(!$receiver_user) { $this->addError($functionName, 'couldn\'t find receiver in db' ); return false; diff --git a/community_server/tests/Fixture/UserFixture.php b/community_server/tests/Fixture/StateUsersFixture.php similarity index 55% rename from community_server/tests/Fixture/UserFixture.php rename to community_server/tests/Fixture/StateUsersFixture.php index 2e01cd9e3..a9b033bf7 100644 --- a/community_server/tests/Fixture/UserFixture.php +++ b/community_server/tests/Fixture/StateUsersFixture.php @@ -6,9 +6,8 @@ use Cake\TestSuite\Fixture\TestFixture; /** * StateUsersFixture */ -class UserFixture extends BaseTestFixture +class StateUsersFixture extends BaseTestFixture { - public $import = [ 'model' => 'StateUsers', 'connection' => 'test' ]; /** * Fields * @@ -17,16 +16,17 @@ class UserFixture extends BaseTestFixture // @codingStandardsIgnoreStart public $fields = [ 'id' => ['type' => 'integer', 'length' => 10, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], - 'groupId' => ['type' => 'integer', 'length' => 10, 'unsigned' => true, 'null' => false, 'default' => '0', 'comment' => '', 'precision' => null, 'autoIncrement' => null], - 'pubkey' => ['type' => 'binary', 'length' => 32, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'index_id' => ['type' => 'smallinteger', 'length' => 6, 'unsigned' => false, 'null' => false, 'default' => '0', 'comment' => '', 'precision' => null], + 'group_id' => ['type' => 'integer', 'length' => 10, 'unsigned' => true, 'null' => false, 'default' => '0', 'comment' => '', 'precision' => null, 'autoIncrement' => null], + 'public_key' => ['type' => 'binary', 'length' => 32, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], 'email' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_unicode_ci', 'comment' => '', 'precision' => null, 'fixed' => null], - 'firstNname' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_unicode_ci', 'comment' => '', 'precision' => null, 'fixed' => null], - 'lastName' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_unicode_ci', 'comment' => '', 'precision' => null, 'fixed' => null], + 'first_name' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_unicode_ci', 'comment' => '', 'precision' => null, 'fixed' => null], + 'last_name' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_unicode_ci', 'comment' => '', 'precision' => null, 'fixed' => null], 'username' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_unicode_ci', 'comment' => '', 'precision' => null, 'fixed' => null], 'disabled' => ['type' => 'tinyinteger', 'length' => 4, 'unsigned' => false, 'null' => true, 'default' => '0', 'comment' => '', 'precision' => null], '_constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - 'pubkey' => ['type' => 'unique', 'columns' => ['pubkey'], 'length' => []], + 'public_key' => ['type' => 'unique', 'columns' => ['public_key'], 'length' => []], ], '_options' => [ 'engine' => 'InnoDB', @@ -44,9 +44,9 @@ class UserFixture extends BaseTestFixture public function init() { $sql_entrys = [ - [1, 0, 'f7f4a49a4ac10379f8b9ddcb731c4d9ec495e6edd16075f52672cd25e3179f0f', 'test1.gmail.de', 'Max', 'Mustermann', NULL, 0], - [3, 0, '131c7f68dd94b2be4c913400ff7ff4cdc03ac2bda99c2d29edcacb3b065c67e6', 'test2.gmail.com', 'Ines', 'Mustermann', NULL, 0], - [4, 0, 'e3369de3623ce8446d0424c4013e7a1d71a2671ae3d7bf1e798ebf0665d145f2', 'test3.yahoo.com', 'Samuel', 'Schmied', NULL, 0] + [1, 0, 0, 'f7f4a49a4ac10379f8b9ddcb731c4d9ec495e6edd16075f52672cd25e3179f0f', 'test1.gmail.de', 'Max', 'Mustermann', NULL, 0], + [3, 0, 0, '131c7f68dd94b2be4c913400ff7ff4cdc03ac2bda99c2d29edcacb3b065c67e6', 'test2.gmail.com', 'Ines', 'Mustermann', NULL, 0], + [4, 0, 0, 'e3369de3623ce8446d0424c4013e7a1d71a2671ae3d7bf1e798ebf0665d145f2', 'test3.yahoo.com', 'Samuel', 'Schmied', NULL, 0] ]; $this->records = $this->sqlEntrysToRecords($sql_entrys, $this->fields); parent::init(); diff --git a/community_server/tests/TestCase/Controller/AdminErrorsControllerTest.php b/community_server/tests/TestCase/Controller/AdminErrorsControllerTest.php index 04aee90fa..a9044b4ae 100644 --- a/community_server/tests/TestCase/Controller/AdminErrorsControllerTest.php +++ b/community_server/tests/TestCase/Controller/AdminErrorsControllerTest.php @@ -21,7 +21,7 @@ class AdminErrorsControllerTest extends TestCase */ public $fixtures = [ 'app.AdminErrors', - 'app.User' + 'app.StateUsers' ]; /** diff --git a/community_server/tests/TestCase/Controller/JsonRequestHandlerControllerTest.php b/community_server/tests/TestCase/Controller/JsonRequestHandlerControllerTest.php index 496e7e3c5..f990b3e57 100644 --- a/community_server/tests/TestCase/Controller/JsonRequestHandlerControllerTest.php +++ b/community_server/tests/TestCase/Controller/JsonRequestHandlerControllerTest.php @@ -21,7 +21,7 @@ class JsonRequestHandlerControllerTest extends TestCase public $fixtures = [ 'app.TransactionCreations', 'app.Transactions', - 'app.User', + 'app.StateUsers', 'app.StateUserTransactions', 'app.StateErrors', 'app.TransactionSignatures', diff --git a/community_server/tests/TestCase/Controller/ProfilesControllerTest.php b/community_server/tests/TestCase/Controller/ProfilesControllerTest.php index 77e2576ef..d87558e55 100644 --- a/community_server/tests/TestCase/Controller/ProfilesControllerTest.php +++ b/community_server/tests/TestCase/Controller/ProfilesControllerTest.php @@ -20,7 +20,7 @@ class ProfilesControllerTest extends TestCase * @var array */ public $fixtures = [ - 'app.User', + 'app.StateUsers', 'app.CommunityProfiles', ]; diff --git a/community_server/tests/TestCase/Controller/StateBalancesControllerTest.php b/community_server/tests/TestCase/Controller/StateBalancesControllerTest.php index f533f344e..9ef8d28e9 100644 --- a/community_server/tests/TestCase/Controller/StateBalancesControllerTest.php +++ b/community_server/tests/TestCase/Controller/StateBalancesControllerTest.php @@ -24,7 +24,7 @@ class StateBalancesControllerTest extends TestCase public $fixtures = [ 'app.TransactionCreations', 'app.Transactions', - 'app.User', + 'app.StateUsers', 'app.StateUserTransactions', 'app.StateErrors', 'app.TransactionSignatures', diff --git a/community_server/tests/TestCase/Controller/StateErrorsControllerTest.php b/community_server/tests/TestCase/Controller/StateErrorsControllerTest.php index df45ff59d..452af54fc 100644 --- a/community_server/tests/TestCase/Controller/StateErrorsControllerTest.php +++ b/community_server/tests/TestCase/Controller/StateErrorsControllerTest.php @@ -21,7 +21,7 @@ class StateErrorsControllerTest extends TestCase */ public $fixtures = [ 'app.StateErrors', - 'app.User', + 'app.StateUsers', 'app.TransactionTypes' ]; diff --git a/community_server/tests/TestCase/Controller/StateUserTransactionsControllerTest.php b/community_server/tests/TestCase/Controller/StateUserTransactionsControllerTest.php index 39be9ec66..0c9e0a513 100644 --- a/community_server/tests/TestCase/Controller/StateUserTransactionsControllerTest.php +++ b/community_server/tests/TestCase/Controller/StateUserTransactionsControllerTest.php @@ -21,7 +21,7 @@ class StateUserTransactionsControllerTest extends TestCase */ public $fixtures = [ 'app.StateUserTransactions', - 'app.User', + 'app.StateUsers', 'app.Transactions', 'app.TransactionTypes', ]; diff --git a/community_server/tests/TestCase/Controller/TransactionCreationsControllerTest.php b/community_server/tests/TestCase/Controller/TransactionCreationsControllerTest.php index 7a34c52a5..74c0e4b1e 100644 --- a/community_server/tests/TestCase/Controller/TransactionCreationsControllerTest.php +++ b/community_server/tests/TestCase/Controller/TransactionCreationsControllerTest.php @@ -22,7 +22,7 @@ class TransactionCreationsControllerTest extends TestCase public $fixtures = [ 'app.TransactionCreations', 'app.Transactions', - 'app.User' + 'app.StateUsers' ]; /** diff --git a/community_server/tests/TestCase/Model/Table/AdminErrorsTableTest.php b/community_server/tests/TestCase/Model/Table/AdminErrorsTableTest.php index a258d9e25..09d7a35fb 100644 --- a/community_server/tests/TestCase/Model/Table/AdminErrorsTableTest.php +++ b/community_server/tests/TestCase/Model/Table/AdminErrorsTableTest.php @@ -24,7 +24,7 @@ class AdminErrorsTableTest extends TestCase */ public $fixtures = [ 'app.AdminErrors', - 'app.User' + 'app.StateUsers' ]; /** diff --git a/community_server/tests/TestCase/Model/Table/StateBalancesTableTest.php b/community_server/tests/TestCase/Model/Table/StateBalancesTableTest.php index c14b95c09..68049de34 100644 --- a/community_server/tests/TestCase/Model/Table/StateBalancesTableTest.php +++ b/community_server/tests/TestCase/Model/Table/StateBalancesTableTest.php @@ -24,7 +24,7 @@ class StateBalancesTableTest extends TestCase */ public $fixtures = [ 'app.StateBalances', - 'app.User', + 'app.StateUsers', ]; /** diff --git a/community_server/tests/TestCase/Model/Table/StateErrorsTableTest.php b/community_server/tests/TestCase/Model/Table/StateErrorsTableTest.php index d8633a56a..21cbe6128 100644 --- a/community_server/tests/TestCase/Model/Table/StateErrorsTableTest.php +++ b/community_server/tests/TestCase/Model/Table/StateErrorsTableTest.php @@ -24,7 +24,7 @@ class StateErrorsTableTest extends TestCase */ public $fixtures = [ 'app.StateErrors', - 'app.User', + 'app.StateUsers', 'app.TransactionTypes' ]; diff --git a/community_server/tests/TestCase/Model/Table/StateUserTransactionsTableTest.php b/community_server/tests/TestCase/Model/Table/StateUserTransactionsTableTest.php index dccb91b4e..173ad8e12 100644 --- a/community_server/tests/TestCase/Model/Table/StateUserTransactionsTableTest.php +++ b/community_server/tests/TestCase/Model/Table/StateUserTransactionsTableTest.php @@ -24,7 +24,7 @@ class StateUserTransactionsTableTest extends TestCase */ public $fixtures = [ 'app.StateUserTransactions', - 'app.User', + 'app.StateUsers', 'app.Transactions', 'app.TransactionTypes', ]; diff --git a/community_server/tests/TestCase/Model/Table/StateUsersTableTest.php b/community_server/tests/TestCase/Model/Table/StateUsersTableTest.php index 803def3a7..49deb1166 100644 --- a/community_server/tests/TestCase/Model/Table/StateUsersTableTest.php +++ b/community_server/tests/TestCase/Model/Table/StateUsersTableTest.php @@ -23,7 +23,7 @@ class StateUsersTableTest extends TestCase * @var array */ public $fixtures = [ - 'app.User', + 'app.StateUsers', 'app.StateGroups', 'app.StateBalances', 'app.StateCreated', @@ -39,8 +39,8 @@ class StateUsersTableTest extends TestCase public function setUp() { parent::setUp(); - $config = TableRegistry::getTableLocator()->exists('User') ? [] : ['className' => StateUsersTable::class]; - $this->StateUsersTable = TableRegistry::getTableLocator()->get('User', $config); + $config = TableRegistry::getTableLocator()->exists('StateUsers') ? [] : ['className' => StateUsersTable::class]; + $this->StateUsersTable = TableRegistry::getTableLocator()->get('StateUsers', $config); } /**