<?php
/**
 * @author gaobinzhan <gaobinzhan@gmail.com>
 */


namespace EasySwoole\EasySwoole\Test;


use EasySwoole\Component\Di;
use EasySwoole\Component\Event;
use EasySwoole\EasySwoole\Core;
use EasySwoole\EasySwoole\Logger;
use EasySwoole\EasySwoole\SysConst;
use EasySwoole\Log\LoggerInterface;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestResult;

class LoggerTest extends TestCase
{
    /** @var Logger */
    private $logger;

    public function runTest()
    {
        Core::getInstance()->initialize();
        $logger = Di::getInstance()->get(SysConst::LOGGER_HANDLER);
        $this->logger = Logger::getInstance($logger);
        return parent::runTest(); // TODO: Change the autogenerated stub
    }

    public function testOnLog()
    {
        $this->assertInstanceOf(Event::class, $this->logger->onLog());
    }
}