From debd165207572e59dc8347a998969cb435b2c9e3 Mon Sep 17 00:00:00 2001 From: Thierry Corre Date: Wed, 23 Sep 2015 14:48:25 +0200 Subject: [PATCH 1/2] Update Google apis URL https://github.com/zendframework/ZendService_Google_Gcm/issues/11 --- library/ZendService/Google/Gcm/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ZendService/Google/Gcm/Client.php b/library/ZendService/Google/Gcm/Client.php index 74afa9b..244da70 100644 --- a/library/ZendService/Google/Gcm/Client.php +++ b/library/ZendService/Google/Gcm/Client.php @@ -29,7 +29,7 @@ class Client /** * @const string Server URI */ - const SERVER_URI = 'https://android.googleapis.com/gcm/send'; + const SERVER_URI = 'https://gcm-http.googleapis.com/gcm/send'; /** * @var Zend\Http\Client From 06dc166fb8ee4d8e0c405772a6fa558df61b8309 Mon Sep 17 00:00:00 2001 From: Mike Willbanks Date: Tue, 13 Oct 2015 22:15:43 -0500 Subject: [PATCH 2/2] CS fixes + changelog --- CHANGELOG.md | 22 +++++++++++++++++++ .../Exception/InvalidArgumentException.php | 1 - .../Google/Exception/RuntimeException.php | 1 - library/ZendService/Google/Gcm/Response.php | 2 +- tests/Bootstrap.php | 2 +- tests/ZendService/Google/Gcm/ClientTest.php | 3 +-- tests/ZendService/Google/Gcm/MessageTest.php | 2 -- 7 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..81ed921 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.3 - TBD + +### Added + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- [#12](https://github.com/zendframework/ZendService_Google_Gcm/pull/12) - + Updated GCM URL. diff --git a/library/ZendService/Google/Exception/InvalidArgumentException.php b/library/ZendService/Google/Exception/InvalidArgumentException.php index 72636d8..500a778 100644 --- a/library/ZendService/Google/Exception/InvalidArgumentException.php +++ b/library/ZendService/Google/Exception/InvalidArgumentException.php @@ -19,5 +19,4 @@ */ class InvalidArgumentException extends \InvalidArgumentException { - } diff --git a/library/ZendService/Google/Exception/RuntimeException.php b/library/ZendService/Google/Exception/RuntimeException.php index e497e51..401a90b 100644 --- a/library/ZendService/Google/Exception/RuntimeException.php +++ b/library/ZendService/Google/Exception/RuntimeException.php @@ -19,5 +19,4 @@ */ class RuntimeException extends \RuntimeException { - } diff --git a/library/ZendService/Google/Gcm/Response.php b/library/ZendService/Google/Gcm/Response.php index 58497bf..e1646a4 100644 --- a/library/ZendService/Google/Gcm/Response.php +++ b/library/ZendService/Google/Gcm/Response.php @@ -225,7 +225,7 @@ protected function correlate() $results = $this->results; if ($this->message && $results) { $ids = $this->message->getRegistrationIds(); - while($id = array_shift($ids)) { + while ($id = array_shift($ids)) { $results[$id] = array_shift($results); } } diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index eb9b5b6..a1daad2 100755 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -11,7 +11,7 @@ /* * Set error reporting to the level to which Zend Framework code must comply. */ -error_reporting( E_ALL | E_STRICT ); +error_reporting(E_ALL | E_STRICT); $phpUnitVersion = PHPUnit_Runner_Version::id(); if ('@package_version@' !== $phpUnitVersion && version_compare($phpUnitVersion, '3.5.0', '<')) { diff --git a/tests/ZendService/Google/Gcm/ClientTest.php b/tests/ZendService/Google/Gcm/ClientTest.php index 3c027a2..339f593 100644 --- a/tests/ZendService/Google/Gcm/ClientTest.php +++ b/tests/ZendService/Google/Gcm/ClientTest.php @@ -28,7 +28,6 @@ */ class ClientTest extends \PHPUnit_Framework_TestCase { - protected $httpAdapter; protected $httpClient; protected $gcmClient; @@ -36,7 +35,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase protected function _createJSONResponse($id, $success, $failure, $ids, $results) { - return json_encode(array( + return json_encode(array( 'multicast_id' => $id, 'success' => $success, 'failure' => $failure, diff --git a/tests/ZendService/Google/Gcm/MessageTest.php b/tests/ZendService/Google/Gcm/MessageTest.php index 0e186ae..da76328 100644 --- a/tests/ZendService/Google/Gcm/MessageTest.php +++ b/tests/ZendService/Google/Gcm/MessageTest.php @@ -24,7 +24,6 @@ */ class MessageTest extends \PHPUnit_Framework_TestCase { - protected $validRegistrationIds = array('1234567890', '0987654321'); protected $validData = array('key' => 'value', 'key2' => array('value')); @@ -157,5 +156,4 @@ public function testExpectedDryRunBehavior() $this->assertEquals($this->m->getDryRun(), false); $this->assertNotContains('dry_run', $this->m->toJson()); } - }