Skip to content

Commit 152de42

Browse files
committed
skip GCM tests if the GCM endpoint is not one
1 parent 07bd808 commit 152de42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/WebPushTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,21 @@ public function testFlush()
144144

145145
public function testSendGCMNotificationWithoutGCMApiKey()
146146
{
147-
$webPush = new WebPush();
147+
if (substr(self::$endpoints['GCM'], 0, strlen(WebPush::GCM_URL)) !== WebPush::GCM_URL) {
148+
$this->markTestSkipped('The provided GCM URL is not a GCM URL, but probably a FCM URL.');
149+
}
148150

151+
$webPush = new WebPush();
149152
$this->setExpectedException('ErrorException', 'No GCM API Key specified.');
150153
$webPush->sendNotification(self::$endpoints['GCM'], null, null, null, true);
151154
}
152155

153156
public function testSendGCMNotificationWithWrongGCMApiKey()
154157
{
158+
if (substr(self::$endpoints['GCM'], 0, strlen(WebPush::GCM_URL)) !== WebPush::GCM_URL) {
159+
$this->markTestSkipped('The provided GCM URL is not a GCM URL, but probably a FCM URL.');
160+
}
161+
155162
$webPush = new WebPush(array('GCM' => 'bar'));
156163

157164
$res = $webPush->sendNotification(self::$endpoints['GCM'], null, null, null, true);

0 commit comments

Comments
 (0)