diff --git a/.github/workflows/php-tests.yml b/.github/workflows/php-tests.yml index 2df0930..2716862 100644 --- a/.github/workflows/php-tests.yml +++ b/.github/workflows/php-tests.yml @@ -34,8 +34,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: uopz - tools: phpunit:9.5.x + extensions: uopz,mbstring - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -54,7 +53,7 @@ jobs: chmod 000 server_certificates_bundle_unreadable.pem - name: Run PHPUnit - run: phpunit -c phpunit.xml + run: ./vendor/bin/phpunit -c phpunit.xml sample_push: runs-on: ubuntu-latest diff --git a/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php b/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php index a370cda..935bb5c 100644 --- a/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php +++ b/ApnsPHP/Message/Tests/CustomMessageGetPayloadDictionaryTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Message\CustomMessage */ -class CustomMessageGetPayloadDictionaryTest extends CustomMessageTest +class CustomMessageGetPayloadDictionaryTest extends CustomMessageTestCase { /** * Test that getPayloadDictionary returns complete payload with body if locKey isn't set diff --git a/ApnsPHP/Message/Tests/CustomMessageGetTest.php b/ApnsPHP/Message/Tests/CustomMessageGetTest.php index 1dc1780..61120c6 100644 --- a/ApnsPHP/Message/Tests/CustomMessageGetTest.php +++ b/ApnsPHP/Message/Tests/CustomMessageGetTest.php @@ -14,7 +14,7 @@ * * @covers \ApnsPHP\Message\CustomMessage */ -class CustomMessageGetTest extends CustomMessageTest +class CustomMessageGetTest extends CustomMessageTestCase { /** * Test that getActionLocKey() gets the view button title. diff --git a/ApnsPHP/Message/Tests/CustomMessageTest.php b/ApnsPHP/Message/Tests/CustomMessageTestCase.php similarity index 94% rename from ApnsPHP/Message/Tests/CustomMessageTest.php rename to ApnsPHP/Message/Tests/CustomMessageTestCase.php index 6664300..9515892 100644 --- a/ApnsPHP/Message/Tests/CustomMessageTest.php +++ b/ApnsPHP/Message/Tests/CustomMessageTestCase.php @@ -20,7 +20,7 @@ * * @covers \ApnsPHP\Message\CustomMessage */ -abstract class CustomMessageTest extends LunrBaseTest +abstract class CustomMessageTestCase extends LunrBaseTest { /** * Class to test diff --git a/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php b/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php index 371245c..7c83124 100644 --- a/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php +++ b/ApnsPHP/Message/Tests/SafariMessageGetPayloadDictionaryTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Message\SafariMessage */ -class SafariMessageGetPayloadDictionaryTest extends SafariMessageTest +class SafariMessageGetPayloadDictionaryTest extends SafariMessageTestCase { /** * Test that getPayloadDictionary returns complete payload diff --git a/ApnsPHP/Message/Tests/SafariMessageGetTest.php b/ApnsPHP/Message/Tests/SafariMessageGetTest.php index 4c00d13..fafe449 100644 --- a/ApnsPHP/Message/Tests/SafariMessageGetTest.php +++ b/ApnsPHP/Message/Tests/SafariMessageGetTest.php @@ -14,7 +14,7 @@ * * @covers \ApnsPHP\Message\SafariMessage */ -class SafariMessageGetTest extends SafariMessageTest +class SafariMessageGetTest extends SafariMessageTestCase { /** * Test that getAction() gets the label of the action button. diff --git a/ApnsPHP/Message/Tests/SafariMessageTest.php b/ApnsPHP/Message/Tests/SafariMessageTestCase.php similarity index 94% rename from ApnsPHP/Message/Tests/SafariMessageTest.php rename to ApnsPHP/Message/Tests/SafariMessageTestCase.php index 4449c28..b84572f 100644 --- a/ApnsPHP/Message/Tests/SafariMessageTest.php +++ b/ApnsPHP/Message/Tests/SafariMessageTestCase.php @@ -20,7 +20,7 @@ * * @covers \ApnsPHP\Message\SafariMessage */ -abstract class SafariMessageTest extends LunrBaseTest +abstract class SafariMessageTestCase extends LunrBaseTest { /** * Class to test diff --git a/ApnsPHP/Tests/MessageAddRecipientTest.php b/ApnsPHP/Tests/MessageAddRecipientTest.php index 922502a..ab501b9 100644 --- a/ApnsPHP/Tests/MessageAddRecipientTest.php +++ b/ApnsPHP/Tests/MessageAddRecipientTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Message */ -class MessageAddRecipientTest extends MessageTest +class MessageAddRecipientTest extends MessageTestCase { /** * Test that addRecipient throws exception on invalid token diff --git a/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php b/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php index 1a489a0..c960983 100644 --- a/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php +++ b/ApnsPHP/Tests/MessageGetPayloadDictionaryTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Message */ -class MessageGetPayloadDictionaryTest extends MessageTest +class MessageGetPayloadDictionaryTest extends MessageTestCase { /** * Test that getPayloadDictionary returns complete payload diff --git a/ApnsPHP/Tests/MessageGetPayloadTest.php b/ApnsPHP/Tests/MessageGetPayloadTest.php index 1252ec4..82890b3 100644 --- a/ApnsPHP/Tests/MessageGetPayloadTest.php +++ b/ApnsPHP/Tests/MessageGetPayloadTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Message */ -class MessageGetPayloadTest extends MessageTest +class MessageGetPayloadTest extends MessageTestCase { /** * Test that getPayload() returns complete JSON encoded payload @@ -161,7 +161,7 @@ public function testCastToStringReturnsEmptyStringOnTooLongPayloadWithoutAutoAdj * * @return string String of certain size in bytes */ - private function getLargeString($size): string + private function getLargeString(int $size): string { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $length = strlen($characters); diff --git a/ApnsPHP/Tests/MessageGetTest.php b/ApnsPHP/Tests/MessageGetTest.php index 5a3f0fd..25abb1b 100644 --- a/ApnsPHP/Tests/MessageGetTest.php +++ b/ApnsPHP/Tests/MessageGetTest.php @@ -17,7 +17,7 @@ * * @covers \ApnsPHP\Message */ -class MessageGetTest extends MessageTest +class MessageGetTest extends MessageTestCase { /** * Test that getText() gets the message text. diff --git a/ApnsPHP/Tests/MessageSelfForRecipientTest.php b/ApnsPHP/Tests/MessageSelfForRecipientTest.php index 8c971d4..2dee0e3 100644 --- a/ApnsPHP/Tests/MessageSelfForRecipientTest.php +++ b/ApnsPHP/Tests/MessageSelfForRecipientTest.php @@ -17,14 +17,14 @@ * * @covers \ApnsPHP\Message */ -class MessageSelfForRecipientTest extends MessageTest +class MessageSelfForRecipientTest extends MessageTestCase { /** * Test that selfForRecipient throws exception on invalid index * * @covers \ApnsPHP\Message::selfForRecipient */ - public function testselfForRecipientThrowsExceptionOnInvalidIndex(): void + public function testSelfForRecipientThrowsExceptionOnInvalidIndex(): void { $this->expectException('ApnsPHP\Exception'); $this->expectExceptionMessage('No recipient at index \'1\''); @@ -37,7 +37,7 @@ public function testselfForRecipientThrowsExceptionOnInvalidIndex(): void * * @covers \ApnsPHP\Message::selfForRecipient */ - public function testselfForRecipientGetsMessage(): void + public function testSelfForRecipientGetsMessage(): void { $token = '1e82db91c7ceddd72bf33d74ae052ac9c84a065b35148ac401388843106a7485'; $message = new Message($token); diff --git a/ApnsPHP/Tests/MessageSetTest.php b/ApnsPHP/Tests/MessageSetTest.php index 61f7b19..12785b7 100644 --- a/ApnsPHP/Tests/MessageSetTest.php +++ b/ApnsPHP/Tests/MessageSetTest.php @@ -17,14 +17,14 @@ * * @covers \ApnsPHP\Message */ -class MessageSetTest extends MessageTest +class MessageSetTest extends MessageTestCase { /** * Unit test data provider for reserved apple namespace keys. * * @return array Variations of the reserved apple namespace key */ - public function reservedAppleNamespaceKeyProvider(): array + public static function reservedAppleNamespaceKeyProvider(): array { $data = []; $data[] = [ 'aps' ]; @@ -40,7 +40,7 @@ public function reservedAppleNamespaceKeyProvider(): array * * @return array Variations of valid custom identifiers */ - public function validCustomIdentifierProvider(): array + public static function validCustomIdentifierProvider(): array { $data = []; $data[] = [ '3491ac4b-0681-4c92-8308-d8d8441f4e64' ]; @@ -54,7 +54,7 @@ public function validCustomIdentifierProvider(): array * * @return array Variations of a valid message priority */ - public function validPriorityProvider(): array + public static function validPriorityProvider(): array { $data = []; $data[] = [ Priority::PrioritizePowerUsage ]; @@ -69,7 +69,7 @@ public function validPriorityProvider(): array * * @return array Variations of a valid push type */ - public function validPushTypeProvider(): array + public static function validPushTypeProvider(): array { $data = []; $data[] = [ PushType::Alert ]; diff --git a/ApnsPHP/Tests/MessageTest.php b/ApnsPHP/Tests/MessageTestCase.php similarity index 94% rename from ApnsPHP/Tests/MessageTest.php rename to ApnsPHP/Tests/MessageTestCase.php index 6bbd1d8..8f70045 100644 --- a/ApnsPHP/Tests/MessageTest.php +++ b/ApnsPHP/Tests/MessageTestCase.php @@ -21,7 +21,7 @@ * * @covers \ApnsPHP\Message */ -abstract class MessageTest extends LunrBaseTest +abstract class MessageTestCase extends LunrBaseTest { /** * Class to test diff --git a/ApnsPHP/Tests/PushAddTest.php b/ApnsPHP/Tests/PushAddTest.php index 3a47e4a..9970ab6 100644 --- a/ApnsPHP/Tests/PushAddTest.php +++ b/ApnsPHP/Tests/PushAddTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Push */ -class PushAddTest extends PushTest +class PushAddTest extends PushTestCase { /** * Test that add() successfully adds one message @@ -26,16 +26,16 @@ public function testAddOneMessage(): void { $this->message->expects($this->once()) ->method('getPayLoad') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $this->message->expects($this->once()) - ->method('getRecipientsNumber') - ->will($this->returnValue(1)); + ->method('getRecipientsCount') + ->willReturn(1); $this->message->expects($this->once()) ->method('selfForRecipient') ->with(0) - ->will($this->returnValue($this->message)); + ->willReturn($this->message); $this->class->add($this->message); @@ -60,16 +60,22 @@ public function testAddMultipleMessages(): void $this->message->expects($this->once()) ->method('getPayLoad') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $this->message->expects($this->once()) - ->method('getRecipientsNumber') - ->will($this->returnValue(4)); + ->method('getRecipientsCount') + ->willReturn(4); + + $map = [ + [ 0, $this->message ], + [ 1, $this->message ], + [ 2, $this->message ], + [ 3, $this->message ], + ]; $this->message->expects($this->exactly(4)) ->method('selfForRecipient') - ->withConsecutive([0], [1], [2], [3]) - ->will($this->returnValue($this->message)); + ->willReturnMap($map); $this->class->add($this->message); @@ -87,11 +93,11 @@ public function testAddDoesNothing(): void { $this->message->expects($this->once()) ->method('getPayLoad') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $this->message->expects($this->once()) - ->method('getRecipientsNumber') - ->will($this->returnValue(0)); + ->method('getRecipientsCount') + ->willReturn(0); $this->class->add($this->message); diff --git a/ApnsPHP/Tests/PushConnectTest.php b/ApnsPHP/Tests/PushConnectTest.php index 355195a..761963a 100644 --- a/ApnsPHP/Tests/PushConnectTest.php +++ b/ApnsPHP/Tests/PushConnectTest.php @@ -19,7 +19,7 @@ * * @covers \ApnsPHP\Push */ -class PushConnectTest extends PushTest +class PushConnectTest extends PushTestCase { /** * Test that connect() connects successfully @@ -34,11 +34,11 @@ public function testConnectSuccess(): void $this->logger->expects($this->exactly(3)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with certificate.' ], [ 'Initialized HTTP/2 backend.' ], - ); + ]); $this->class->connect(); @@ -57,16 +57,13 @@ public function testConnectThrowsExceptionOnHttpInitFail(): void $this->mock_function('curl_setopt_array', fn() => false); - $message = [ - ]; - $this->logger->expects($this->exactly(4)) ->method('error') ->with('Unable to initialize HTTP/2 backend.'); $this->logger->expects($this->exactly(11)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with certificate.' ], [ 'Retry to connect (1/3)...' ], @@ -78,7 +75,7 @@ public function testConnectThrowsExceptionOnHttpInitFail(): void [ 'Retry to connect (3/3)...' ], [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with certificate.' ], - ); + ]); $this->expectException('ApnsPHP\Exception'); $this->expectExceptionMessage('Unable to initialize HTTP/2 backend.'); diff --git a/ApnsPHP/Tests/PushDisconnectTest.php b/ApnsPHP/Tests/PushDisconnectTest.php index b9c6b11..0f6eb22 100644 --- a/ApnsPHP/Tests/PushDisconnectTest.php +++ b/ApnsPHP/Tests/PushDisconnectTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Push */ -class PushDisconnectTest extends PushTest +class PushDisconnectTest extends PushTestCase { /** * Test that disconnect() disconnects successfully diff --git a/ApnsPHP/Tests/PushGetTest.php b/ApnsPHP/Tests/PushGetTest.php index 06964dc..7918a83 100644 --- a/ApnsPHP/Tests/PushGetTest.php +++ b/ApnsPHP/Tests/PushGetTest.php @@ -14,7 +14,7 @@ * * @covers \ApnsPHP\Push */ -class PushGetTest extends PushTest +class PushGetTest extends PushTestCase { /** * Test that getSendRetryTimes() returns how often sends should be retried. diff --git a/ApnsPHP/Tests/PushHttpInitTest.php b/ApnsPHP/Tests/PushHttpInitTest.php index 92c424d..51ac8b3 100644 --- a/ApnsPHP/Tests/PushHttpInitTest.php +++ b/ApnsPHP/Tests/PushHttpInitTest.php @@ -20,7 +20,7 @@ * * @covers \ApnsPHP\Push */ -class PushHttpInitTest extends PushTest +class PushHttpInitTest extends PushTestCase { /** * Test that httpInit() succeeds with certificate @@ -40,7 +40,7 @@ public function testHttpInitSucceedsWithCertificate(): void $this->logger->expects($this->exactly(3)) ->method('info') - ->withConsecutive(...$message); + ->willReturnMap($message); $method = $this->get_reflection_method('httpInit'); $result = $method->invoke($this->class); @@ -99,11 +99,11 @@ public function testHttpInitSucceedsWithKey(): void $this->logger->expects($this->exactly(3)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with key.' ], [ 'Initialized HTTP/2 backend.' ] - ); + ]); $method = $this->get_reflection_method('httpInit'); $result = $method->invoke($this->class); @@ -167,10 +167,10 @@ public function testHttpInitThrowsExceptionOnCurlSetoptFail(): void $this->logger->expects($this->exactly(2)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with key.' ], - ); + ]); $this->expectException('ApnsPHP\Exception'); $this->expectExceptionMessage('Unable to initialize HTTP/2 backend.'); diff --git a/ApnsPHP/Tests/PushHttpSendTest.php b/ApnsPHP/Tests/PushHttpSendTest.php index a595bcc..a4926f5 100644 --- a/ApnsPHP/Tests/PushHttpSendTest.php +++ b/ApnsPHP/Tests/PushHttpSendTest.php @@ -19,7 +19,7 @@ * * @covers \ApnsPHP\Push */ -class PushHttpSendTest extends PushTest +class PushHttpSendTest extends PushTestCase { /** * Helper function to set the http headers and verify calls to message getters @@ -29,11 +29,11 @@ private function setHttpHeaders(): void { $this->message->expects($this->exactly(2)) ->method('getTopic') - ->will($this->returnValue('topic')); + ->willReturn('topic'); $this->message->expects($this->exactly(2)) ->method('getExpiry') - ->will($this->returnValue(10)); + ->willReturn(10); $this->message->expects($this->exactly(2)) ->method('getPriority') @@ -41,15 +41,15 @@ private function setHttpHeaders(): void $this->message->expects($this->exactly(2)) ->method('getCollapseId') - ->will($this->returnValue('1')); + ->willReturn('1'); $this->message->expects($this->exactly(2)) ->method('getCustomIdentifier') - ->will($this->returnValue('7530A828-E58E-433E-A38F-D8042208CF96')); + ->willReturn('7530A828-E58E-433E-A38F-D8042208CF96'); $this->message->expects($this->exactly(2)) ->method('getPushType') - ->will($this->returnValue(PushType::Alert)); + ->willReturn(PushType::Alert); $this->set_reflection_property_value('providerToken', 'jwt'); } @@ -70,11 +70,11 @@ public function testHttpSendReturnsFalseOnCurlSessionFail(): void $this->message->expects($this->once()) ->method('getRecipient') - ->will($this->returnValue('recipient')); + ->willReturn('recipient'); $this->message->expects($this->once()) ->method('getPayload') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $reply = 'reply'; @@ -105,11 +105,11 @@ public function testHttpSendReturnsFalseOnCurlOptsCannotBeSet(): void $this->message->expects($this->once()) ->method('getRecipient') - ->will($this->returnValue('recipient')); + ->willReturn('recipient'); $this->message->expects($this->once()) ->method('getPayload') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $reply = 'reply'; @@ -139,11 +139,11 @@ public function testHttpSendReturnsFalseOnRequestFail(): void $this->message->expects($this->once()) ->method('getRecipient') - ->will($this->returnValue('recipient')); + ->willReturn('recipient'); $this->message->expects($this->once()) ->method('getPayload') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $reply = 'reply'; @@ -174,11 +174,11 @@ public function testHttpSendReturnsTrueOnSuccess(): void $this->message->expects($this->once()) ->method('getRecipient') - ->will($this->returnValue('recipient')); + ->willReturn('recipient'); $this->message->expects($this->once()) ->method('getPayload') - ->will($this->returnValue('payload')); + ->willReturn('payload'); $reply = 'reply'; diff --git a/ApnsPHP/Tests/PushInvalidTest.php b/ApnsPHP/Tests/PushInvalidTest.php index 140bc87..21488d3 100644 --- a/ApnsPHP/Tests/PushInvalidTest.php +++ b/ApnsPHP/Tests/PushInvalidTest.php @@ -17,7 +17,7 @@ * * @covers \ApnsPHP\Push */ -class PushInvalidTest extends PushTest +class PushInvalidTest extends PushTestCase { /** * TestCase constructor diff --git a/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php b/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php index 43d7cd7..eef08e3 100644 --- a/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php +++ b/ApnsPHP/Tests/PushRemoveMessageFromQueueTest.php @@ -15,7 +15,7 @@ * * @covers \ApnsPHP\Push */ -class PushRemoveMessageFromQueueTest extends PushTest +class PushRemoveMessageFromQueueTest extends PushTestCase { /** * Test that removeMessageFromQueue() throws an exception if the message id is not valid diff --git a/ApnsPHP/Tests/PushSendTest.php b/ApnsPHP/Tests/PushSendTest.php index 79dbf86..af22578 100644 --- a/ApnsPHP/Tests/PushSendTest.php +++ b/ApnsPHP/Tests/PushSendTest.php @@ -18,7 +18,7 @@ * * @covers \ApnsPHP\Push */ -class PushSendTest extends PushTest +class PushSendTest extends PushTestCase { /** * Test that send() throws an exception if there is no connection to the push notification service @@ -79,14 +79,14 @@ public function testSendFailsWithoutRetrying(): void $this->logger->expects($this->exactly(6)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Sending messages queue, run #1: 1 message(s) left in queue.' ], [ 'Disconnected.' ], [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with certificate.' ], [ 'Initialized HTTP/2 backend.' ], [ 'Sending messages queue, run #2: 1 message(s) left in queue.' ], - ); + ]); $this->logger->expects($this->once()) ->method('debug') @@ -127,7 +127,7 @@ public function testSendFailsWithRetrying(): void $this->logger->expects($this->exactly(16)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Sending messages queue, run #1: 1 message(s) left in queue.' ], [ 'Disconnected.' ], [ 'Trying to initialize HTTP/2 backend...' ], @@ -144,15 +144,15 @@ public function testSendFailsWithRetrying(): void [ 'Initializing HTTP/2 backend with certificate.' ], [ 'Initialized HTTP/2 backend.' ], [ 'Sending messages queue, run #4: 1 message(s) left in queue.' ], - ); + ]); $this->logger->expects($this->exactly(3)) ->method('debug') - ->withConsecutive( + ->willReturnMap([ [ 'Sending message ID 1 [custom identifier: unset] (1/3): 0 bytes.' ], [ 'Sending message ID 1 [custom identifier: unset] (2/3): 0 bytes.' ], [ 'Sending message ID 1 [custom identifier: unset] (3/3): 0 bytes.' ], - ); + ]); $this->logger->expects($this->once()) ->method('warning') @@ -190,7 +190,7 @@ public function testSendRemovesWhenNoError(): void $this->logger->expects($this->exactly(7)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Sending messages queue, run #1: 1 message(s) left in queue.' ], [ 'Disconnected.' ], [ 'Trying to initialize HTTP/2 backend...' ], @@ -199,7 +199,7 @@ public function testSendRemovesWhenNoError(): void [ 'Sending messages queue, run #2: 1 message(s) left in queue.' ], [ 'Message ID 1 [custom identifier: unset] has no error (200), removing from queue...'], - ); + ]); $this->logger->expects($this->once()) ->method('debug') diff --git a/ApnsPHP/Tests/PushSetTest.php b/ApnsPHP/Tests/PushSetTest.php index 1946f3e..a1a34eb 100644 --- a/ApnsPHP/Tests/PushSetTest.php +++ b/ApnsPHP/Tests/PushSetTest.php @@ -14,7 +14,7 @@ * * @covers \ApnsPHP\Push */ -class PushSetTest extends PushTest +class PushSetTest extends PushTestCase { /** * Test that setSendRetryTimes() sets how often sends should be retried. diff --git a/ApnsPHP/Tests/PushTest.php b/ApnsPHP/Tests/PushTestCase.php similarity index 94% rename from ApnsPHP/Tests/PushTest.php rename to ApnsPHP/Tests/PushTestCase.php index e941a9f..24309aa 100644 --- a/ApnsPHP/Tests/PushTest.php +++ b/ApnsPHP/Tests/PushTestCase.php @@ -1,7 +1,7 @@ logger->expects($this->exactly(3)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with certificate.' ], [ 'Initialized HTTP/2 backend.' ], - ); + ]); $this->logger->expects($this->never()) ->method('warning'); @@ -104,11 +104,11 @@ public function testUpdateQueueDoesNotDeleteUnsentMessages(): void $this->logger->expects($this->exactly(3)) ->method('info') - ->withConsecutive( + ->willReturnMap([ [ 'Trying to initialize HTTP/2 backend...' ], [ 'Initializing HTTP/2 backend with certificate.' ], [ 'Initialized HTTP/2 backend.' ], - ); + ]); $this->logger->expects($this->never()) ->method('warning'); diff --git a/composer.json b/composer.json index 20a56f3..33a83e1 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "lcobucci/jwt": "~4.1 || ~5.0" }, "require-dev": { - "phpunit/phpunit": ">=9.0 <9.6", + "phpunit/phpunit": "~10.0", "lunr/halo": "~0.10.0" }, "config": {