File tree 1 file changed +39
-0
lines changed
1 file changed +39
-0
lines changed 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 ;
13
+
14
+ use Hyperf \Di \ClassLoader ;
15
+ use PHPUnit \Framework \TestCase ;
16
+
17
+ /**
18
+ * @internal
19
+ * @coversNothing
20
+ */
21
+ class ClassLoaderTest extends TestCase
22
+ {
23
+ public function testDotEnv ()
24
+ {
25
+ $ class = new class () extends ClassLoader {
26
+ public function __construct ()
27
+ {
28
+ }
29
+ };
30
+
31
+ $ ref = new \ReflectionClass ($ class );
32
+ $ method = $ ref ->getMethod ('loadDotenv ' );
33
+ $ method ->setAccessible (true );
34
+ $ method ->invoke ($ class );
35
+
36
+ $ this ->assertNotEquals ('0.0.0 ' , env ('SW_VERSION ' ));
37
+ $ this ->assertSame ('Hyperf ' , env ('PHP_FRAMEWORK ' ));
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments