summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-05-29 13:03:34 +0300
committerWolfy-J <[email protected]>2018-05-29 13:03:34 +0300
commitb8bc792b263a3891e125757a35cc563bb85f1a0b (patch)
treef7a9e6f2568220491a26f6544e4acf0ed62012bb /tests
parent50f820833eeef8518b3b978b33c6f20391225162 (diff)
nested observers
Diffstat (limited to 'tests')
-rw-r--r--tests/broken.php14
-rw-r--r--tests/client.php35
-rw-r--r--tests/delay.php18
-rw-r--r--tests/echo.php17
-rw-r--r--tests/error.php13
-rw-r--r--tests/failboot.php3
-rw-r--r--tests/head.php17
-rw-r--r--tests/pid.php17
-rw-r--r--tests/slow-client.php38
-rw-r--r--tests/stop.php25
10 files changed, 0 insertions, 197 deletions
diff --git a/tests/broken.php b/tests/broken.php
deleted file mode 100644
index b1a3839e..00000000
--- a/tests/broken.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-while ($in = $rr->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
deleted file mode 100644
index 31caa410..00000000
--- a/tests/client.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-use Spiral\Goridge;
-
-ini_set('display_errors', 'stderr');
-require dirname(__DIR__) . "/vendor/autoload.php";
-
-if (count($argv) < 3) {
- die("need 2 arguments");
-}
-
-list($test, $goridge) = [$argv[1], $argv[2]];
-
-switch ($goridge) {
- case "pipes":
- $relay = new Goridge\StreamRelay(STDIN, STDOUT);
- break;
-
- case "tcp":
- $relay = new Goridge\SocketRelay("localhost", 9007);
- break;
-
- case "unix":
- $relay = new Goridge\SocketRelay(
- "sock.unix",
- null,
- Goridge\SocketRelay::SOCK_UNIX
- );
- break;
-
- default:
- die("invalid protocol selection");
-}
-
-require_once sprintf("%s/%s.php", __DIR__, $test);
diff --git a/tests/delay.php b/tests/delay.php
deleted file mode 100644
index bfde2fc4..00000000
--- a/tests/delay.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-while ($in = $rr->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.php b/tests/echo.php
deleted file mode 100644
index ba58ff30..00000000
--- a/tests/echo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-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.php b/tests/error.php
deleted file mode 100644
index ebd3418b..00000000
--- a/tests/error.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-while ($in = $rr->receive($ctx)) {
- $rr->error((string)$in);
-} \ No newline at end of file
diff --git a/tests/failboot.php b/tests/failboot.php
deleted file mode 100644
index fa8b96f6..00000000
--- a/tests/failboot.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-ini_set('display_errors', 'stderr');
-throw new Error("failboot error"); \ No newline at end of file
diff --git a/tests/head.php b/tests/head.php
deleted file mode 100644
index 4f4e4061..00000000
--- a/tests/head.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-while ($in = $rr->receive($ctx)) {
- try {
- $rr->send("", (string)$ctx);
- } catch (\Throwable $e) {
- $rr->error((string)$e);
- }
-} \ No newline at end of file
diff --git a/tests/pid.php b/tests/pid.php
deleted file mode 100644
index a8cfa229..00000000
--- a/tests/pid.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-while ($in = $rr->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
deleted file mode 100644
index f09142b5..00000000
--- a/tests/slow-client.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-use Spiral\Goridge;
-
-ini_set('display_errors', 'stderr');
-require dirname(__DIR__) . "/vendor/autoload.php";
-
-if (count($argv) < 3) {
- die("need 2 arguments");
-}
-
-list($test, $goridge, $bootDelay, $shutdownDelay) = [$argv[1], $argv[2], $argv[3], $argv[4]];
-
-switch ($goridge) {
- case "pipes":
- $relay = new Goridge\StreamRelay(STDIN, STDOUT);
- break;
-
- case "tcp":
- $relay = new Goridge\SocketRelay("localhost", 9007);
- break;
-
- case "unix":
- $relay = new Goridge\SocketRelay(
- "sock.unix",
- null,
- Goridge\SocketRelay::SOCK_UNIX
- );
-
- break;
-
- default:
- die("invalid protocol selection");
-}
-
-usleep($bootDelay * 1000);
-require_once sprintf("%s/%s.php", __DIR__, $test);
-usleep($shutdownDelay * 1000); \ No newline at end of file
diff --git a/tests/stop.php b/tests/stop.php
deleted file mode 100644
index caa485d6..00000000
--- a/tests/stop.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-
-$rr = new RoadRunner\Worker($relay);
-
-$used = false;
-while ($in = $rr->receive($ctx)) {
- try {
- if ($used) {
- // kill on second attempt
- $rr->stop();
- continue;
- }
-
- $used = true;
- $rr->send((string)getmypid());
- } catch (\Throwable $e) {
- $rr->error((string)$e);
- }
-} \ No newline at end of file