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


namespace EasySwoole\EasySwoole\Test;


use EasySwoole\Component\Di;
use EasySwoole\Component\Event;
use EasySwoole\EasySwoole\SysConst;
use EasySwoole\EasySwoole\Trigger;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestResult;

class TriggerTest extends TestCase
{
    /** @var Trigger */
    private $trigger;

    public function runTest()
    {
        $trigger = Di::getInstance()->get(SysConst::TRIGGER_HANDLER);
        $this->trigger = Trigger::getInstance($trigger);
        return parent::runTest(); // TODO: Change the autogenerated stub
    }

    public function testOnError()
    {
        $this->assertInstanceOf(Event::class, $this->trigger->onError());
    }

    public function testOnException()
    {
        $this->assertInstanceOf(Event::class, $this->trigger->onException());
    }
}