Skip to content

PHPUnit 9.5 #1131

New issue

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

By clicking “No 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? No Sign in to your account

Merged
merged 26 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6faffd4
Add php 8, drop 7.1 and 7.2; up phpunit to 9.5
andrewmy Jan 22, 2021
87652fe
Disable fail-fast
andrewmy Jan 22, 2021
9567c78
Fix test setUp method signatures
andrewmy Jan 22, 2021
3731d69
Fix more setUp signatures
andrewmy Jan 22, 2021
30687ac
Fix setUpBeforeClass signatures
andrewmy Jan 22, 2021
642c5ef
Fix phpunit compatibility
andrewmy Jan 24, 2021
d38fc1d
Remove php 8 from the build matrix for now
andrewmy Jan 24, 2021
da22b90
Fix more attributes; nullable params
andrewmy Jan 24, 2021
6938300
Fix more attributes; void returns; assert string contains; resource;
andrewmy Jan 24, 2021
689c70a
Fix more attributes and nullables
andrewmy Jan 24, 2021
3eb9ba3
Fix annotations
andrewmy Jan 24, 2021
2b33202
Fix more attributes
andrewmy Jan 24, 2021
63aaebf
Fix datetime equal tests
andrewmy Jan 24, 2021
140bc01
Fix at() warnings for non-logger mocks — don't test for method call o…
andrewmy Jan 21, 2021
582b3a9
Fix logger-related at() warnings — replace mocks with TestLogger
andrewmy Jan 21, 2021
b2b1d59
Fix renamed assertions and prophecy warnings
andrewmy Jan 21, 2021
32d49e3
Fix prophecy warning
andrewmy Jan 21, 2021
c0ce9b6
Fix mocks and logger
andrewmy Jan 24, 2021
dcb62c6
Revert "Fix at() warnings for non-logger mocks — don't test for metho…
andrewmy Jan 24, 2021
9d34085
Ignore phpunit result cache
andrewmy Jan 25, 2021
443fd77
Fix reading parent attribute
andrewmy Jan 25, 2021
d380e5e
Migrate PhpUnit config
andrewmy Jan 25, 2021
5a403dc
Fix stan
andrewmy Jan 25, 2021
8ba6750
Fix CS
andrewmy Jan 25, 2021
9e6a755
Update PHP and PHPUnit across all packages; fix ext-rdkafka requirement
andrewmy Jan 25, 2021
1cad99f
Fix CS
andrewmy Jan 25, 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
23 changes: 3 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
Expand All @@ -78,27 +78,10 @@ jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4']
include:
- php: 7.1
symfony_version: 4.3.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.2
symfony_version: 4.3.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.2
symfony_version: 5.0.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.3
symfony_version: 4.3.*
unit_tests: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ var
.php_cs
.php_cs.cache
composer.lock
.phpunit.result.cache
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"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",
"ext-mongodb": "^1.5",
"ext-rdkafka": "^3.0.3",
"ext-rdkafka": "^3.0.3|^4.0|^5.0",

"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.7|^0.8",
Expand All @@ -41,7 +41,8 @@
"datadog/php-datadogstatsd": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"ext-pcntl": "*",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^0.12",
"queue-interop/queue-spec": "^0.6",
"symfony/browser-kit": "^3.4|^4",
Expand All @@ -60,7 +61,9 @@
"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",
"phpspec/prophecy-phpunit": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion docs/bundle/functional_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FooTest extends WebTestCase
/** @var \Symfony\Bundle\FrameworkBundle\Client */
private $client;

public function setUp()
public function setUp(): void
{
$this->client = static::createClient();
}
Expand Down
16 changes: 8 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
Expand Down Expand Up @@ -129,12 +129,12 @@
<env name="SHELL_VERBOSITY" value="-1"/>
</php>

<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">.</directory>
<exclude>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory>./vendor</directory>
</exclude>
</coverage>
</phpunit>
2 changes: 2 additions & 0 deletions pkg/amqp-bunny/Tests/AmqpConnectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
use Enqueue\AmqpBunny\AmqpConnectionFactory;
use Enqueue\AmqpTools\RabbitMqDlxDelayStrategy;
use Enqueue\Test\ClassExtensionTrait;
use Enqueue\Test\ReadAttributeTrait;
use Interop\Queue\ConnectionFactory;
use PHPUnit\Framework\TestCase;

