Skip to content

Commit

Permalink
Merge branch 'bug/60'
Browse files Browse the repository at this point in the history
  • Loading branch information
armetiz committed Feb 23, 2016
2 parents 31d3c22 + ab1e37d commit f28385a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -9,8 +9,6 @@ php:
- hhvm

env:
- SYMFONY_VERSION=2.3.*
- SYMFONY_VERSION=2.4.*
- SYMFONY_VERSION=2.5.*
- SYMFONY_VERSION=2.6.*
- SYMFONY_VERSION=2.7.*
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -13,8 +13,8 @@
"require": {
"php": ">=5.5.9",
"psr/log": "~1.0",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/console": "~2.3|~3.0",
"symfony/framework-bundle": "~2.5|~3.0",
"symfony/console": "~2.5|~3.0",
"pda/pheanstalk": "~3.0"
},
"require-dev": {
Expand Down
21 changes: 21 additions & 0 deletions tests/Listener/PheanstalkLogListenerTest.php
Expand Up @@ -7,6 +7,7 @@
use Pheanstalk\Connection;
use Pheanstalk\PheanstalkInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;

class PheanstalkLogListenerTest extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -79,4 +80,24 @@ public function testServiceNotListening()
$listener->setLogger($this->logger);
$listener->onCommand(new CommandEvent($this->pheanstalk, []), CommandEvent::PEEK_READY);
}

/**
* @see https://github.com/armetiz/LeezyPheanstalkBundle/issues/60
*/
public function testWithEventDispatcher()
{
$this->logger->expects($this->once())->method('info');

$this->connection->expects($this->any())->method('isServiceListening')->will($this->returnValue(true));

$listener = new PheanstalkLogListener();
$listener->setLogger($this->logger);

$eventDispatcher = new EventDispatcher();
$eventDispatcher->addSubscriber($listener);
$eventDispatcher->dispatch(
CommandEvent::PEEK_READY,
new CommandEvent($this->pheanstalk, [])
);
}
}

0 comments on commit f28385a

Please sign in to comment.