Skip to content
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

Suppress HTTP error exceptions #234

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/WebPush.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ public function __construct(array $auth = [], array $defaultOptions = [], ?int $
if (!array_key_exists('timeout', $clientOptions) && isset($timeout)) {
$clientOptions['timeout'] = $timeout;
}

if (!array_key_exists('http_errors', $clientOptions)) {
$clientOptions['http_errors'] = false;
}

$this->client = new Client($clientOptions);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/PushServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function setUpBeforeClass()
*/
protected function setUp()
{
if (!(getenv('TRAVIS') || getenv('CI'))) {
if (getenv('TRAVIS') || getenv('CI')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh? No please don't skip the integration tests :o

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one threw me off, maybe I'm misunderstanding though; the call to $this->markTestSkipped specifies "This test does not run on Travis". The conditional logic here shows that unless both getenv('TRAVIS') as well as getenv('CI') return false, skip the test. So I think, unless I'm just confusing myself at this point, I've just simplified the existing logic to the same effect? 🤔

$this->markTestSkipped('This test does not run on Travis.');
}

Expand Down