Created
December 10, 2014 10:14
-
-
Save desarrolla2/93093d49cc1c7b385ae1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the shows on demand package. | |
* | |
* (c) Daniel González <[email protected]> | |
* | |
* 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