Skip to content

Commit 2e2d818

Browse files
committed
fix tests.
1 parent a5f533b commit 2e2d818

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

Diff for: .travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ before_install:
4747
install:
4848
- rm $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini;
4949
- echo "memory_limit=2048M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
50-
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
51-
- composer install
50+
- sed -i '' "s/\"symfony\/\(.*\)\": \".*\"/\"symfony\/\1\": \"$SYMFONY_VERSION\"/g" composer.json && cat composer.json
51+
- composer dunglas/symfony-lock
5252
- if [ "$PREPARE_CONTAINER" = true ]; then docker --version; fi
5353
- if [ "$PREPARE_CONTAINER" = true ]; then docker-compose --version; fi
5454
- if [ "$PREPARE_CONTAINER" = true ]; then bin/dev -b; fi

Diff for: composer.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"doctrine/dbal": "~2.5",
1919
"ramsey/uuid": "^2|^3.5",
2020
"psr/log": "^1",
21-
"symfony/event-dispatcher": "^3.4|^4",
21+
"symfony/event-dispatcher": "4.0.*",
2222
"makasim/temp-file": "^0.2",
2323
"google/cloud-pubsub": "^0.6.1|^1.0",
2424
"doctrine/orm": "~2.4",
@@ -33,16 +33,16 @@
3333
"require-dev": {
3434
"phpunit/phpunit": "^5.5",
3535
"queue-interop/queue-spec": "^0.5.5@dev",
36-
"symfony/browser-kit": "^3.4|^4",
37-
"symfony/config": "^3.4|^4",
38-
"symfony/process": "^3.4|^4",
39-
"symfony/console": "^3.4|^4",
40-
"symfony/dependency-injection": "^3.4|^4",
41-
"symfony/event-dispatcher": "^3.4|^4",
42-
"symfony/expression-language": "^3.4|^4",
43-
"symfony/http-kernel": "^3.4|^4",
44-
"symfony/filesystem": "^3.4|^4",
45-
"symfony/framework-bundle": "^3.4|^4",
36+
"symfony/browser-kit": "4.0.*",
37+
"symfony/config": "4.0.*",
38+
"symfony/process": "4.0.*",
39+
"symfony/console": "4.0.*",
40+
"symfony/dependency-injection": "4.0.*",
41+
"symfony/event-dispatcher": "4.0.*",
42+
"symfony/expression-language": "4.0.*",
43+
"symfony/http-kernel": "4.0.*",
44+
"symfony/filesystem": "4.0.*",
45+
"symfony/framework-bundle": "4.0.*",
4646
"empi89/php-amqp-stubs": "*@dev",
4747
"doctrine/doctrine-bundle": "~1.2",
4848
"kwn/php-rdkafka-stubs": "^1.0.2",

Diff for: pkg/enqueue-bundle/Tests/Functional/Events/AsyncListenerTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Enqueue\Bundle\Tests\Functional\Events;
44

5-
use Enqueue\Bundle\Events\AsyncListener;
5+
use Enqueue\AsyncEventDispatcher\AsyncListener;
66
use Enqueue\Bundle\Tests\Functional\App\TestAsyncListener;
77
use Enqueue\Bundle\Tests\Functional\WebTestCase;
88
use Enqueue\Client\TraceableProducer;
@@ -23,6 +23,8 @@ public function setUp()
2323
$asyncListener = static::$container->get('enqueue.events.async_listener');
2424

2525
$asyncListener->resetSyncMode();
26+
static::$container->get('test_async_subscriber')->calls = [];
27+
static::$container->get('test_async_listener')->calls = [];
2628
}
2729

2830
public function testShouldNotCallRealListenerIfMarkedAsAsync()

Diff for: pkg/enqueue-bundle/Tests/Functional/Events/AsyncSubscriberTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Enqueue\Bundle\Tests\Functional\Events;
44

55
use Enqueue\AsyncEventDispatcher\AsyncListener;
6-
use Enqueue\Bundle\Tests\Functional\App\TestAsyncListener;
6+
use Enqueue\Bundle\Tests\Functional\App\TestAsyncSubscriber;
77
use Enqueue\Bundle\Tests\Functional\WebTestCase;
88
use Enqueue\Client\TraceableProducer;
99
use Symfony\Component\EventDispatcher\Event;
@@ -23,6 +23,8 @@ public function setUp()
2323
$asyncListener = static::$container->get('enqueue.events.async_listener');
2424

2525
$asyncListener->resetSyncMode();
26+
static::$container->get('test_async_subscriber')->calls = [];
27+
static::$container->get('test_async_listener')->calls = [];
2628
}
2729

2830
public function testShouldNotCallRealSubscriberIfMarkedAsAsync()
@@ -32,7 +34,7 @@ public function testShouldNotCallRealSubscriberIfMarkedAsAsync()
3234

3335
$dispatcher->dispatch('test_async_subscriber', new GenericEvent('aSubject'));
3436

35-
/** @var TestAsyncListener $listener */
37+
/** @var TestAsyncSubscriber $listener */
3638
$listener = static::$container->get('test_async_subscriber');
3739

3840
$this->assertEmpty($listener->calls);

Diff for: pkg/enqueue-bundle/Tests/Functional/WebTestCase.php

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Enqueue\Bundle\Tests\Functional;
44

55
use Enqueue\Bundle\Tests\Functional\App\AppKernel;
6+
use Enqueue\Client\TraceableProducer;
67
use Symfony\Bundle\FrameworkBundle\Client;
78
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
89
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -30,6 +31,10 @@ protected function setUp()
3031
if (false == static::$container) {
3132
static::$container = static::$kernel->getContainer();
3233
}
34+
35+
/** @var TraceableProducer $producer */
36+
$producer = static::$container->get(TraceableProducer::class);
37+
$producer->clearTraces();
3338
}
3439

3540
/**

0 commit comments

Comments
 (0)