/**
  * Make sure a new transaction is created if no one exists.
  */
 public function testTransactionCreated()
 {
     $user_id = $this->factory->user->create();
     $account = bca_user_account($user_id);
     $address = $account->getDepositAddress();
     $this->assertTrue(strlen($address) > 4);
     $data = array("type" => "address", "data" => array("address" => $address, "txid" => "12345678", "balance_change" => "0.05000000", "confirmations" => 0));
     BlockIoController::instance()->process($data);
     $transaction = Transaction::findOneBy("transactionHash", "12345678");
     $this->assertEquals(0.05, $transaction->getAmount("btc"));
     $this->assertEquals($transaction->getState(), Transaction::CONFIRMING);
     $account = bca_user_account($user_id);
     $this->assertEquals(0, $account->getBalance("btc"));
     $this->assertEquals(0.05, $account->getConfirmingBalance("btc"));
     $data = array("type" => "address", "data" => array("address" => $address, "txid" => "12345678", "balance_change" => "0.05000000", "confirmations" => "3"));
     BlockIoController::instance()->process($data);
     $account = bca_user_account($user_id);
     $this->assertEquals(0.05, $account->getBalance("btc"));
 }
<?php

require_once __DIR__ . "/src/utils/WpUtil.php";
require_once __DIR__ . "/src/controller/BlockIoController.php";
use wpblockchainaccounts\WpUtil;
use wpblockchainaccounts\BlockIoController;
WpUtil::bootstrap();
BlockIoController::instance()->processPost();