We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64a26de commit 69cd5b0Copy full SHA for 69cd5b0
tests/Actions/FooAction.php
@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Test\Actions;
4
5
6
+class FooAction
7
+{
8
9
+}
tests/Actions/TestAction.php
@@ -0,0 +1,11 @@
+use Ruta\Attributes\Route;
+#[Route('GET', '/test')]
+class TestAction
10
11
tests/AttributeTest.php
@@ -0,0 +1,17 @@
+use Ruta\Router;
+it('finds routes from attributes', function() {
+ $router = new Router;
+ $router->loadFromAttributes(__DIR__ . '/Actions', 'Test\Actions');
+ expect($router)->toBeInstanceOf(Router::class);
+});
12
+it('no classes in folder from attributes', function() {
13
14
+ $router->loadFromAttributes(__DIR__, 'Test\Actions');
15
16
17
0 commit comments