first tests

This commit is contained in:
Dario Rekowski on RockPI 2019-11-05 18:36:49 +00:00
commit 16bd126133
30 changed files with 729 additions and 58 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "mithril_client"]
path = mithril_client
url = ssh://git@***REMOVED***/~/_mithril/gradido_mithrilJS_client
[submodule "src/protobuf"]
path = src/protobuf
url = ssh://git@***REMOVED***/~/_protobuf/gradido_protobuf

View File

@ -18,7 +18,7 @@
"cakephp/cakephp-codesniffer": "^3.0",
"cakephp/debug_kit": "^3.17.0",
"josegonzalez/dotenv": "3.*",
"phpunit/phpunit": "^5|^6",
"phpunit/phpunit": "^5.7|^6.0",
"psy/psysh": "@stable"
},
"suggest": {

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "2944d37824c58c80f9759fff3074fa2d",
"content-hash": "de9b091bfb2ef9e30a63a154a97b5d9f",
"packages": [
{
"name": "aura/intl",

@ -1 +1 @@
Subproject commit 680e56876d6e7f2778bff4eb49c880063716b391
Subproject commit f0b1d113cee2a76e9dbb098b315f4acaf38410d0

View File

@ -13,6 +13,7 @@ use App\Form\CreationForm;
use Model\Messages\Gradido\TransactionCreation;
use Model\Messages\Gradido\TransactionBody;
use Model\Messages\Gradido\ReceiverAmount;
use Model\Messages\Gradido\TimestampSeconds;
/**
* TransactionCreations Controller
*
@ -120,8 +121,13 @@ class TransactionCreationsController extends AppController
if($pubKeyHex != '') {
$receiver->setEd25519ReceiverPubkey(hex2bin($pubKeyHex));
//var_dump($requestData);
$creationDate = new TimestampSeconds();
$creationDate->setSeconds(time());
$transactionBody = new TransactionBody();
$transactionBody->setMemo($requestData['memo']);
$transactionBody->setCreated($creationDate);
$transaction = new TransactionCreation();
$transaction->setReceiverAmount($receiver);

View File

@ -19,6 +19,10 @@ class TransactionBody extends \Google\Protobuf\Internal\Message
* Generated from protobuf field <code>string memo = 1;</code>
*/
private $memo = '';
/**
* Generated from protobuf field <code>.model.messages.gradido.TimestampSeconds created = 2;</code>
*/
private $created = null;
protected $data;
/**
@ -29,6 +33,7 @@ class TransactionBody extends \Google\Protobuf\Internal\Message
*
* @type string $memo
* max 150 chars
* @type \Model\Messages\Gradido\TimestampSeconds $created
* @type \Model\Messages\Gradido\StateCreateGroup $createGroup
* @type \Model\Messages\Gradido\StateGroupChangeParent $groupChangeParent
* @type \Model\Messages\Gradido\Transfer $transfer
@ -67,89 +72,111 @@ class TransactionBody extends \Google\Protobuf\Internal\Message
}
/**
* Generated from protobuf field <code>.model.messages.gradido.StateCreateGroup createGroup = 2;</code>
* Generated from protobuf field <code>.model.messages.gradido.TimestampSeconds created = 2;</code>
* @return \Model\Messages\Gradido\TimestampSeconds
*/
public function getCreated()
{
return $this->created;
}
/**
* Generated from protobuf field <code>.model.messages.gradido.TimestampSeconds created = 2;</code>
* @param \Model\Messages\Gradido\TimestampSeconds $var
* @return $this
*/
public function setCreated($var)
{
GPBUtil::checkMessage($var, \Model\Messages\Gradido\TimestampSeconds::class);
$this->created = $var;
return $this;
}
/**
* Generated from protobuf field <code>.model.messages.gradido.StateCreateGroup createGroup = 6;</code>
* @return \Model\Messages\Gradido\StateCreateGroup
*/
public function getCreateGroup()
{
return $this->readOneof(2);
return $this->readOneof(6);
}
/**
* Generated from protobuf field <code>.model.messages.gradido.StateCreateGroup createGroup = 2;</code>
* Generated from protobuf field <code>.model.messages.gradido.StateCreateGroup createGroup = 6;</code>
* @param \Model\Messages\Gradido\StateCreateGroup $var
* @return $this
*/
public function setCreateGroup($var)
{
GPBUtil::checkMessage($var, \Model\Messages\Gradido\StateCreateGroup::class);
$this->writeOneof(2, $var);
$this->writeOneof(6, $var);
return $this;
}
/**
* Generated from protobuf field <code>.model.messages.gradido.StateGroupChangeParent groupChangeParent = 3;</code>
* Generated from protobuf field <code>.model.messages.gradido.StateGroupChangeParent groupChangeParent = 7;</code>
* @return \Model\Messages\Gradido\StateGroupChangeParent
*/
public function getGroupChangeParent()
{
return $this->readOneof(3);
return $this->readOneof(7);
}
/**
* Generated from protobuf field <code>.model.messages.gradido.StateGroupChangeParent groupChangeParent = 3;</code>
* Generated from protobuf field <code>.model.messages.gradido.StateGroupChangeParent groupChangeParent = 7;</code>
* @param \Model\Messages\Gradido\StateGroupChangeParent $var
* @return $this
*/
public function setGroupChangeParent($var)
{
GPBUtil::checkMessage($var, \Model\Messages\Gradido\StateGroupChangeParent::class);
$this->writeOneof(3, $var);
$this->writeOneof(7, $var);
return $this;
}
/**
* Generated from protobuf field <code>.model.messages.gradido.Transfer transfer = 4;</code>
* Generated from protobuf field <code>.model.messages.gradido.Transfer transfer = 8;</code>
* @return \Model\Messages\Gradido\Transfer
*/
public function getTransfer()
{
return $this->readOneof(4);
return $this->readOneof(8);
}
/**
* Generated from protobuf field <code>.model.messages.gradido.Transfer transfer = 4;</code>
* Generated from protobuf field <code>.model.messages.gradido.Transfer transfer = 8;</code>
* @param \Model\Messages\Gradido\Transfer $var
* @return $this
*/
public function setTransfer($var)
{
GPBUtil::checkMessage($var, \Model\Messages\Gradido\Transfer::class);
$this->writeOneof(4, $var);
$this->writeOneof(8, $var);
return $this;
}
/**
* Generated from protobuf field <code>.model.messages.gradido.TransactionCreation creation = 5;</code>
* Generated from protobuf field <code>.model.messages.gradido.TransactionCreation creation = 9;</code>
* @return \Model\Messages\Gradido\TransactionCreation
*/
public function getCreation()
{
return $this->readOneof(5);
return $this->readOneof(9);
}
/**
* Generated from protobuf field <code>.model.messages.gradido.TransactionCreation creation = 5;</code>
* Generated from protobuf field <code>.model.messages.gradido.TransactionCreation creation = 9;</code>
* @param \Model\Messages\Gradido\TransactionCreation $var
* @return $this
*/
public function setCreation($var)
{
GPBUtil::checkMessage($var, \Model\Messages\Gradido\TransactionCreation::class);
$this->writeOneof(5, $var);
$this->writeOneof(9, $var);
return $this;
}

View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
<?php
/*
@ -121,4 +122,71 @@ class Transaction extends TransactionBase {
=======
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace Model\Transactions;
//use Model\Messages\Gradido\Transaction;
//use Model\Messages\Gradido\TransactionBody;
class Transaction extends TransactionBase {
private $mProtoTransaction = null;
private $mProtoTransactionBody = null;
private $errors = [];
public function __construct($base64Data) {
$transactionBin = base64_decode($base64Data);
if($transactionBin == FALSE) {
//$this->addError('base64 decode failed');
$this->addError(['data' => $base64Data, 'bin' => $transactionBin, 'msg' => 'base64 decode error']);
} else {
$this->mProtoTransaction = new \Model\Messages\Gradido\Transaction();
$this->mProtoTransaction->mergeFromString($transactionBin);
$this->mProtoTransactionBody = new \Model\Messages\Gradido\TransactionBody();
$this->mProtoTransactionBody->mergeFromString($this->mProtoTransaction->getBodyBytes());
$data = $this->mProtoTransactionBody->getData();
var_dump($data);
}
}
public function validate() {
$sigPairs = $this->mProtoTransaction->getSigMap()->getSigPair();
$bodyBytes = $this->mProtoTransaction->getBodyBytes();
// check signature(s)
foreach($sigPairs as $sigPair) {
$pubkey = $sigPair->getPubKey();
$signature = $sigPair->getEd25519();
if (!\Sodium\crypto_sign_verify_detached($signature, $bodyBytes, $pubkey)) {
$this->addError('signature for key ' . bin2hex($pubkey) . ' isn\'t valid ' );
return false;
}
}
return true;
}
public function getErrors() {
return $this->errors;
}
public function hasErrors() {
return count($this->errors) > 0;
}
private function addError($message) {
array_push($this->errors, $message);
}
>>>>>>> bcb8f1761e3eb94f89e9d2c4e70ab096e528e6c6
}

View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
<?php
namespace Model\Transactions;
@ -40,4 +41,12 @@ class TransactionBase {
return NULL;
}
=======
<?php
namespace Model\Transactions;
class TransactionBase {
>>>>>>> bcb8f1761e3eb94f89e9d2c4e70ab096e528e6c6
}

View File

@ -19,6 +19,11 @@ class TransactionBody extends TransactionBase {
}
public function validate($sigPairs) {
// check if creation time is in the past
if($this->mProtoTransactionBody->getCreated() > time()) {
$this->addError('TransactionBody::validate', 'Transaction were created in the past!');
return false;
}
if(!$this->mSpecificTransaction->validate($sigPairs)) {
$this->addErrors($this->mSpecificTransaction->getErrors());
return false;

1
src/protobuf Submodule

@ -0,0 +1 @@
Subproject commit 77e878253ac2a044eb59700386c961c812667eae

View File

@ -0,0 +1,48 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* StateBalancesFixture
*/
class StateBalancesFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'user_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'modified' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'amount' => ['type' => 'biginteger', 'length' => 20, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'user_id' => 1,
'modified' => '2019-11-05 18:02:28',
'amount' => 1
],
];
parent::init();
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* StateUsersFixture
*/
class StateUsersFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'index_id' => ['type' => 'smallinteger', 'length' => 6, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'group_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, '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' => 'utf8_bin', 'comment' => '', 'precision' => null, 'fixed' => null],
'first_name' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8_bin', 'comment' => '', 'precision' => null, 'fixed' => null],
'last_name' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'utf8_bin', 'comment' => '', 'precision' => null, 'fixed' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
'public_key' => ['type' => 'unique', 'columns' => ['public_key'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'index_id' => 1,
'group_id' => 1,
'public_key' => 'Lorem ipsum dolor sit amet',
'email' => 'Lorem ipsum dolor sit amet',
'first_name' => 'Lorem ipsum dolor sit amet',
'last_name' => 'Lorem ipsum dolor sit amet'
],
];
parent::init();
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TransactionCreationsFixture
*/
class TransactionCreationsFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'transaction_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'state_user_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'amount' => ['type' => 'biginteger', 'length' => 20, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'ident_hash' => ['type' => 'binary', 'length' => 32, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'transaction_id' => 1,
'state_user_id' => 1,
'amount' => 1,
'ident_hash' => 'Lorem ipsum dolor sit amet'
],
];
parent::init();
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TransactionSendCoinsFixture
*/
class TransactionSendCoinsFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'transaction_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'state_user_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'receiver_public_key' => ['type' => 'binary', 'length' => 32, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'receiver_user_id' => ['type' => 'binary', 'length' => 64, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'amount' => ['type' => 'biginteger', 'length' => 20, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'sender_final_balance' => ['type' => 'biginteger', 'length' => 20, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'transaction_id' => 1,
'state_user_id' => 1,
'receiver_public_key' => 'Lorem ipsum dolor sit amet',
'receiver_user_id' => 'Lorem ipsum dolor sit amet',
'amount' => 1,
'sender_final_balance' => 1
],
];
parent::init();
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TransactionSignaturesFixture
*/
class TransactionSignaturesFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'transaction_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'signature' => ['type' => 'binary', 'length' => 64, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'pubkey' => ['type' => 'binary', 'length' => 32, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'transaction_id' => 1,
'signature' => 'Lorem ipsum dolor sit amet',
'pubkey' => 'Lorem ipsum dolor sit amet'
],
];
parent::init();
}
}

