initial 2.0.0-a3 commit

This commit is contained in:
jerry
2020-10-03 23:00:18 +08:00
parent f91d24aaaa
commit da584e0542
28 changed files with 580 additions and 225 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace ZMTest\Testing;
use Module\Example\Hello;
use PHPUnit\Framework\TestCase;
use ZM\Config\ZMConfig;
use ZM\Utils\ZMUtil;
class ModuleTest extends TestCase
{
protected function setUp(): void {
ZMConfig::setDirectory(realpath(__DIR__."/../Mock"));
set_coroutine_params([]);
require_once __DIR__ . '/../../../src/ZM/global_defines.php';
}
public function testCtx() {
$r = ZMUtil::getModInstance(Hello::class);
ob_start();
$r->randNum(["随机数", "1", "5"]);
$out = ob_get_clean();
$this->assertEquals("随机数是1\n", $out);
}
}