summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
committerSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
commitb247471d98760f0c4eb97ab98579f9db857d762b (patch)
treea641a8f00e72323eeb5f2f76c4debc08521548e9
parentf3c8afbcbb313e44f8baf9eb645b0367c18a1d01 (diff)
setup tests
-rw-r--r--phpunit.xml17
-rw-r--r--tests/Pest.php1
-rw-r--r--tests/Unit/RouteTest.php16
3 files changed, 34 insertions, 0 deletions
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644
index 0000000..35cdfbb
--- /dev/null
+++ b/phpunit.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
+ bootstrap="vendor/autoload.php"
+ colors="true"
+>
+ <testsuites>
+ <testsuite name="Test Suite">
+ <directory suffix="Test.php">./tests</directory>
+ </testsuite>
+ </testsuites>
+ <source>
+ <include>
+ <directory>src</directory>
+ </include>
+ </source>
+</phpunit>
diff --git a/tests/Pest.php b/tests/Pest.php
new file mode 100644
index 0000000..b3d9bbc
--- /dev/null
+++ b/tests/Pest.php
@@ -0,0 +1 @@
+<?php
diff --git a/tests/Unit/RouteTest.php b/tests/Unit/RouteTest.php
new file mode 100644
index 0000000..5e3dc3b
--- /dev/null
+++ b/tests/Unit/RouteTest.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+use Lightscale\Router\Enums\HttpMethod;
+use Lightscale\Router\Enums\SpecialSegment;
+use Lightscale\Router\PathSegment;
+use Lightscale\Router\Route;
+
+it('initializes')
+ ->expect(fn () => new Route(
+ new PathSegment(SpecialSegment::Root),
+ HttpMethod::Get,
+ fn () => null
+ ))
+ ->toBeInstance(Route::class);