summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-10-01 15:03:37 +0300
committerGitHub <[email protected]>2021-10-01 15:03:37 +0300
commitccf08c9470453f498cc20bc2245004662690320e (patch)
tree7e770c084f13d7df31ed2ffbfa33f8fd8ab362e9 /tests
parent0a0d9cc38dcfa1a799e2bc1ecbc3dd4bbabd526a (diff)
parent340ad8870657fb943d14963c7b72c15d163d4729 (diff)
[#817]: feat(release): `beta` pre-releasev2.5.0-beta.1
[#817]: feat(release): `beta` pre-release
Diffstat (limited to 'tests')
-rw-r--r--tests/jobs_err.php52
-rw-r--r--tests/jobs_ok.php27
2 files changed, 0 insertions, 79 deletions
diff --git a/tests/jobs_err.php b/tests/jobs_err.php
deleted file mode 100644
index 4ccea4f8..00000000
--- a/tests/jobs_err.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-use Spiral\Goridge\StreamRelay;
-
-require __DIR__ . "/vendor/autoload.php";
-
-$rr = new RoadRunner\Worker(new StreamRelay(\STDIN, \STDOUT));
-
-while ($in = $rr->waitPayload()) {
- try {
- $ctx = json_decode($in->header, true);
- $headers = $ctx['headers'];
-
- $set = isset($headers['attempts']);
-
- $val = 0;
-
- if ($set == true) {
- $val = intval($headers['attempts'][0]);
- $val++;
- $headers['attempts'][0] = strval($val);
- } else {
- $headers['attempts'][0] = "1";
- };
-
- if ($val > 3) {
- $rr->respond(new RoadRunner\Payload(json_encode([
- // no error
- 'type' => 0,
- 'data' => []
- ])));
- } else {
- $rr->respond(new RoadRunner\Payload(json_encode([
- 'type' => 1,
- 'data' => [
- 'message' => 'error',
- 'requeue' => true,
- 'delay_seconds' => 5,
- 'headers' => $headers
- ]
- ])));
- }
- } catch (\Throwable $e) {
- $rr->error((string)$e);
- }
-}
diff --git a/tests/jobs_ok.php b/tests/jobs_ok.php
deleted file mode 100644
index 4e786d15..00000000
--- a/tests/jobs_ok.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
- * @var Goridge\RelayInterface $relay
- */
-
-use Spiral\Goridge;
-use Spiral\RoadRunner;
-use Spiral\Goridge\StreamRelay;
-
-require __DIR__ . "/vendor/autoload.php";
-
-$rr = new RoadRunner\Worker(new StreamRelay(\STDIN, \STDOUT));
-
-while ($in = $rr->waitPayload()) {
- try {
- $ctx = json_decode($in->header, true);
- $headers = $ctx['headers'];
-
- $rr->respond(new RoadRunner\Payload(json_encode([
- 'type' => 0,
- 'data' => []
- ])));
- } catch (\Throwable $e) {
- $rr->error((string)$e);
- }
-}