Skip to content

Commit ab75a0b

Browse files
v2.0.13 (#2586)
* Update CHANGELOG-2.0.md * Update awesome-components.md Co-authored-by: huangzhhui <[email protected]>
1 parent f6ce4c9 commit ab75a0b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/ClassLoaderTest.php

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
* @contact [email protected]
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+
}

0 commit comments

Comments
 (0)