mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-08 17:25:35 +08:00
initial 2.0.0-a3 commit
This commit is contained in:
27
test/ZMTest/Testing/ModuleTest.php
Normal file
27
test/ZMTest/Testing/ModuleTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user