Skip to content

Instantly share code, notes, and snippets.

@desarrolla2
Created December 10, 2014 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desarrolla2/93093d49cc1c7b385ae1 to your computer and use it in GitHub Desktop.
Save desarrolla2/93093d49cc1c7b385ae1 to your computer and use it in GitHub Desktop.
<?php
/*
* This file is part of the shows on demand package.
*
* (c) Daniel González <daniel@desarrolla2.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sod\CoreBundle\Tests\Unit\Listener;
use Sod\CoreBundle\Listener\RequestListener;
/**
* RequestListenerTest
*/
class RequestListenerTest extends \PHPUnit_Framework_TestCase
{
public function testRequestConfirmed()
{
$manager = $this->prophet->prophesize('Sod\CoreBundle\Manager\AccessManager');
$producer = $this->prophet->prophesize('OldSound\RabbitMqBundle\RabbitMq\Producer');
$event = $this->prophet->prophesize('Sod\CoreBundle\Event\CoreEvent');
$request = $this->prophet->prophesize('Sod\CoreBundle\Entity\Request');
$request->getId()->willReturn(1);
$event->getEntity()->willReturn($request->reveal());
$manager->generate($request);
$producer->publish();
$listener = new RequestListener($manager->reveal(), $producer->reveal());
$listener->onRequestConfirmed($event->reveal());
}
protected function setup()
{
$this->prophet = new \Prophecy\Prophet;
}
protected function tearDown()
{
$this->prophet->checkPredictions();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment