File tree 3 files changed +58
-0
lines changed
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 23
23
use HyperfTest \Di \Stub \Ast \Foo ;
24
24
use HyperfTest \Di \Stub \Ast \FooTrait ;
25
25
use HyperfTest \Di \Stub \FooEnumStruct ;
26
+ use HyperfTest \Di \Stub \Par2 ;
26
27
use PHPUnit \Framework \TestCase ;
27
28
28
29
/**
@@ -67,6 +68,28 @@ function __construct()
67
68
} ' , $ code );
68
69
}
69
70
71
+ public function testParentWith ()
72
+ {
73
+ $ ast = new Ast ();
74
+ $ code = $ ast ->proxy (Par2::class);
75
+
76
+ $ this ->assertSame ($ this ->license . '
77
+ namespace HyperfTest\Di\Stub;
78
+
79
+ class Par2 extends Par
80
+ {
81
+ use \Hyperf\Di\Aop\ProxyTrait;
82
+ use \Hyperf\Di\Aop\PropertyHandlerTrait;
83
+ function __construct(?\HyperfTest\Di\Stub\Foo $foo)
84
+ {
85
+ if (method_exists(parent::class, \'__construct \')) {
86
+ parent::__construct(...func_get_args());
87
+ }
88
+ $this->__handlePropertyHandler(__CLASS__);
89
+ }
90
+ } ' , $ code );
91
+ }
92
+
70
93
public function testAstProxyForEnum ()
71
94
{
72
95
if (PHP_VERSION_ID < 80100 ) {
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+ /**
5
+ * This file is part of Hyperf.
6
+ *
7
+ * @link https://www.hyperf.io
8
+ * @document https://hyperf.wiki
9
+
10
+ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11
+ */
12
+ namespace HyperfTest \Di \Stub ;
13
+
14
+ class Par
15
+ {
16
+ public function __construct (public ?Foo $ foo )
17
+ {
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+ /**
5
+ * This file is part of Hyperf.
6
+ *
7
+ * @link https://www.hyperf.io
8
+ * @document https://hyperf.wiki
9
+
10
+ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11
+ */
12
+ namespace HyperfTest \Di \Stub ;
13
+
14
+ class Par2 extends Par
15
+ {
16
+ }
You can’t perform that action at this time.
0 commit comments