Skip to content

Commit 03893ac

Browse files
authored
Added test fix for changed push status lifecycle (#393)
1 parent cef7394 commit 03893ac

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/Parse/ParsePushTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ public function testGettingPushStatus()
237237
// verify not pending
238238
$this->assertFalse($pushStatus->isPending());
239239

240-
// verify 'running', or 'failed' on later versions of parse-server
240+
// verify 'running', or 'failed'/'succeeded' on later versions of parse-server
241241
// both are acceptable
242242
$this->assertTrue(
243-
$pushStatus->isRunning() || $pushStatus->hasFailed(),
244-
'Push did not succeed/fail, was '.$pushStatus->getPushStatus()
243+
$pushStatus->isRunning() || $pushStatus->hasFailed() || $pushStatus->hasSucceeded(),
244+
'Push was not running/succeeded/failed, was '.$pushStatus->getPushStatus()
245245
);
246246

247247
// verify # sent & failed
@@ -261,8 +261,13 @@ public function testGettingPushStatus()
261261
'Hash not present'
262262
);
263263

264-
// verify we have not succeeded
265-
$this->assertFalse($pushStatus->hasSucceeded());
264+
if ($pushStatus->hasFailed()) {
265+
// verify we have not succeeded
266+
$this->assertFalse($pushStatus->hasSucceeded());
267+
} else {
268+
// verify we have succeeded (later servers)
269+
$this->assertTrue($pushStatus->hasSucceeded());
270+
}
266271
}
267272

268273
/**

0 commit comments

Comments
 (0)