Skip to content

Commit 20d8b1c

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 25ff00b + 2a19d53 commit 20d8b1c

File tree

8 files changed

+38
-16
lines changed

8 files changed

+38
-16
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,7 @@ modules.xml
8282
service_account.json
8383

8484
# PHPUnit HTML Report
85-
report/
85+
report/
86+
87+
# PHP Unit Local Test Configureation
88+
phpunit.local.xml

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: php
2+
3+
php:
4+
- 7.0
5+
- 7.1
6+
- 7.2
7+
8+
before_install:
9+
- openssl aes-256-cbc -K $encrypted_f2e6dfafc496_key -iv $encrypted_f2e6dfafc496_iv -in service_account.json.enc -out service_account.json -d
10+
11+
install:
12+
- composer self-update
13+
- composer install
14+
15+
script:
16+
- ./vendor/bin/phpunit
17+
18+
after_script:
19+
- bash <(curl -s https://codecov.io/bash)

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
</filter>
1515

1616
<logging>
17-
<log type="coverage-html" target="report"/>
17+
<log type="coverage-clover" target="clover.xml"/>
1818
</logging>
1919
</phpunit>

service_account.json.enc

2.34 KB
Binary file not shown.

tests/APNsConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testSetTimeToLive() {
4646
$this -> assertArrayHasKey('apns-expiration', $payload['apns']['headers']);
4747

4848
$end = new \DateTime('@' . $payload['apns']['headers']['apns-expiration']);
49-
$this -> assertEquals(1, $end -> diff($start) -> d);
49+
$this -> assertEquals(1, $end -> diff($start) -> s);
5050
}
5151

5252
public function testPriorityFire() {

tests/AndroidConfigTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testDuplicateOption() {
6060
}
6161

6262
public function testCollapseKeyFire() {
63-
$this -> markTestSkipped("Skipping passed test");
63+
// $this -> markTestSkipped("Skipping passed test");
6464
$config = new AndroidConfig();
6565
$fcmTest = new FCMTest();
6666
$config -> setCollapseKey('test');
@@ -87,7 +87,7 @@ public function testPriorityFire() {
8787
}
8888

8989
public function testTimeToLive() {
90-
$this -> markTestSkipped("Skipping passed test");
90+
// $this -> markTestSkipped("Skipping passed test");
9191
$config = new AndroidConfig();
9292
$fcmTest = new FCMTest();
9393
$config -> setTimeToLive(60);

tests/ConfigTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class ConfigTest extends TestCase {
1515

1616
public function testSetCollapseKey() {
17-
$this -> markTestSkipped("Skipping passed test");
17+
// $this -> markTestSkipped("Skipping passed test");
1818
$fcmTest = new FCMTest();
1919
$config = new Config();
2020

@@ -25,7 +25,7 @@ public function testSetCollapseKey() {
2525
}
2626

2727
public function testSetTimeToLive() {
28-
$this -> markTestSkipped("Implemented");
28+
// $this -> markTestSkipped("Implemented");
2929
$fcmTest = new FCMTest();
3030
$config = new Config();
3131

tests/FCMTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use \PHPUnit\Framework\TestCase;
1919

2020
class FCMTest extends TestCase {
21-
const KEY_FILE = '../service_account.json';
21+
const KEY_FILE = 'service_account.json';
2222
// const DEVICE_TOKEN = 'eJH9cNs4hc4:APA91bHDwEGN6xEAwbDRpumCRSVnHLGgWXmiwIzAAeUTGP5Fx3diz4mL0T2E5zBVCb_zOfAwwuEsPy4J2504Ct0Mn3NAWVt2MKpvwh1iSUkSMKN0sjTQArMuZpzvm0ioeXkt-QFj3Xvi';
2323
const DEVICE_TOKEN = 'dswH6YqIC70:APA91bFaFQM_Jw-hoQAYDwXOVN8ifuIQ_GCpT26h7mt_Q-bYc4g-7q8vQqYD5ILAPwuPbU5uk2kbQtYRyDvnnLHvG3cLMcppN41ri4rYAV-Daf4QyCj4l0anuYS-mXTq1j_yanLvhlCJ';
2424

@@ -27,22 +27,22 @@ class FCMTest extends TestCase {
2727

2828
public function testBuild() {
2929
$fcm = $this -> buildNotification(self::TEST_TITLE, self::TEST_BODY);
30+
$payload = $fcm -> getPayload();
3031

3132
$expected = array(
32-
'message' => array(
33-
'token' => self::DEVICE_TOKEN,
34-
'notification' => array(
35-
'title' => self::TEST_TITLE,
36-
'body' => self::TEST_BODY
37-
)
33+
'token' => self::DEVICE_TOKEN,
34+
'notification' => array(
35+
'title' => self::TEST_TITLE,
36+
'body' => self::TEST_BODY
3837
)
3938
);
40-
$this -> assertEquals($expected, $fcm -> getPayload());
39+
$this -> assertArrayHasKey('message', $payload);
40+
$this -> assertEquals($expected, $payload['message']);
4141
}
4242

4343
public function testFire() {
4444
// $this -> markTestSkipped(__METHOD__ . ' already passed');
45-
$fcm = $this -> buildNotification(self::TEST_TITLE, self::TEST_BODY, self::KEY_FILE);
45+
$fcm = $this -> buildNotification(self::TEST_TITLE, self::TEST_BODY);
4646
$result = $fcm -> fire();
4747
echo $result;
4848

0 commit comments

Comments
 (0)