From 5eca77da34946985d26e66703239f6de71c11c33 Mon Sep 17 00:00:00 2001 From: Alessandro Chitolina Date: Sat, 20 Feb 2021 23:50:58 +0100 Subject: [PATCH] fix composer command --- .github/workflows/tests.yml | 10 ++++------ tests/Transport/Dbal/IntegrationTest.php | 6 +++--- tests/Transport/Mongo/IntegrationTest.php | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 75bb7bd..383f2f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,14 +32,12 @@ jobs: image: mysql:5.7 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: messenger ports: - 3306:3306 mongo: image: mongo - env: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: secret ports: - 27017:27017 @@ -50,11 +48,11 @@ jobs: with: php-version: ${{ matrix.php_version }} extensions: mongodb, :opcache - - run: composer install --dev --no-update symfony/messenger=${{ matrix.symfony_version }} + - run: composer require --dev --no-update symfony/messenger=${{ matrix.symfony_version }} - run: composer remove --dev --no-update kcs/serializer if: matrix.symfony_serializer - - run: composer install + - run: composer install --ignore-platform-reqs - run: vendor/bin/phpunit env: DB: ${{ matrix.database }} - MONGODB_URI: mongodb://root:secret@localhost:27017/ + MONGODB_URI: mongodb://localhost:27017/ diff --git a/tests/Transport/Dbal/IntegrationTest.php b/tests/Transport/Dbal/IntegrationTest.php index 6dbb664..1d91d94 100644 --- a/tests/Transport/Dbal/IntegrationTest.php +++ b/tests/Transport/Dbal/IntegrationTest.php @@ -43,12 +43,12 @@ protected function setUp(): void switch ($db) { case 'mysql': case 'mariadb': - $connection = DriverManager::getConnection(['url' => 'mysql://root@localhost']); - $this->transport = $factory->createTransport($this->dsn = 'mysql://root@localhost/messenger', [], $serializer); + $connection = DriverManager::getConnection(['url' => 'mysql://root@127.0.0.1/messenger']); + $this->transport = $factory->createTransport($this->dsn = 'mysql://root@127.0.0.1/messenger', [], $serializer); break; case 'postgresql': - $connection = DriverManager::getConnection(['url' => 'pgsql://postgres@localhost']); + $connection = DriverManager::getConnection(['url' => 'pgsql://postgres@localhost/messenger']); $this->transport = $factory->createTransport($this->dsn = 'pgsql://postgres@localhost/messenger', [], $serializer); break; diff --git a/tests/Transport/Mongo/IntegrationTest.php b/tests/Transport/Mongo/IntegrationTest.php index 53e4a8d..1585c9a 100644 --- a/tests/Transport/Mongo/IntegrationTest.php +++ b/tests/Transport/Mongo/IntegrationTest.php @@ -71,7 +71,8 @@ public function testSendsAndReceivesMessages(): void $receivedMessages = 0; $workerClass = new \ReflectionClass(Worker::class); $thirdArgument = $workerClass->getConstructor()->getParameters()[2]; - if (EventDispatcherInterface::class === (string) $thirdArgument->getType()) { + $argumentType = $thirdArgument->getType(); + if (EventDispatcherInterface::class === ($argumentType ? $argumentType->getName() : null)) { $worker = new Worker([$this->transport], new MessageBus(), $eventDispatcher = new EventDispatcher()); } else { $worker = new Worker([$this->transport], new MessageBus(), [], $eventDispatcher = new EventDispatcher());