Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"require-dev": {
"phpunit/phpunit": "^9.0",
"symfony/yaml": "^5.0 || ^6.0",
"doctrine/instantiator": "1.4.0",
"overtrue/phplint": "^4.0 || ^5.0"
"doctrine/instantiator": "^1.5.0",
"overtrue/phplint": "^4.5 || ^5.5"
},
"autoload": {
"psr-4": {
Expand Down
30 changes: 15 additions & 15 deletions tests/InterestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testPublishToInterestsShouldMakeRequestIfValid(): void {
// Make request
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
], $client);
$result = $pushNotifications->publishToInterests(
["donuts"],
Expand All @@ -49,7 +49,7 @@ public function testPublishToInterestsShouldMakeRequestIfValid(): void {

$expectedHost = "a11aec92-146a-4708-9a62-8c61f46a82ad.pushnotifications.pusher.com";
$expectedContentType = "application/json";
$expectedAuth = "Bearer EIJ2EESAH8DUUMAI8EE";
$expectedAuth = "Bearer EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T";
$expectedSDK = "pusher-push-notifications-php 2.0.0";

$expectedBody = [
Expand Down Expand Up @@ -94,7 +94,7 @@ public function testPublishToInterestsShouldErrorIfInterestsNotArray(): void {
$this->expectException(TypeError::class);
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
null,
Expand All @@ -115,7 +115,7 @@ public function testPublishToInterestsShouldErrorIfNoInterests(): void {
$this->expectExceptionMessage("Publishes must target at least one interest");
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
[],
Expand All @@ -142,7 +142,7 @@ public function testPublishToInterestsShouldErrorIfTooManyInterests(): void {

$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
$interests,
Expand All @@ -163,7 +163,7 @@ public function testPublishToInterestsShouldErrorIfInterestNotString(): void {
$this->expectExceptionMessage("not a string");
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
[null],
Expand Down Expand Up @@ -191,7 +191,7 @@ public function testPublishToInterestsShouldErrorIfInterestTooLong(): void {

$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
[$interest],
Expand All @@ -215,7 +215,7 @@ public function testPublishToInterestsShouldErrorIfInterestContainsForbiddenChar

$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
[$interest],
Expand All @@ -239,7 +239,7 @@ public function testPublishToInterestsShouldErrorIfInterestIsEmptyString(): void

$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
[$interest],
Expand All @@ -259,7 +259,7 @@ public function testPublishToInterestsShouldErrorIfPublishBodyNotArray(): void {
$this->expectException(TypeError::class);
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$pushNotifications->publishToInterests(
["donuts"],
Expand All @@ -284,7 +284,7 @@ public function testPublishToInterestsShouldErrorIfBadJsonReturned(): void {
// Make request
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
], $client);
$result = $pushNotifications->publishToInterests(
["donuts"],
Expand Down Expand Up @@ -321,7 +321,7 @@ public function testPublishToInterestsShouldErrorIf4xxErrorReturned(): void {
// Make request
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
], $client);
$result = $pushNotifications->publishToInterests(
["donuts"],
Expand Down Expand Up @@ -358,7 +358,7 @@ public function testPublishToInterestsShouldErrorIf5xxErrorReturned(): void {
// Make request
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
], $client);
$result = $pushNotifications->publishToInterests(
["donuts"],
Expand Down Expand Up @@ -395,7 +395,7 @@ public function testPublishToInterestsShouldErrorIfBadErrorJson(): void {
// Make request
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
], $client);
$result = $pushNotifications->publishToInterests(
["donuts"],
Expand Down Expand Up @@ -432,7 +432,7 @@ public function testPublishToInterestsShouldErrorIfBadErrorSchema(): void {
// Make request
$pushNotifications = new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
], $client);
$result = $pushNotifications->publishToInterests(
["donuts"],
Expand Down
14 changes: 7 additions & 7 deletions tests/PushNotificationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ final class PushNotificationsTest extends TestCase {
public function testConstructorShouldAcceptValidParams(): void {
new Pusher\PushNotifications\PushNotifications([
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
$this->assertTrue(true);
}
Expand All @@ -19,7 +19,7 @@ public function testConstructorShouldErrorIfInstanceIdNotGiven(): void {
$this->expectException(Exception::class);
$this->expectExceptionMessage("Required 'instanceId'");
new Pusher\PushNotifications\PushNotifications([
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
}

Expand All @@ -28,7 +28,7 @@ public function testConstructorShouldErrorIfInstanceIdNotString(): void {
$this->expectExceptionMessage("'instanceId' must be a string");
new Pusher\PushNotifications\PushNotifications([
"instanceId" => null,
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
}

Expand All @@ -37,7 +37,7 @@ public function testConstructorShouldErrorIfInstanceIdEmptyString(): void {
$this->expectExceptionMessage("cannot be the empty string");
new Pusher\PushNotifications\PushNotifications([
"instanceId" => "",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
]);
}

Expand Down Expand Up @@ -73,7 +73,7 @@ public function testConstructorShouldErrorIfWrongClientTypeIsGiven(): void
new Pusher\PushNotifications\PushNotifications(
[
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
],
[]
);
Expand All @@ -84,7 +84,7 @@ public function testConstructorShouldMakeANewClientIfNoneIsGiven(): void
$notification = new Pusher\PushNotifications\PushNotifications(
[
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
],
null
);
Expand All @@ -100,7 +100,7 @@ public function testConstructShouldUseGivenClient(): void
$notification = new Pusher\PushNotifications\PushNotifications(
[
"instanceId" => "a11aec92-146a-4708-9a62-8c61f46a82ad",
"secretKey" => "EIJ2EESAH8DUUMAI8EE",
"secretKey" => "EIJ2EESAH8DUUMAI8EE3KL5MNP7QRS9T",
],
$client
);
Expand Down
Loading