summaryrefslogtreecommitdiff
path: root/tests/Unit/Middleware/Stub
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-04 18:35:13 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-04 21:13:28 +0200
commitb52444af8a289e089d1239657cdf6ff06b21b29d (patch)
treec2754b3049a50ad6743841a609ab0574f241720d /tests/Unit/Middleware/Stub
parentb320fc779063ee80b8f0ba505cb323287ccccbf5 (diff)
parenta1bc763a16ee8be109de5c9053fbc5eded53824e (diff)
Merge remote-tracking branch 'MyIgel/routing'
Diffstat (limited to 'tests/Unit/Middleware/Stub')
-rw-r--r--tests/Unit/Middleware/Stub/HasStaticMethod.php8
-rw-r--r--tests/Unit/Middleware/Stub/ResolvesMiddlewareTraitImplementation.php35
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/Unit/Middleware/Stub/HasStaticMethod.php b/tests/Unit/Middleware/Stub/HasStaticMethod.php
new file mode 100644
index 00000000..5ca2670e
--- /dev/null
+++ b/tests/Unit/Middleware/Stub/HasStaticMethod.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Middleware\Stub;
+
+class HasStaticMethod
+{
+ public static function foo() { }
+}
diff --git a/tests/Unit/Middleware/Stub/ResolvesMiddlewareTraitImplementation.php b/tests/Unit/Middleware/Stub/ResolvesMiddlewareTraitImplementation.php
new file mode 100644
index 00000000..2787d74b
--- /dev/null
+++ b/tests/Unit/Middleware/Stub/ResolvesMiddlewareTraitImplementation.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Middleware\Stub;
+
+use Engelsystem\Application;
+use Engelsystem\Middleware\ResolvesMiddlewareTrait;
+use InvalidArgumentException;
+use Psr\Http\Server\MiddlewareInterface;
+use Psr\Http\Server\RequestHandlerInterface;
+
+class ResolvesMiddlewareTraitImplementation
+{
+ use ResolvesMiddlewareTrait;
+
+ /** @var Application */
+ protected $container;
+
+ /**
+ * @param Application $container
+ */
+ public function __construct(Application $container = null)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * @param string|callable|MiddlewareInterface|RequestHandlerInterface $middleware
+ * @return MiddlewareInterface|RequestHandlerInterface
+ * @throws InvalidArgumentException
+ */
+ public function callResolveMiddleware($middleware)
+ {
+ return $this->resolveMiddleware($middleware);
+ }
+}