Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.
Merged
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
2 changes: 1 addition & 1 deletion src/JWage/APNS/SocketClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function createStreamClient()
{
$address = $this->getSocketAddress();

$client = stream_socket_client(
$client = @stream_socket_client(
$address,
$this->error,
$this->errorString,
Expand Down
10 changes: 10 additions & 0 deletions tests/JWage/APNS/Tests/SocketClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public function testGetSocketAddress()
{
$this->assertEquals('ssl://host:1234', $this->socketClient->getTestSocketAddress());
}

/**
* @expectedException ErrorException
* @expectedExceptionMessage Failed to create stream socket client to "ssl://somethingthatdoesnotexist:100". php_network_getaddresses: getaddrinfo failed: Name or service not known
*/
public function testConnectThrowsException()
{
$socketClient = new SocketClient($this->certificate, 'somethingthatdoesnotexist', 100);
$socketClient->write('test');
}
}

class SocketClientStub extends SocketClient
Expand Down