Skip to content

Adds Fix for Changed Push Status Life Cycle #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions tests/Parse/ParsePushTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ public function testGettingPushStatus()
// verify not pending
$this->assertFalse($pushStatus->isPending());

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

// verify # sent & failed
Expand All @@ -261,8 +261,13 @@ public function testGettingPushStatus()
'Hash not present'
);

// verify we have not succeeded
$this->assertFalse($pushStatus->hasSucceeded());
if ($pushStatus->hasFailed()) {
// verify we have not succeeded
$this->assertFalse($pushStatus->hasSucceeded());
} else {
// verify we have succeeded (later servers)
$this->assertTrue($pushStatus->hasSucceeded());
}
}

/**
Expand Down