spec\Ayaline\Bundle\ComposerBundle\Consumer\Step\CheckVulnerabilitiesStepSpec::it_push_error_message_and_alerts_when_vulnerability_found PHP Метод

it_push_error_message_and_alerts_when_vulnerability_found() публичный Метод

public it_push_error_message_and_alerts_when_vulnerability_found ( SensioLabs\Security\SecurityChecker $securityChecker, Sonata\NotificationBundle\Consumer\ConsumerEvent $event, Sonata\NotificationBundle\Model\Message $message, Pusher $pusher )
$securityChecker SensioLabs\Security\SecurityChecker
$event Sonata\NotificationBundle\Consumer\ConsumerEvent
$message Sonata\NotificationBundle\Model\Message
$pusher Pusher
    public function it_push_error_message_and_alerts_when_vulnerability_found(SecurityChecker $securityChecker, ConsumerEvent $event, Message $message, \Pusher $pusher)
    {
        $event->getMessage()->shouldBeCalled()->willReturn($message);
        $message->getValue('channelName')->shouldBeCalled()->willReturn('new_channel');
        $pusher->trigger('new_channel', 'consumer:new-step', array('message' => 'Checking vulnerability'))->shouldBeCalled();
        $securityChecker->check(sys_get_temp_dir() . '/composer_dir/composer.lock', 'text')->shouldBeCalled()->willReturn($this->getVulnerabilityMessage());
        $securityChecker->getLastVulnerabilityCount()->shouldBeCalled()->willReturn(1);
        $pusher->trigger('new_channel', 'consumer:step-error', array('message' => 'Vulnerability found : 1'))->shouldBeCalled();
        $pusher->trigger('new_channel', 'consumer:vulnerabilities', array('message' => $this->getVulnerabilityMessage()))->shouldBeCalled();
        $this->execute($event, 'composer_dir')->shouldReturn(0);
    }