summaryrefslogtreecommitdiff
path: root/tests/Unit/Middleware/Stub
diff options
context:
space:
mode:
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);
+ }
+}