View File

@ -0,0 +1,51 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TransactionTypesFixture
*/
class TransactionTypesFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'name' => ['type' => 'string', 'length' => 24, 'null' => false, 'default' => null, 'collate' => 'utf8_bin', 'comment' => '', 'precision' => null, 'fixed' => null],
'text' => ['type' => 'string', 'length' => 255, 'null' => false, 'default' => null, 'collate' => 'utf8_bin', 'comment' => '', 'precision' => null, 'fixed' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'name' => 'creation',
'text' => 'Aktives oder Bedingsungsloses Grundeinkommen'
],
[
'id' => 2,
'name' => 'transfer',
'text' => 'Einfache Überweisung'
]
];
parent::init();
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TransactionsFixture
*/
class TransactionsFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'biginteger', 'length' => 20, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'group_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'transaction_type_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'tx_hash' => ['type' => 'binary', 'length' => 32, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
'memo' => ['type' => 'string', 'length' => 255, 'null' => false, 'default' => null, 'collate' => 'utf8_bin', 'comment' => '', 'precision' => null, 'fixed' => null],
'received' => ['type' => 'timestamp', 'length' => null, 'null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '', 'precision' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8_bin'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'group_id' => 1,
'transaction_type_id' => 1,
'tx_hash' => 'Lorem ipsum dolor sit amet',
'memo' => 'Lorem ipsum dolor sit amet',
'received' => 1572973566
],
];
parent::init();
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Test\TestCase\Controller;
use App\Controller\DashboardController;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
/**
* App\Controller\DashboardController Test Case
*
* @uses \App\Controller\DashboardController
*/
class DashboardControllerTest extends TestCase
{
use IntegrationTestTrait;
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
];
/**
* Test initialize method
*
* @return void
*/
public function testInitialize()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test index method
*
* @return void
*/
public function testIndex()
{
$this->markTestIncomplete('Not implemented yet.');
}
}

