Example #1
0
<?php

$hermit = new Hermit('HogeQueue');
echo 'please, Program stop = Ctrl-C', PHP_EOL;
$id = 0;
while (true) {
    $param = new HermitParam();
    $param->id = $id++;
    $param->name = crc32((string) $id);
    $hermit->add($param);
}
    const callINOUT_MULTI_PROCEDURE = 'PROC_INOUT_MULTIRESULT';
    const callINOUT_MULTI_VALUE_TYPE = 'OBJ';
    public function callINOUT_MULTI(HermitParam $param);
    const callOUT_MULTI_PROCEDURE = 'PROC_OUT_MULTIRESULT';
    const callOUT_MULTI_VALUE_TYPE = 'OBJ';
    public function callOUT_MULTI(HermitParam $param);
    const callNOSPEC_PARAM_PROCEDURE = 'PROC_NOSPEC_PARAM';
    const callNOSPEC_PARAM_VALUE_TYPE = 'OBJ';
    public function callNOSPEC_PARAM(HermitParam $param);
}
$pdo = new PDO('mysql:host=localhost; dbname=hermit_test', 'root', 'password');
db_init($pdo);
$test = new lime_test();
$test->diag(basename(__FILE__));
HermitDataSourceManager::setDefault($pdo);
$hermit = new Hermit('PROC');
$param = new HermitParam();
$param->sales = 1000;
$param->tax = -1;
$result = $hermit->callIN_OUT($param);
$test->ok($param->tax !== -1);
$test->is($param->tax, 200);
$test->ok($result === null);
$param = new HermitParam();
$param->sales = 5000;
$result = $hermit->callINOUT($param);
$test->ok($result === null);
$test->is($param->sales, 1000);
$result2 = $hermit->callINOUT($param);
$test->ok($result === null);
$test->is($param->sales, 200);