diff options
author | Wolfy-J <[email protected]> | 2017-12-26 19:14:53 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2017-12-26 19:14:53 +0300 |
commit | e229d83dea4bbe9d0cfe6569c8fbe239690aafb9 (patch) | |
tree | 2d4887ffdb167d660b705415f0617458490d0b9f /tests |
init
Diffstat (limited to 'tests')
-rw-r--r-- | tests/broken-client.php | 17 | ||||
-rw-r--r-- | tests/echo-client.php | 20 | ||||
-rw-r--r-- | tests/error-client.php | 16 |
3 files changed, 53 insertions, 0 deletions
diff --git a/tests/broken-client.php b/tests/broken-client.php new file mode 100644 index 00000000..ed5bde20 --- /dev/null +++ b/tests/broken-client.php @@ -0,0 +1,17 @@ +<?php + +use Spiral\Goridge; +use Spiral\RoadRunner; + +/** + * echo client over pipes. + */ +ini_set('display_errors', 'stderr'); +require "vendor/autoload.php"; + +$rr = new RoadRunner\Worker(new Goridge\StreamRelay(STDIN, STDOUT)); + +while ($in = $rr->receive($ctx)) { + echo undefined_function(); + $rr->send((string)$in); +}
\ No newline at end of file diff --git a/tests/echo-client.php b/tests/echo-client.php new file mode 100644 index 00000000..22761862 --- /dev/null +++ b/tests/echo-client.php @@ -0,0 +1,20 @@ +<?php + +use Spiral\Goridge; +use Spiral\RoadRunner; + +/** + * echo client over pipes. + */ +ini_set('display_errors', 'stderr'); +require "vendor/autoload.php"; + +$rr = new RoadRunner\Worker(new Goridge\StreamRelay(STDIN, STDOUT)); + +while ($in = $rr->receive($ctx)) { + try { + $rr->send((string)$in); + } catch (\Throwable $e) { + $rr->error((string)$e); + } +}
\ No newline at end of file diff --git a/tests/error-client.php b/tests/error-client.php new file mode 100644 index 00000000..113d1197 --- /dev/null +++ b/tests/error-client.php @@ -0,0 +1,16 @@ +<?php + +use Spiral\Goridge; +use Spiral\RoadRunner; + +/** + * echo client over pipes. + */ +ini_set('display_errors', 'stderr'); +require "vendor/autoload.php"; + +$rr = new RoadRunner\Worker(new Goridge\StreamRelay(STDIN, STDOUT)); + +while ($in = $rr->receive($ctx)) { + $rr->error((string)$in); +}
\ No newline at end of file |