Skip to content

php 8 Support [WIP] #1121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0c98390
[php8][travis] Removed old php ^7 builds as this major release will s…
svbackend Dec 28, 2020
3aec315
[php8][deps] Bump php to ^8 and phpunit to ^ 9.5 in composer.json
svbackend Dec 28, 2020
3f041de
[php8][travis] Restore php 7 builds but keep new php 8 build
svbackend Dec 30, 2020
e48140f
[php8][deps] Bump php from ^7.1 to >=7.3 and phpunit from 7.5 to 9.5
svbackend Dec 30, 2020
0879a7d
[php8][tests] Adjust setUp() to setUp(): void return typehint to be c…
svbackend Dec 30, 2020
50851e9
[php8][tests] Adjust setUp() to setUp(): void return typehint to be c…
svbackend Dec 30, 2020
cb833c8
[php8][tests] Typehint for setUpBeforeClass (added :void)
svbackend Dec 30, 2020
636cea3
[php8][tests] Fix getQueue invalid return type error. Added nullQueue…
svbackend Dec 30, 2020
e27eb56
[php8][tests] Enqueu Client - ExclusiveCommandExtensionTest fix queue…
svbackend Dec 30, 2020
8ab130b
[php8][tests] Enqueu Client - fix queue stub return type. Use NullQue…
svbackend Dec 30, 2020
f7044ea
[php8][tests] enqueue/Client/ConsumtionExtension fix queue return typ…
svbackend Dec 30, 2020
e65c82b
[php8][deps] Added extenstion to support assertArraySubset as this me…
svbackend Dec 30, 2020
8673be3
[php8][tests] Fix ConsumptionExtension tests that were failing becaus…
svbackend Dec 30, 2020
134586e
[php8][tests] Replace ->assertArraySubset by \DMS\PHPUnitExtensions\A…
svbackend Dec 30, 2020
6bb7bbd
[php8][enqueue][tests] Replace depracated methods to check types
svbackend Dec 30, 2020
088bd66
[php8][enqueue][tests] FallbackSubscription - rewrite tests that used…
svbackend Dec 31, 2020
e24eee5
[php8][enqueue][tests] QueueConsumerTest - remove tests with assertAt…
svbackend Dec 31, 2020
0f729a4
[php8][enqueue][tests] Replace assertContains to assertStringContains…
svbackend Dec 31, 2020
d17dfa6
[php8][tests] Replace phpunit's assertArraySubset by extension's meth…
svbackend Jan 8, 2021
d836014
[php8][tests] Added ReadAttributeTrait to test proper configuration p…
svbackend Jan 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ matrix:
sudo: required
services: docker
env: SYMFONY_VERSION=4.3.* RDKAFKA_TESTS=true PREPARE_CONTAINER=true
- php: 8.0
sudo: false
services: docker
env: SYMFONY_VERSION=5.2.* UNIT_TESTS=true
allow_failures:
- env: SYMFONY_VERSION=4.3.* RDKAFKA_TESTS=true PREPARE_CONTAINER=true

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon"
},
"require": {
"php": "^7.1.3",
"php": ">=7.3",

"ext-amqp": "^1.9.3",
"ext-gearman": "^2.0",
Expand Down Expand Up @@ -41,7 +41,7 @@
"datadog/php-datadogstatsd": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^0.12",
"queue-interop/queue-spec": "^0.6",
"symfony/browser-kit": "^3.4|^4",
Expand All @@ -60,7 +60,8 @@
"doctrine/mongodb-odm-bundle": "^3.5|^4",
"alcaeus/mongo-php-adapter": "^1.0",
"kwn/php-rdkafka-stubs": "^1.0.2 | ^2.0",
"friendsofphp/php-cs-fixer": "^2"
"friendsofphp/php-cs-fixer": "^2",
"dms/phpunit-arraysubset-asserts": "^0.2.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/Tests/Functional/AmqpCommonUseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AmqpCommonUseCasesTest extends TestCase
*/
private $amqpContext;

public function setUp()
public function setUp(): void
{
$this->amqpContext = $this->buildAmqpContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AmqpConsumptionUseCasesTest extends TestCase
*/
private $amqpContext;

public function setUp()
public function setUp(): void
{
$this->amqpContext = $this->buildAmqpContext();

Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/Tests/Functional/AmqpRpcUseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AmqpRpcUseCasesTest extends TestCase
*/
private $amqpContext;

public function setUp()
public function setUp(): void
{
$this->amqpContext = $this->buildAmqpContext();

Expand Down
4 changes: 2 additions & 2 deletions pkg/amqp-tools/Tests/SignalSocketHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SignalSocketHelperTest extends TestCase

private $backupSigIntHandler;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down Expand Up @@ -76,7 +76,7 @@ public function testShouldRegisterHandlerOnBeforeSocketAndBackupCurrentOne()

$handlers = $this->readAttribute($this->signalHelper, 'handlers');

$this->assertInternalType('array', $handlers);
$this->assertIsArray($handlers);
$this->assertArrayHasKey(SIGTERM, $handlers);
$this->assertSame($handler, $handlers[SIGTERM]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class UseCasesTest extends TestCase
*/
protected $asyncProcessor;

public function setUp()
public function setUp(): void
{
(new Filesystem())->remove(__DIR__.'/queues/');

Expand Down
2 changes: 2 additions & 0 deletions pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Enqueue\Dbal\DbalConnectionFactory;
use Enqueue\Test\ClassExtensionTrait;
use Enqueue\Test\ReadAttributeTrait;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -12,6 +13,7 @@
class DbalConnectionFactoryConfigTest extends TestCase
{
use ClassExtensionTrait;
use ReadAttributeTrait;

public function testThrowNeitherArrayStringNorNullGivenAsConfig()
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/Tests/Functional/DbalConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DbalConsumerTest extends TestCase
*/
private $context;

public function setUp()
public function setUp(): void
{
$this->context = $this->createDbalContext();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DbalSendAndReceivePriorityMessagesFromQueueTest extends SendAndReceivePrio

private $publishedAt;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DbalSendAndReceivePriorityMessagesFromQueueTest extends SendAndReceivePrio

private $publishedAt;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class AsyncListenerTest extends WebTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class AsyncProcessorTest extends WebTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class AsyncSubscriberTest extends WebTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue-bundle/Tests/Functional/LazyProducerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class LazyProducerTest extends WebTestCase
{
public function setUp()
public function setUp(): void
{
// do not call parent::setUp.
// parent::setUp();
Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue-bundle/Tests/Functional/UseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class UseCasesTest extends WebTestCase
{
const RECEIVE_TIMEOUT = 500;

public function setUp()
public function setUp(): void
{
// do not call parent::setUp.
// parent::setUp();
Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue-bundle/Tests/Functional/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class WebTestCase extends BaseWebTestCase
*/
protected static $container;

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Enqueue\Bundle\Tests\Unit\DependencyInjection;

use DMS\PHPUnitExtensions\ArraySubset\Assert;
use Enqueue\Bundle\DependencyInjection\Configuration;
use Enqueue\Test\ClassExtensionTrait;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -222,7 +223,7 @@ public function testJobShouldBeDisabledByDefault()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'job' => [
'enabled' => false,
Expand All @@ -243,7 +244,7 @@ public function testCouldEnableJob()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'job' => true,
],
Expand All @@ -261,7 +262,7 @@ public function testDoctrinePingConnectionExtensionShouldBeDisabledByDefault()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_ping_connection_extension' => false,
Expand All @@ -284,7 +285,7 @@ public function testDoctrinePingConnectionExtensionCouldBeEnabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_ping_connection_extension' => true,
Expand All @@ -304,7 +305,7 @@ public function testDoctrineClearIdentityMapExtensionShouldBeDisabledByDefault()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_clear_identity_map_extension' => false,
Expand All @@ -327,7 +328,7 @@ public function testDoctrineClearIdentityMapExtensionCouldBeEnabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_clear_identity_map_extension' => true,
Expand All @@ -347,7 +348,7 @@ public function testDoctrineOdmClearIdentityMapExtensionShouldBeDisabledByDefaul
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_odm_clear_identity_map_extension' => false,
Expand All @@ -370,7 +371,7 @@ public function testDoctrineOdmClearIdentityMapExtensionCouldBeEnabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_odm_clear_identity_map_extension' => true,
Expand All @@ -390,7 +391,7 @@ public function testDoctrineClosedEntityManagerExtensionShouldBeDisabledByDefaul
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_closed_entity_manager_extension' => false,
Expand All @@ -413,7 +414,7 @@ public function testDoctrineClosedEntityManagerExtensionCouldBeEnabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'doctrine_closed_entity_manager_extension' => true,
Expand All @@ -433,7 +434,7 @@ public function testResetServicesExtensionShouldBeDisabledByDefault()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'reset_services_extension' => false,
Expand All @@ -456,7 +457,7 @@ public function testResetServicesExtensionCouldBeEnabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'reset_services_extension' => true,
Expand All @@ -478,7 +479,7 @@ public function testSignalExtensionShouldBeEnabledIfPcntlExtensionIsLoaded()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'signal_extension' => $isLoaded,
Expand All @@ -501,7 +502,7 @@ public function testSignalExtensionCouldBeDisabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'signal_extension' => false,
Expand All @@ -521,7 +522,7 @@ public function testReplyExtensionShouldBeEnabledByDefault()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'reply_extension' => true,
Expand All @@ -544,7 +545,7 @@ public function testReplyExtensionCouldBeDisabled()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'extensions' => [
'reply_extension' => false,
Expand All @@ -564,7 +565,7 @@ public function testShouldDisableAsyncEventsByDefault()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'async_events' => [
'enabled' => false,
Expand All @@ -586,7 +587,7 @@ public function testShouldAllowEnableAsyncEvents()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'async_events' => [
'enabled' => true,
Expand All @@ -603,7 +604,7 @@ public function testShouldAllowEnableAsyncEvents()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'async_events' => [
'enabled' => true,
Expand All @@ -623,7 +624,7 @@ public function testShouldSetDefaultConfigurationForConsumption()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'consumption' => [
'receive_timeout' => 10000,
Expand All @@ -646,7 +647,7 @@ public function testShouldAllowConfigureConsumption()
],
]]);

$this->assertArraySubset([
Assert::assertArraySubset([
'default' => [
'consumption' => [
'receive_timeout' => 456,
Expand All @@ -657,6 +658,6 @@ public function testShouldAllowConfigureConsumption()

private function assertConfigEquals(array $expected, array $actual): void
{
$this->assertArraySubset($expected, $actual, false, var_export($actual, true));
Assert::assertArraySubset($expected, $actual, false, var_export($actual, true));
}
}
Loading