class AmqpConnectionFactoryTest extends TestCase
{
use ClassExtensionTrait;
use ReadAttributeTrait;

public function testShouldImplementConnectionFactoryInterface()
{
Expand Down
4 changes: 2 additions & 2 deletions pkg/amqp-bunny/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.1.3",
"php": "^7.3",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"bunny/bunny": "^0.4",
"enqueue/amqp-tools": "^0.10"
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"phpunit/phpunit": "^9.5",
"enqueue/test": "0.10.x-dev",
"enqueue/null": "0.10.x-dev",
"queue-interop/queue-spec": "^0.6"
Expand Down
4 changes: 3 additions & 1 deletion pkg/amqp-ext/Tests/AmqpConnectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
use Enqueue\AmqpExt\AmqpContext;
use Enqueue\AmqpTools\RabbitMqDlxDelayStrategy;
use Enqueue\Test\ClassExtensionTrait;
use Enqueue\Test\ReadAttributeTrait;
use Interop\Queue\ConnectionFactory;
use PHPUnit\Framework\TestCase;

class AmqpConnectionFactoryTest extends TestCase
{
use ClassExtensionTrait;
use ReadAttributeTrait;

public function testShouldImplementConnectionFactoryInterface()
{
Expand All @@ -34,6 +36,6 @@ public function testShouldCreateLazyContext()
$this->assertInstanceOf(AmqpContext::class, $context);

$this->assertAttributeEquals(null, 'extChannel', $context);
$this->assertInternalType('callable', $this->readAttribute($context, 'extChannelFactory'));
self::assertIsCallable($this->readAttribute($context, 'extChannelFactory'));
}
}
2 changes: 2 additions & 0 deletions pkg/amqp-ext/Tests/AmqpContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Enqueue\Null\NullQueue;
use Enqueue\Null\NullTopic;
use Enqueue\Test\ClassExtensionTrait;
use Enqueue\Test\ReadAttributeTrait;
use Interop\Amqp\Impl\AmqpMessage;
use Interop\Amqp\Impl\AmqpQueue;
use Interop\Amqp\Impl\AmqpTopic;
Expand All @@ -20,6 +21,7 @@
class AmqpContextTest extends TestCase
{
use ClassExtensionTrait;
use ReadAttributeTrait;

public function testShouldImplementQueueInteropContextInterface()
{
Expand Down
12 changes: 6 additions & 6 deletions pkg/amqp-ext/Tests/Functional/AmqpCommonUseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
*/
class AmqpCommonUseCasesTest extends TestCase
{
use RabbitmqAmqpExtension;
use RabbitManagementExtensionTrait;
use RabbitmqAmqpExtension;

/**
* @var AmqpContext
*/
private $amqpContext;

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

$this->removeQueue('amqp_ext.test');
$this->removeExchange('amqp_ext.test_exchange');
}

public function tearDown(): void
protected function tearDown(): void
{
$this->amqpContext->close();
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public function testProduceAndReceiveOneMessageSentDirectlyToTemporaryQueue()
public function testProduceAndReceiveOneMessageSentDirectlyToTopic()
{
$topic = $this->amqpContext->createTopic('amqp_ext.test_exchange');
$topic->setType(AMQP_EX_TYPE_FANOUT);
$topic->setType(\AMQP_EX_TYPE_FANOUT);
$this->amqpContext->declareTopic($topic);

$queue = $this->amqpContext->createQueue('amqp_ext.test');
Expand All @@ -153,7 +153,7 @@ public function testProduceAndReceiveOneMessageSentDirectlyToTopic()
public function testConsumerReceiveMessageFromTopicDirectly()
{
$topic = $this->amqpContext->createTopic('amqp_ext.test_exchange');
$topic->setType(AMQP_EX_TYPE_FANOUT);
$topic->setType(\AMQP_EX_TYPE_FANOUT);

$this->amqpContext->declareTopic($topic);

Expand All @@ -176,7 +176,7 @@ public function testConsumerReceiveMessageFromTopicDirectly()
public function testConsumerReceiveMessageWithZeroTimeout()
{
$topic = $this->amqpContext->createTopic('amqp_ext.test_exchange');
$topic->setType(AMQP_EX_TYPE_FANOUT);
$topic->setType(\AMQP_EX_TYPE_FANOUT);

$this->amqpContext->declareTopic($topic);

Expand Down
6 changes: 3 additions & 3 deletions pkg/amqp-ext/Tests/Functional/AmqpConsumptionUseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
*/
class AmqpConsumptionUseCasesTest extends TestCase
{
use RabbitmqAmqpExtension;
use RabbitManagementExtensionTrait;
use RabbitmqAmqpExtension;

/**
* @var AmqpContext
*/
private $amqpContext;

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

$this->removeQueue('amqp_ext.test');
}

public function tearDown(): void
protected function tearDown(): void
{
$this->amqpContext->close();
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/amqp-ext/Tests/Functional/AmqpRpcUseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
*/
class AmqpRpcUseCasesTest extends TestCase
{
use RabbitmqAmqpExtension;
use RabbitManagementExtensionTrait;
use RabbitmqAmqpExtension;

/**
* @var AmqpContext
*/
private $amqpContext;

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

$this->removeQueue('rpc.test');
$this->removeQueue('rpc.reply_test');
}

public function tearDown(): void
protected function tearDown(): void
{
$this->amqpContext->close();
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/amqp-ext/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.1.3",
"php": "^7.3",
"ext-amqp": "^1.9.3",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"enqueue/amqp-tools": "^0.10"
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"phpunit/phpunit": "^9.5",
"enqueue/test": "0.10.x-dev",
"enqueue/null": "0.10.x-dev",
"queue-interop/queue-spec": "^0.6",
Expand Down
2 changes: 2 additions & 0 deletions pkg/amqp-lib/Tests/AmqpConnectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
use Enqueue\AmqpLib\AmqpConnectionFactory;
use Enqueue\AmqpTools\RabbitMqDlxDelayStrategy;
use Enqueue\Test\ClassExtensionTrait;
use Enqueue\Test\ReadAttributeTrait;
use Interop\Queue\ConnectionFactory;
use PHPUnit\Framework\TestCase;

class AmqpConnectionFactoryTest extends TestCase
{
use ClassExtensionTrait;
use ReadAttributeTrait;

public function testShouldImplementConnectionFactoryInterface()
{
Expand Down
4 changes: 2 additions & 2 deletions pkg/amqp-lib/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.1.3",
"php": "^7.3",
"php-amqplib/php-amqplib": "^2.10",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"enqueue/amqp-tools": "^0.10"
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"phpunit/phpunit": "^9.5",
"enqueue/test": "0.10.x-dev",
"enqueue/null": "0.10.x-dev",
"queue-interop/queue-spec": "^0.6"
Expand Down
Loading