File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 20
20
use Hyperf \Event \EventDispatcher ;
21
21
use Hyperf \Event \ListenerProvider ;
22
22
use Hyperf \View \Mode ;
23
+ use Hyperf \View \Render ;
24
+ use Hyperf \View \RenderInterface ;
23
25
use Hyperf \ViewEngine \Component \DynamicComponent ;
24
26
use Hyperf \ViewEngine \ConfigProvider ;
25
27
use Hyperf \ViewEngine \HyperfViewEngine ;
26
28
use Psr \EventDispatcher \EventDispatcherInterface ;
27
29
use Psr \EventDispatcher \ListenerProviderInterface ;
30
+ use ReflectionClass ;
28
31
29
32
class ContainerStub
30
33
{
@@ -59,6 +62,15 @@ public static function mockContainer(): ContainerInterface
59
62
],
60
63
]));
61
64
65
+ $ container ->set (RenderInterface::class, new Render ($ container , $ container ->get (ConfigInterface::class)));
66
+
62
67
return $ container ;
63
68
}
69
+
70
+ public static function unsetContainer ()
71
+ {
72
+ $ ref = new ReflectionClass (ApplicationContext::class);
73
+ $ c = $ ref ->getProperty ('container ' );
74
+ $ c ->setValue (null );
75
+ }
64
76
}
You can’t perform that action at this time.
0 commit comments