diff --git a/src/Route.php b/src/Route.php new file mode 100644 index 0000000..fa4732e --- /dev/null +++ b/src/Route.php @@ -0,0 +1,35 @@ +methods = is_array($methods) ? $methods : [$methods]; + $this->path = $path; + } +} diff --git a/tests/.gitkeep b/tests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/Fig/Attributes/Tests/RouteTest.php b/tests/Fig/Attributes/Tests/RouteTest.php new file mode 100644 index 0000000..d043f50 --- /dev/null +++ b/tests/Fig/Attributes/Tests/RouteTest.php @@ -0,0 +1,31 @@ +assertSame(['GET'], $attribute->methods); + $this->assertSame('/users', $attribute->path); + } + + /** + * @covers \Fig\Attributes\Route + */ + public function testMultipleMethods(): void + { + $attribute = new Route(['GET', 'POST'], '/users'); + $this->assertSame(['GET', 'POST'], $attribute->methods); + $this->assertSame('/users', $attribute->path); + } +}