mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 13:18:22 +08:00
Fixed test of logger.
This commit is contained in:
parent
c3b3823967
commit
c62a0a006b
@ -16,6 +16,7 @@ use Hyperf\Config\Config;
|
||||
use Hyperf\Contract\ConfigInterface;
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Logger\LoggerFactory;
|
||||
use Hyperf\Utils\ApplicationContext;
|
||||
use Mockery;
|
||||
use Monolog\Logger;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
@ -28,6 +29,11 @@ use Psr\Log\LoggerInterface;
|
||||
*/
|
||||
class LoggerFactoryTest extends TestCase
|
||||
{
|
||||
public function tearDown()
|
||||
{
|
||||
Mockery::close();
|
||||
}
|
||||
|
||||
public function testInvokeLoggerFactory()
|
||||
{
|
||||
$container = $this->mockContainer();
|
||||
@ -38,6 +44,8 @@ class LoggerFactoryTest extends TestCase
|
||||
public function testInvokeLoggerFromFactory()
|
||||
{
|
||||
$container = $this->mockContainer();
|
||||
// $container->shouldReceive('make')->once()->with(LoggerFactory::class)->andReturn(new LoggerFactory($container));
|
||||
ApplicationContext::setContainer($container);
|
||||
$factory = $container->get(LoggerFactory::class);
|
||||
|
||||
$logger = $factory->get('hyperf');
|
||||
|
Loading…
Reference in New Issue
Block a user