-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trait to provide socket connections from phpunit.xml (env), #4
- Loading branch information
1 parent
753de8a
commit 77573fd
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace hollodotme\FastCGI\Tests\Traits; | ||
|
||
trait SocketDataProviding | ||
{ | ||
final protected function getNetworkSocketHost() : string | ||
{ | ||
return (string)$_ENV['network-socket-host']; | ||
} | ||
|
||
final protected function getNetworkSocketPort() : int | ||
{ | ||
return (int)$_ENV['network-socket-port']; | ||
} | ||
|
||
final protected function getUnixDomainSocket() : string | ||
{ | ||
return (string)$_ENV['unix-domain-socket']; | ||
} | ||
|
||
final protected function getRestrictedUnixDomainSocket() : string | ||
{ | ||
return (string)$_ENV['restricted-unix-domain-socket']; | ||
} | ||
|
||
final protected function getNonExistingUnixDomainSocket() : string | ||
{ | ||
return (string)$_ENV['non-existing-unix-domain-socket']; | ||
} | ||
|
||
final protected function getInvalidUnixDomainSocket() : string | ||
{ | ||
return (string)$_ENV['invalid-unix-domain-socket']; | ||
} | ||
} |