1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sun, 19 May 2024 13:21:25 +0200
Subject: Make provider functions static (PHPUnit 11 Fix)
Bug-Debian: https://bugs.debian.org/1070584
---
tests/Pheanstalk/ConnectionTest.php | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/tests/Pheanstalk/ConnectionTest.php b/tests/Pheanstalk/ConnectionTest.php
index ea115b9..171c79f 100644
--- a/tests/Pheanstalk/ConnectionTest.php
+++ b/tests/Pheanstalk/ConnectionTest.php
@@ -7,6 +7,8 @@ use Pheanstalk\Contract\SocketFactoryInterface;
use Pheanstalk\Contract\SocketInterface;
use Pheanstalk\Exception\ConnectionException;
use Pheanstalk\Exception\SocketException;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
@@ -39,9 +41,8 @@ class ConnectionTest extends TestCase
return $this->connectionProvider($test, SERVER_HOST . 'abc', SERVER_PORT);
}
- /**
- * @dataProvider badPortConnectionProvider
- */
+ #[DataProvider('badPortConnectionProvider')]
+ #[RequiresPhpunit('< 11')]
public function testConnectionFailsToIncorrectPort(Connection $connection)
{
$this->expectException(ConnectionException::class);
@@ -50,9 +51,8 @@ class ConnectionTest extends TestCase
}
- /**
- * @dataProvider badHostConnectionProvider
- */
+ #[DataProvider('badHostConnectionProvider')]
+ #[RequiresPhpunit('< 11')]
public function testConnectionFailsToIncorrectHost(Connection $connection)
{
$this->expectException(ConnectionException::class);
@@ -62,8 +62,9 @@ class ConnectionTest extends TestCase
/**
* @throws Exception\ClientException
- * @dataProvider connectionProvider
*/
+ #[DataProvider('connectionProvider')]
+ #[RequiresPhpunit('< 11')]
public function testDispatchCommandSuccessful(Connection $connection)
{
$command = new Command\UseCommand('test');
@@ -72,9 +73,8 @@ class ConnectionTest extends TestCase
$this->assertInstanceOf(Contract\ResponseInterface::class, $response);
}
- /**
- * @dataProvider connectionProvider
- */
+ #[DataProvider('connectionProvider')]
+ #[RequiresPhpunit('< 11')]
public function testDisconnect(Connection $connection)
{
$pheanstalk = new Pheanstalk(new Connection(new SocketFactory(SERVER_HOST, SERVER_PORT)));
|