diff --git a/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php b/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php index c20f13a3..a370cda0 100644 --- a/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php +++ b/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php @@ -60,7 +60,7 @@ public function testGetPayloadDictionaryReturnsCompletePayloadWithoutLocKey(): v 'name' => 'value' ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } @@ -109,7 +109,7 @@ public function testGetPayloadDictionaryReturnsCompletePayloadWithoutBody(): voi 'name' => 'value' ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } @@ -123,7 +123,7 @@ public function testGetPayloadDictionaryReturnsEmptyPayload(): void { $payload = [ 'aps' => [ 'alert' => [] ] ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } diff --git a/ApnsPHP/Message/Tests/CustomMessageTest.php b/ApnsPHP/Message/Tests/CustomMessageTest.php index bcbe8485..66643003 100644 --- a/ApnsPHP/Message/Tests/CustomMessageTest.php +++ b/ApnsPHP/Message/Tests/CustomMessageTest.php @@ -22,13 +22,19 @@ */ abstract class CustomMessageTest extends LunrBaseTest { + /** + * Class to test + * @var CustomMessage + */ + protected CustomMessage $class; + /** * TestCase constructor */ public function setUp(): void { - $this->reflection = new ReflectionClass('ApnsPHP\Message\CustomMessage'); $this->class = new CustomMessage(); + $this->baseSetUp($this->class); } /** @@ -37,6 +43,6 @@ public function setUp(): void public function tearDown(): void { unset($this->class); - unset($this->reflection); + parent::tearDown(); } } diff --git a/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php b/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php index 424deb0b..371245cb 100644 --- a/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php +++ b/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php @@ -40,7 +40,7 @@ public function testGetPayloadDictionaryReturnsCompletePayload(): void ] ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } @@ -54,7 +54,7 @@ public function testGetPayloadDictionaryReturnsEmptyPayload(): void { $payload = [ 'aps' => [ 'alert' => [] ] ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } diff --git a/ApnsPHP/Message/Tests/SafariMessageTest.php b/ApnsPHP/Message/Tests/SafariMessageTest.php index 7c5f7e8c..4449c289 100644 --- a/ApnsPHP/Message/Tests/SafariMessageTest.php +++ b/ApnsPHP/Message/Tests/SafariMessageTest.php @@ -22,13 +22,19 @@ */ abstract class SafariMessageTest extends LunrBaseTest { + /** + * Class to test + * @var SafariMessage + */ + protected SafariMessage $class; + /** * TestCase constructor */ public function setUp(): void { - $this->reflection = new ReflectionClass('ApnsPHP\Message\SafariMessage'); $this->class = new SafariMessage(); + $this->baseSetUp($this->class); } /** @@ -37,6 +43,6 @@ public function setUp(): void public function tearDown(): void { unset($this->class); - unset($this->reflection); + parent::tearDown(); } } diff --git a/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php b/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php index c73f8cf4..1a489a0b 100644 --- a/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php +++ b/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php @@ -52,7 +52,7 @@ public function testGetPayloadDictionaryReturnsCompletePayload(): void 'name' => 'value' ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } @@ -88,7 +88,7 @@ public function testGetPayloadDictionaryWithoutTitle(): void 'name' => 'value' ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } @@ -102,7 +102,7 @@ public function testGetPayloadDictionaryReturnsEmptyPayload(): void { $payload = [ 'aps' => [] ]; - $result = $this->get_accessible_reflection_method('getPayloadDictionary')->invoke($this->class); + $result = $this->get_reflection_method('getPayloadDictionary')->invoke($this->class); $this->assertEquals($payload, $result); } diff --git a/ApnsPHP/Tests/MessageTest.php b/ApnsPHP/Tests/MessageTest.php index 6798b011..6bbd1d88 100644 --- a/ApnsPHP/Tests/MessageTest.php +++ b/ApnsPHP/Tests/MessageTest.php @@ -23,13 +23,19 @@ */ abstract class MessageTest extends LunrBaseTest { + /** + * Class to test + * @var Message + */ + protected Message $class; + /** * TestCase constructor */ public function setUp(): void { - $this->reflection = new ReflectionClass('ApnsPHP\Message'); - $this->class = new Message(); + $this->class = new Message(); + $this->baseSetUp($this->class); } /** @@ -38,6 +44,6 @@ public function setUp(): void public function tearDown(): void { unset($this->class); - unset($this->reflection); + parent::tearDown(); } } diff --git a/ApnsPHP/Tests/PushAddTest.php b/ApnsPHP/Tests/PushAddTest.php index 0c3cb6f9..3a47e4a9 100644 --- a/ApnsPHP/Tests/PushAddTest.php +++ b/ApnsPHP/Tests/PushAddTest.php @@ -39,7 +39,7 @@ public function testAddOneMessage(): void $this->class->add($this->message); - $queue = $this->get_accessible_reflection_property('messageQueue')->getValue($this->class); + $queue = $this->get_reflection_property('messageQueue')->getValue($this->class); $this->assertEquals($this->message, $queue[1]['MESSAGE']); } @@ -73,7 +73,7 @@ public function testAddMultipleMessages(): void $this->class->add($this->message); - $queue = $this->get_accessible_reflection_property('messageQueue')->getValue($this->class); + $queue = $this->get_reflection_property('messageQueue')->getValue($this->class); $this->assertEquals($messages, $queue); } @@ -95,7 +95,7 @@ public function testAddDoesNothing(): void $this->class->add($this->message); - $queue = $this->get_accessible_reflection_property('messageQueue')->getValue($this->class); + $queue = $this->get_reflection_property('messageQueue')->getValue($this->class); $this->assertArrayEmpty($queue); } diff --git a/ApnsPHP/Tests/PushConnectTest.php b/ApnsPHP/Tests/PushConnectTest.php index 0645e974..355195a8 100644 --- a/ApnsPHP/Tests/PushConnectTest.php +++ b/ApnsPHP/Tests/PushConnectTest.php @@ -30,9 +30,7 @@ public function testConnectSuccess(): void { $this->set_reflection_property_value('logger', $this->logger); - $this->mock_function('curl_setopt_array', function () { - return true; - }); + $this->mock_function('curl_setopt_array', fn() => true); $this->logger->expects($this->exactly(3)) ->method('info') @@ -57,9 +55,7 @@ public function testConnectThrowsExceptionOnHttpInitFail(): void $this->set_reflection_property_value('connectRetryInterval', 0); $this->set_reflection_property_value('logger', $this->logger); - $this->mock_function('curl_setopt_array', function () { - return false; - }); + $this->mock_function('curl_setopt_array', fn() => false); $message = [ ]; diff --git a/ApnsPHP/Tests/PushHttpInitTest.php b/ApnsPHP/Tests/PushHttpInitTest.php index 9f87043c..92c424d2 100644 --- a/ApnsPHP/Tests/PushHttpInitTest.php +++ b/ApnsPHP/Tests/PushHttpInitTest.php @@ -42,7 +42,7 @@ public function testHttpInitSucceedsWithCertificate(): void ->method('info') ->withConsecutive(...$message); - $method = $this->get_accessible_reflection_method('httpInit'); + $method = $this->get_reflection_method('httpInit'); $result = $method->invoke($this->class); $this->assertTrue($result); @@ -73,19 +73,9 @@ public function testHttpInitSucceedsWithKey(): void new Signature('signature', 'eSignature'), ); - $this->mock_method( - [ 'Lcobucci\JWT\Signer\Key\InMemory', 'file' ], - function () use ($key) { - return $key; - } - ); + $this->mock_method([ 'Lcobucci\JWT\Signer\Key\InMemory', 'file' ], fn() => $key); - $this->mock_method( - [ 'Lcobucci\JWT\Configuration', 'builder' ], - function () use ($builder) { - return $builder; - } - ); + $this->mock_method([ 'Lcobucci\JWT\Configuration', 'builder' ], fn() => $builder); $builder->expects($this->once()) ->method('issuedBy') @@ -115,7 +105,7 @@ function () use ($builder) { [ 'Initialized HTTP/2 backend.' ] ); - $method = $this->get_accessible_reflection_method('httpInit'); + $method = $this->get_reflection_method('httpInit'); $result = $method->invoke($this->class); $this->assertTrue($result); @@ -136,9 +126,7 @@ public function testHttpInitThrowsExceptionOnCurlSetoptFail(): void $this->set_reflection_property_value('providerKeyId', 'TheKey'); $this->set_reflection_property_value('logger', $this->logger); - $this->mock_function('curl_setopt_array', function () { - return false; - }); + $this->mock_function('curl_setopt_array', fn() => false); $key = $this->getMockBuilder('Lcobucci\JWT\Signer\Key') ->disableOriginalConstructor() @@ -153,19 +141,9 @@ public function testHttpInitThrowsExceptionOnCurlSetoptFail(): void new Signature('signature', 'eSignature'), ); - $this->mock_method( - [ 'Lcobucci\JWT\Signer\Key\InMemory', 'file' ], - function () use ($key) { - return $key; - } - ); + $this->mock_method([ 'Lcobucci\JWT\Signer\Key\InMemory', 'file' ], fn() => $key); - $this->mock_method( - [ 'Lcobucci\JWT\Configuration', 'builder' ], - function () use ($builder) { - return $builder; - } - ); + $this->mock_method([ 'Lcobucci\JWT\Configuration', 'builder' ], fn() => $builder); $builder->expects($this->once()) ->method('issuedBy') @@ -197,7 +175,7 @@ function () use ($builder) { $this->expectException('ApnsPHP\Exception'); $this->expectExceptionMessage('Unable to initialize HTTP/2 backend.'); - $method = $this->get_accessible_reflection_method('httpInit'); + $method = $this->get_reflection_method('httpInit'); # phpstan doesn't detect the potential throw through ReflectionMethod. # Verified that by making the method public and calling it directly diff --git a/ApnsPHP/Tests/PushHttpSendTest.php b/ApnsPHP/Tests/PushHttpSendTest.php index fb406dd6..a595bcc5 100644 --- a/ApnsPHP/Tests/PushHttpSendTest.php +++ b/ApnsPHP/Tests/PushHttpSendTest.php @@ -61,9 +61,7 @@ private function setHttpHeaders(): void */ public function testHttpSendReturnsFalseOnCurlSessionFail(): void { - $this->mock_function('curl_exec', function () { - return false; - }); + $this->mock_function('curl_exec', fn() => false); $this->set_reflection_property_value('environment', Environment::Sandbox); $this->set_reflection_property_value('hSocket', curl_init()); @@ -80,7 +78,7 @@ public function testHttpSendReturnsFalseOnCurlSessionFail(): void $reply = 'reply'; - $method = $this->get_accessible_reflection_method('httpSend'); + $method = $this->get_reflection_method('httpSend'); $result = $method->invokeArgs($this->class, [ $this->message, &$reply ]); $this->assertFalse($result); @@ -95,21 +93,11 @@ public function testHttpSendReturnsFalseOnCurlSessionFail(): void */ public function testHttpSendReturnsFalseOnCurlOptsCannotBeSet(): void { - $this->mock_function('curl_setopt_array', function () { - return false; - }); - - $this->mock_function('curl_exec', function () { - return ''; - }); - - $this->mock_function('curl_errno', function () { - return 56; - }); - - $this->mock_function('curl_error', function () { - return 'OpenSSL SSL_read: error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired'; - }); + $this->mock_function('curl_setopt_array', fn() => false); + $this->mock_function('curl_exec', fn() => ''); + $this->mock_function('curl_errno', fn() => 56); + $error = 'OpenSSL SSL_read: error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired'; + $this->mock_function('curl_error', fn() => $error); $this->set_reflection_property_value('environment', Environment::Sandbox); @@ -125,7 +113,7 @@ public function testHttpSendReturnsFalseOnCurlOptsCannotBeSet(): void $reply = 'reply'; - $method = $this->get_accessible_reflection_method('httpSend'); + $method = $this->get_reflection_method('httpSend'); $result = $method->invokeArgs($this->class, [ $this->message, &$reply ]); $this->assertFalse($result); @@ -141,17 +129,9 @@ public function testHttpSendReturnsFalseOnCurlOptsCannotBeSet(): void */ public function testHttpSendReturnsFalseOnRequestFail(): void { - $this->mock_function('curl_setopt_array', function () { - return true; - }); - - $this->mock_function('curl_exec', function () { - return ''; - }); - - $this->mock_function('curl_getinfo', function () { - return 500; - }); + $this->mock_function('curl_setopt_array', fn() => true); + $this->mock_function('curl_exec', fn() => ''); + $this->mock_function('curl_getinfo', fn() => 500); $this->set_reflection_property_value('environment', Environment::Sandbox); @@ -167,7 +147,7 @@ public function testHttpSendReturnsFalseOnRequestFail(): void $reply = 'reply'; - $method = $this->get_accessible_reflection_method('httpSend'); + $method = $this->get_reflection_method('httpSend'); $result = $method->invokeArgs($this->class, [ $this->message, &$reply ]); $this->assertFalse($result); @@ -184,17 +164,9 @@ public function testHttpSendReturnsFalseOnRequestFail(): void */ public function testHttpSendReturnsTrueOnSuccess(): void { - $this->mock_function('curl_setopt_array', function () { - return true; - }); - - $this->mock_function('curl_exec', function () { - return ''; - }); - - $this->mock_function('curl_getinfo', function () { - return 200; - }); + $this->mock_function('curl_setopt_array', fn() => true); + $this->mock_function('curl_exec', fn() => ''); + $this->mock_function('curl_getinfo', fn() => 200); $this->set_reflection_property_value('environment', Environment::Sandbox); @@ -210,7 +182,7 @@ public function testHttpSendReturnsTrueOnSuccess(): void $reply = 'reply'; - $method = $this->get_accessible_reflection_method('httpSend'); + $method = $this->get_reflection_method('httpSend'); $result = $method->invokeArgs($this->class, [ $this->message, &$reply ]); $this->assertTrue($result); diff --git a/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php b/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php index e91e7a62..43d7cd7a 100644 --- a/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php +++ b/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php @@ -27,7 +27,7 @@ public function testRemoveMessageFromQueueThrowsExceptionOnInvalidMessageID(): v $this->expectException('ApnsPHP\Push\Exception'); $this->expectExceptionMessage('Message ID format is not valid.'); - $method = $this->get_accessible_reflection_method('removeMessageFromQueue'); + $method = $this->get_reflection_method('removeMessageFromQueue'); $method->invokeArgs($this->class, [ 0 ]); } @@ -41,7 +41,7 @@ public function testRemoveMessageFromQueueThrowsExceptionOnMissingMessageID(): v $this->expectException('ApnsPHP\Push\Exception'); $this->expectExceptionMessage('The Message ID 1 does not exists.'); - $method = $this->get_accessible_reflection_method('removeMessageFromQueue'); + $method = $this->get_reflection_method('removeMessageFromQueue'); $method->invokeArgs($this->class, [ 1 ]); } @@ -59,11 +59,11 @@ public function testRemoveMessageFromQueueRemovesMessageFromQueue(): void $this->set_reflection_property_value('messageQueue', $queue); - $method = $this->get_accessible_reflection_method('removeMessageFromQueue'); + $method = $this->get_reflection_method('removeMessageFromQueue'); $method->invokeArgs($this->class, [ 1 ]); - $errors = $this->get_accessible_reflection_property('errors')->getValue($this->class); - $messageQueue = $this->get_accessible_reflection_property('messageQueue')->getValue($this->class); + $errors = $this->get_reflection_property('errors')->getValue($this->class); + $messageQueue = $this->get_reflection_property('messageQueue')->getValue($this->class); $this->assertArrayEmpty($errors); $this->assertEquals([ 2 => $queue[2] ], $messageQueue); @@ -83,11 +83,11 @@ public function testRemoveMessageFromQueueRemovesMessageFromQueueAndAddsError(): $this->set_reflection_property_value('messageQueue', $queue); - $method = $this->get_accessible_reflection_method('removeMessageFromQueue'); + $method = $this->get_reflection_method('removeMessageFromQueue'); $method->invokeArgs($this->class, [ 1, true ]); - $errors = $this->get_accessible_reflection_property('errors')->getValue($this->class); - $messageQueue = $this->get_accessible_reflection_property('messageQueue')->getValue($this->class); + $errors = $this->get_reflection_property('errors')->getValue($this->class); + $messageQueue = $this->get_reflection_property('messageQueue')->getValue($this->class); $this->assertEquals([ 1 => $queue[1] ], $errors); $this->assertEquals([ 2 => $queue[2] ], $messageQueue); diff --git a/ApnsPHP/Tests/PushSendTest.php b/ApnsPHP/Tests/PushSendTest.php index a4442ae9..79dbf86a 100644 --- a/ApnsPHP/Tests/PushSendTest.php +++ b/ApnsPHP/Tests/PushSendTest.php @@ -55,24 +55,12 @@ public function testSendThrowsExceptionOnEmptyQueue(): void */ public function testSendFailsWithoutRetrying(): void { - $this->mock_function('curl_exec', function () { - return false; - }); - $this->mock_function('curl_setopt_array', function () { - return true; - }); - $this->mock_function('curl_getinfo', function () { - return 404; - }); - $this->mock_function('curl_close', function () { - return null; - }); - $this->mock_function('curl_errno', function () { - return 0; - }); - $this->mock_function('curl_error', function () { - return ''; - }); + $this->mock_function('curl_exec', fn() => false); + $this->mock_function('curl_setopt_array', fn() => true); + $this->mock_function('curl_getinfo', fn() => 404); + $this->mock_function('curl_close', fn() => null); + $this->mock_function('curl_errno', fn() => 0); + $this->mock_function('curl_error', fn() => ''); $error = [ 'command' => 8, @@ -124,18 +112,10 @@ public function testSendFailsWithoutRetrying(): void */ public function testSendFailsWithRetrying(): void { - $this->mock_function('curl_exec', function () { - return false; - }); - $this->mock_function('curl_setopt_array', function () { - return true; - }); - $this->mock_function('curl_getinfo', function () { - return 429; - }); - $this->mock_function('curl_close', function () { - return null; - }); + $this->mock_function('curl_exec', fn() => false); + $this->mock_function('curl_setopt_array', fn() => true); + $this->mock_function('curl_getinfo', fn() => 429); + $this->mock_function('curl_close', fn() => null); $message = [ 1 => [ 'MESSAGE' => $this->message, 'ERRORS' => [] ] ]; @@ -193,24 +173,12 @@ public function testSendFailsWithRetrying(): void */ public function testSendRemovesWhenNoError(): void { - $this->mock_function('curl_exec', function () { - return false; - }); - $this->mock_function('curl_setopt_array', function () { - return true; - }); - $this->mock_function('curl_getinfo', function () { - return 200; - }); - $this->mock_function('curl_close', function () { - return null; - }); - $this->mock_function('curl_errno', function () { - return 0; - }); - $this->mock_function('curl_error', function () { - return ''; - }); + $this->mock_function('curl_exec', fn() => false); + $this->mock_function('curl_setopt_array', fn() => true); + $this->mock_function('curl_getinfo', fn() => 200); + $this->mock_function('curl_close', fn() => null); + $this->mock_function('curl_errno', fn() => 0); + $this->mock_function('curl_error', fn() => ''); $message = [ 1 => [ 'MESSAGE' => $this->message, 'ERRORS' => [] ] ]; @@ -255,18 +223,10 @@ public function testSendRemovesWhenNoError(): void */ public function testSendSuccessfullySends(): void { - $this->mock_function('curl_exec', function () { - return ''; - }); - $this->mock_function('curl_setopt_array', function () { - return true; - }); - $this->mock_function('curl_getinfo', function () { - return 200; - }); - $this->mock_function('curl_close', function () { - return null; - }); + $this->mock_function('curl_exec', fn() => ''); + $this->mock_function('curl_setopt_array', fn() => true); + $this->mock_function('curl_getinfo', fn() => 200); + $this->mock_function('curl_close', fn() => null); $message = [ 1 => [ 'MESSAGE' => $this->message, 'ERRORS' => [] ] ]; diff --git a/ApnsPHP/Tests/PushTest.php b/ApnsPHP/Tests/PushTest.php index a371cce3..e941a9fc 100644 --- a/ApnsPHP/Tests/PushTest.php +++ b/ApnsPHP/Tests/PushTest.php @@ -30,13 +30,19 @@ abstract class PushTest extends LunrBaseTest * Mock instance of a Logger class. * @var LoggerInterface&MockObject */ - protected $logger; + protected LoggerInterface&MockObject $logger; /** * Mock instance of the Message class. * @var Message&MockObject */ - protected $message; + protected Message&MockObject $message; + + /** + * Class to test + * @var Push + */ + protected Push $class; /** * TestCase constructor @@ -55,7 +61,7 @@ public function setUp(): void $this->logger, ); - $this->reflection = new ReflectionClass('ApnsPHP\Push'); + $this->baseSetUp($this->class); } /** @@ -64,8 +70,8 @@ public function setUp(): void public function tearDown(): void { unset($this->class); - unset($this->reflection); unset($this->logger); unset($this->message); + parent::tearDown(); } } diff --git a/ApnsPHP/Tests/PushUpdateQueueTest.php b/ApnsPHP/Tests/PushUpdateQueueTest.php index a4b8d6e2..057da0ba 100644 --- a/ApnsPHP/Tests/PushUpdateQueueTest.php +++ b/ApnsPHP/Tests/PushUpdateQueueTest.php @@ -24,7 +24,7 @@ class PushUpdateQueueTest extends PushTest */ public function testUpdateQueueReturnsFalse(): void { - $method = $this->get_accessible_reflection_method('updateQueue'); + $method = $this->get_reflection_method('updateQueue'); $result = $method->invoke($this->class); $this->assertFalse($result); @@ -70,7 +70,7 @@ public function testUpdateQueueSucceedsWithErrorMessageParameter(): void ->method('error') ->with('Unable to send message ID 3: Missing payload (4).'); - $method = $this->get_accessible_reflection_method('updateQueue'); + $method = $this->get_reflection_method('updateQueue'); $result = $method->invokeArgs($this->class, [ $errorMessage ]); $messageQueue = $this->get_reflection_property_value('messageQueue'); @@ -117,10 +117,10 @@ public function testUpdateQueueDoesNotDeleteUnsentMessages(): void ->method('error') ->with('Unable to send message ID 2: Missing payload (4).'); - $method = $this->get_accessible_reflection_method('updateQueue'); + $method = $this->get_reflection_method('updateQueue'); $result = $method->invoke($this->class, $errorMessage); - $messageQueue = $this->get_accessible_reflection_property('messageQueue')->getValue($this->class); + $messageQueue = $this->get_reflection_property('messageQueue')->getValue($this->class); $this->assertTrue($result); $this->assertEquals([ 3 => $queue[3], 4 => $queue[4] ], $messageQueue); diff --git a/composer.json b/composer.json index c341caf6..20a56f3f 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "phpunit/phpunit": ">=9.0 <9.6", - "lunr/halo": "~0.8.0" + "lunr/halo": "~0.10.0" }, "config": { "optimize-autoloader": true