Skip to content

Commit 8626cf5

Browse files
committed
In Travis, skip tests that send actual notifications because it's really inconvenient to keep endpoints, keys, etc.. up-to-date
1 parent 3e750c1 commit 8626cf5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/WebPushTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ class WebPushTest extends PHPUnit_Framework_TestCase
1919

2020
/** @var WebPush WebPush with correct api keys */
2121
private $webPush;
22+
23+
protected function checkRequirements()
24+
{
25+
parent::checkRequirements();
26+
27+
if (!array_key_exists('skipIfTravis', $this->getAnnotations()['method'])) {
28+
return;
29+
}
30+
31+
if (getenv('TRAVIS') === true) {
32+
$this->markTestSkipped('This test does not run on Travis.');
33+
}
34+
}
2235

2336
public static function setUpBeforeClass()
2437
{
@@ -57,6 +70,7 @@ public function notificationProvider()
5770

5871
/**
5972
* @dataProvider notificationProvider
73+
* @skipIfTravis
6074
*
6175
* @param string $endpoint
6276
* @param string $payload
@@ -93,6 +107,9 @@ public function testSendNotificationWithTooBigPayload()
93107
);
94108
}
95109

110+
/*
111+
* @skipIfTravis
112+
*/
96113
public function testFlush()
97114
{
98115
$this->webPush->sendNotification(self::$endpoints['standard']);
@@ -113,6 +130,9 @@ public function testSendGCMNotificationWithoutGCMApiKey()
113130
$webPush->sendNotification(self::$endpoints['GCM'], null, null, null, true);
114131
}
115132

133+
/*
134+
* @skipIfTravis
135+
*/
116136
public function testSendGCMNotificationWithWrongGCMApiKey()
117137
{
118138
$webPush = new WebPush(array('GCM' => 'bar'));

0 commit comments

Comments
 (0)