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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Sun, 28 May 2023 14:11:23 +0200
Subject: Adapt to recent version of PHPUnit (10)
---
tests/Functional/Channel/ChannelTimeoutTest.php | 4 ++--
tests/Functional/Connection/Heartbeat/PCNTLHeartbeatSenderTest.php | 4 ++--
tests/Functional/Connection/Heartbeat/SIGHeartbeatSenderTest.php | 2 +-
tests/Unit/Connection/LibraryPropertiesTest.php | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/Functional/Channel/ChannelTimeoutTest.php b/tests/Functional/Channel/ChannelTimeoutTest.php
index 55bbc72..1c991d1 100644
--- a/tests/Functional/Channel/ChannelTimeoutTest.php
+++ b/tests/Functional/Channel/ChannelTimeoutTest.php
@@ -41,7 +41,7 @@ class ChannelTimeoutTest extends TestCaseCompat
$this->io = $this->getMockBuilder(StreamIO::class)
->setConstructorArgs(array(HOST, PORT, 3, 3, null, false, 0))
- ->setMethods(array('select'))
+ ->onlyMethods(array('select'))
->getMock();
$this->io
->expects(self::atLeastOnce())
@@ -51,7 +51,7 @@ class ChannelTimeoutTest extends TestCaseCompat
});
$this->connection = $this->getMockBuilder(AbstractConnection::class)
->setConstructorArgs(array(USER, PASS, '/', false, 'AMQPLAIN', null, 'en_US', $this->io, 0, 0, $channel_rpc_timeout))
- ->setMethods(array())
+ ->onlyMethods(array())
->getMockForAbstractClass();
$this->channel = $this->connection->channel();
diff --git a/tests/Functional/Connection/Heartbeat/PCNTLHeartbeatSenderTest.php b/tests/Functional/Connection/Heartbeat/PCNTLHeartbeatSenderTest.php
index 75ccbfa..3b3d72c 100644
--- a/tests/Functional/Connection/Heartbeat/PCNTLHeartbeatSenderTest.php
+++ b/tests/Functional/Connection/Heartbeat/PCNTLHeartbeatSenderTest.php
@@ -97,7 +97,7 @@ class PCNTLHeartbeatSenderTest extends AbstractConnectionTest
public function alarm_sig_should_be_registered_when_conn_is_writing()
{
$connection = $this->getMockBuilder(AbstractConnection::class)
- ->setMethods(['isConnected', 'getHeartbeat', 'isWriting', 'getLastActivity'])
+ ->onlyMethods(['isConnected', 'getHeartbeat', 'isWriting', 'getLastActivity'])
->disableOriginalConstructor()
->getMockForAbstractClass();
@@ -128,7 +128,7 @@ class PCNTLHeartbeatSenderTest extends AbstractConnectionTest
public function signal_handler_should_ignore_inactive_lazy_connections()
{
$connection = $this->getMockBuilder(AbstractConnection::class)
- ->setMethods(['isConnected', 'getHeartbeat', 'isWriting', 'getLastActivity', 'checkHeartBeat'])
+ ->onlyMethods(['isConnected', 'getHeartbeat', 'isWriting', 'getLastActivity', 'checkHeartBeat'])
->disableOriginalConstructor()
->getMockForAbstractClass();
$connection
diff --git a/tests/Functional/Connection/Heartbeat/SIGHeartbeatSenderTest.php b/tests/Functional/Connection/Heartbeat/SIGHeartbeatSenderTest.php
index 63cbc49..86e3487 100644
--- a/tests/Functional/Connection/Heartbeat/SIGHeartbeatSenderTest.php
+++ b/tests/Functional/Connection/Heartbeat/SIGHeartbeatSenderTest.php
@@ -98,7 +98,7 @@ class SIGHeartbeatSenderTest extends AbstractConnectionTest
public function alarm_sig_should_be_registered_when_conn_is_writing()
{
$connection = $this->getMockBuilder(AbstractConnection::class)
- ->setMethods(['isConnected', 'getHeartbeat', 'isWriting', 'getLastActivity'])
+ ->onlyMethods(['isConnected', 'getHeartbeat', 'isWriting', 'getLastActivity'])
->disableOriginalConstructor()
->getMockForAbstractClass();
diff --git a/tests/Unit/Connection/LibraryPropertiesTest.php b/tests/Unit/Connection/LibraryPropertiesTest.php
index d9a9877..ebb015a 100644
--- a/tests/Unit/Connection/LibraryPropertiesTest.php
+++ b/tests/Unit/Connection/LibraryPropertiesTest.php
@@ -25,7 +25,7 @@ class LibraryPropertiesTest extends TestCaseCompat
public function requiredProperties()
{
$connection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
- ->setMethods(null)
+ ->onlyMethods([])
->disableOriginalConstructor()
->getMock();
@@ -51,7 +51,7 @@ class LibraryPropertiesTest extends TestCaseCompat
public function propertyTypes()
{
$connection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
- ->setMethods(null)
+ ->onlyMethods([])
->disableOriginalConstructor()
->getMock();
|