View File

@ -35,9 +35,9 @@ class PagesControllerTest extends IntegrationTestCase
public function testMultipleGet()
{
$this->get('/');
$this->assertResponseOk();
$this->assertRedirect('account/');
$this->get('/');
$this->assertResponseOk();
$this->assertRedirect('account/');
}
/**

View File

@ -0,0 +1,97 @@
<?php
namespace App\Test\TestCase\Controller;
use App\Controller\TransactionCreationsController;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
/**
* App\Controller\TransactionCreationsController Test Case
*
* @uses \App\Controller\TransactionCreationsController
*/
class TransactionCreationsControllerTest extends TestCase
{
use IntegrationTestTrait;
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
'app.TransactionCreations',
'app.Transactions',
'app.StateUsers'
];
/**
* Test initialize method
*
* @return void
*/
public function testInitialize()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test index method
*
* @return void
*/
public function testIndex()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test view method
*
* @return void
*/
public function testView()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test create method
*
* @return void
*/
public function testCreate()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test add method
*
* @return void
*/
public function testAdd()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test edit method
*
* @return void
*/
public function testEdit()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test delete method
*
* @return void
*/
public function testDelete()
{
$this->markTestIncomplete('Not implemented yet.');
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Test\TestCase\Controller;
use App\Controller\TransactionJsonRequestHandlerController;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
/**
* App\Controller\TransactionJsonRequestHandlerController Test Case
*
* @uses \App\Controller\TransactionJsonRequestHandlerController
*/
class TransactionJsonRequestHandlerControllerTest extends TestCase
{
use IntegrationTestTrait;
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
'app.TransactionCreations',
'app.Transactions',
'app.StateUsers',
'app.TransactionSignatures',
'app.TransactionSendCoins',
'app.StateBalances',
'app.TransactionTypes'
];
/**
* Test initialize method
*
* @return void
*/
public function testInitialize()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test index method
*
* @return void
*/
public function testIndex()
{
//$this->markTestIncomplete('Not implemented yet.');
$this->post('/TransactionJsonRequestHandler', ['method' => 'putTransaction', 'transaction' => 'CgpIYWxsbyBXZWx0EgYIyfSG7gVKLwonCiCboKikqwjZfes9xuqgthFH3/cHHaWchkUhWiGhQjB23xCg2pMBELWJ7ZYK']);
}
}