From 78a42de837928cf7d10a1ae04d7e82e56d66e1e2 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Tue, 23 Jan 2018 19:51:15 -0500 Subject: API update --- tests/broken-client.php | 17 ----------------- tests/broken.php | 14 ++++++++++++++ tests/client.php | 36 ++++++++++++++++++++++++++++++++++++ tests/delay.php | 18 ++++++++++++++++++ tests/echo-client.php | 20 -------------------- tests/echo.php | 17 +++++++++++++++++ tests/error-client.php | 16 ---------------- tests/error.php | 13 +++++++++++++ tests/failboot.php | 3 +++ tests/pid.php | 17 +++++++++++++++++ tests/slow-client.php | 38 ++++++++++++++++++++++++++++++++++++++ 11 files changed, 156 insertions(+), 53 deletions(-) delete mode 100644 tests/broken-client.php create mode 100644 tests/broken.php create mode 100644 tests/client.php create mode 100644 tests/delay.php delete mode 100644 tests/echo-client.php create mode 100644 tests/echo.php delete mode 100644 tests/error-client.php create mode 100644 tests/error.php create mode 100644 tests/failboot.php create mode 100644 tests/pid.php create mode 100644 tests/slow-client.php (limited to 'tests') diff --git a/tests/broken-client.php b/tests/broken-client.php deleted file mode 100644 index ed5bde20..00000000 --- a/tests/broken-client.php +++ /dev/null @@ -1,17 +0,0 @@ -receive($ctx)) { - echo undefined_function(); - $rr->send((string)$in); -} \ No newline at end of file diff --git a/tests/broken.php b/tests/broken.php new file mode 100644 index 00000000..b1a3839e --- /dev/null +++ b/tests/broken.php @@ -0,0 +1,14 @@ +receive($ctx)) { + echo undefined_function(); + $rr->send((string)$in); +} \ No newline at end of file diff --git a/tests/client.php b/tests/client.php new file mode 100644 index 00000000..1f1d21b1 --- /dev/null +++ b/tests/client.php @@ -0,0 +1,36 @@ +receive($ctx)) { + try { + usleep($in * 1000); + $rr->send(''); + } catch (\Throwable $e) { + $rr->error((string)$e); + } +} \ No newline at end of file diff --git a/tests/echo-client.php b/tests/echo-client.php deleted file mode 100644 index 22761862..00000000 --- a/tests/echo-client.php +++ /dev/null @@ -1,20 +0,0 @@ -receive($ctx)) { - try { - $rr->send((string)$in); - } catch (\Throwable $e) { - $rr->error((string)$e); - } -} \ No newline at end of file diff --git a/tests/echo.php b/tests/echo.php new file mode 100644 index 00000000..ba58ff30 --- /dev/null +++ b/tests/echo.php @@ -0,0 +1,17 @@ +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 deleted file mode 100644 index 113d1197..00000000 --- a/tests/error-client.php +++ /dev/null @@ -1,16 +0,0 @@ -receive($ctx)) { - $rr->error((string)$in); -} \ No newline at end of file diff --git a/tests/error.php b/tests/error.php new file mode 100644 index 00000000..ebd3418b --- /dev/null +++ b/tests/error.php @@ -0,0 +1,13 @@ +receive($ctx)) { + $rr->error((string)$in); +} \ No newline at end of file diff --git a/tests/failboot.php b/tests/failboot.php new file mode 100644 index 00000000..fa8b96f6 --- /dev/null +++ b/tests/failboot.php @@ -0,0 +1,3 @@ +receive($ctx)) { + try { + $rr->send((string)getmypid()); + } catch (\Throwable $e) { + $rr->error((string)$e); + } +} \ No newline at end of file diff --git a/tests/slow-client.php b/tests/slow-client.php new file mode 100644 index 00000000..f09142b5 --- /dev/null +++ b/tests/slow-client.php @@ -0,0 +1,38 @@ +