mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-12 03:05:34 +08:00
add PHP8 Attribute compatibility (build 439, 2.7.0-beta4)
This commit is contained in:
@@ -35,6 +35,7 @@ class AnnotationParserRegisterTest extends TestCase
|
||||
public function testAnnotation() {
|
||||
ob_start();
|
||||
$gen = $this->parser->generateAnnotationEvents();
|
||||
//zm_dump($gen);
|
||||
$m = $gen[OnStart::class][0]->method;
|
||||
$class = $gen[OnStart::class][0]->class;
|
||||
$c = new $class();
|
||||
@@ -43,12 +44,10 @@ class AnnotationParserRegisterTest extends TestCase
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
$result = ob_get_clean();
|
||||
echo $result;
|
||||
$this->assertStringContainsString("我开始了!", $result);
|
||||
}
|
||||
|
||||
public function testAnnotation2() {
|
||||
|
||||
foreach ($this->parser->generateAnnotationEvents() as $k => $v) {
|
||||
foreach ($v as $vs) {
|
||||
$this->assertTrue($vs->method === null || $vs->method != '');
|
||||
@@ -57,22 +56,9 @@ class AnnotationParserRegisterTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testAnnotationMap() {
|
||||
$map = $this->parser->getMiddlewareMap();
|
||||
$this->assertContainsEquals("timer", $map[Hello::class]["timer"]);
|
||||
}
|
||||
|
||||
public function testMiddlewares() {
|
||||
$wares = $this->parser->getMiddlewares();
|
||||
zm_dump($wares);
|
||||
$this->assertArrayHasKey("timer", $wares);
|
||||
}
|
||||
|
||||
public function testReqMapping() {
|
||||
$mapping = $this->parser->getReqMapping();
|
||||
$this->assertEquals("index", $mapping["method"]);
|
||||
}
|
||||
|
||||
public function testTracer() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user