Example #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed
  */
 protected function setUp()
 {
     global $testCase;
     $testCase = 'table_for_test';
     $this->container = (include './config/container.php');
     $this->promiseStore = $this->container->get(StoreFactory::KEY);
     Callback::setContaner($this->container);
 }
Example #2
0
<?php

// try http://__zaboy-rest/api/rest/index_StoreMiddleware?fNumberOfHours=8&fWeekday=Monday
// Change to the project root, to simplify resolving paths
chdir(dirname(__DIR__));
if (substr($_SERVER['REQUEST_URI'], 1, 4) === 'test') {
    global $testCase;
    $testCase = 'table_for_test';
}
//test_res_http
// Setup autoloading
require 'vendor/autoload.php';
$container = (include 'config/container.php');
use zaboy\async\Callback\Callback;
Callback::setContaner($container);
//use zaboy\async\Json\JsonCoder;
////
//function callback($value)
//{
//    return $value . ' after callbak';
//}
//function callException($value)
//{
//    throw new \Exception('Exception ', 0, new \Exception('prev Exception'));
//}
//
//function onRejected($value)
//{
//    /* @var $value \Exception */
//    return $value->getMessage() . ' was resolved';
//}