spec\Namshi\Notificator\Notification\Handler\NotifySendSpec::it_should_handle_notifysend_notifications_only PHP 메소드

it_should_handle_notifysend_notifications_only() 공개 메소드

public it_should_handle_notifysend_notifications_only ( ExecutableFinder $finder )
$finder Symfony\Component\Process\ExecutableFinder
    function it_should_handle_notifysend_notifications_only($finder)
    {
        $notification = new NotifySendNotification('message', []);
        $otherNotification = new EmailNotification(['recipient'], []);
        $finder->find(NotifySend::NOTIFY_SEND_COMMAND)->willReturn(true);
        if (!$this->getWrappedObject()->shouldHandle($notification)) {
            throw new \Exception('fails');
        }
        if ($this->getWrappedObject()->shouldHandle($otherNotification)) {
            throw new \Exception('fails');
        }
        $finder->find(NotifySend::NOTIFY_SEND_COMMAND)->willReturn(null);
        if ($this->getWrappedObject()->shouldHandle($notification)) {
            throw new \Exception('fails');
        }
    }