Go to file
Nabeel Shahzad 1f9f5cc32a
test(routeforge): pest + vitest coverage + service fixes
Add 27 PHP test files + 6 TS test files + Vitest setup, surfacing
and fixing 4 production bugs in the process.

Test counts (all green):
- PHP: 545 tests / 2341 assertions / 25.25s
  - 12 lint rule tests (L1, L2, L2b, L3, L4, L5, L6, L7, L8, L9, L10, L11)
  - LintRunner dispatch + LintReport bucket aggregation
  - DuplicateChecker bulk-query + N+1 protection
  - RouteForgeService full commit pipeline (happy path, lint rollback,
    attach-existing branch, fare multiplier, withoutEvents suppression)
  - 6 endpoint feature tests (PreviewAirports, Subfleets, AirlineStats,
    CheckDuplicates, Lint, Commit)
- TS: 46 tests / 6 files / 280ms via Vitest 4.1.7 + happy-dom
  - geo, timezone, flightNumber, timeStrategy, generator, lint

In-scope production fixes discovered by writing the tests:

1. DuplicateChecker eager-load was 'airline:id,code' but 'code' is an
   accessor over iata/icao columns. Loaded airline came back with
   NEITHER backing column populated and Flight::ident dropped the
   airline prefix in the duplicates response. Changed to
   'airline:id,iata,icao'.

2. LintRunner constructor takes 'array $rules' with no container-
   resolvable shape. Both /lint and /commit endpoints would have
   failed at runtime with 'Unresolvable dependency'. Registered as
   singleton in AppServiceProvider::register() binding to
   LintRunner::defaults().

3. BaseRouteForgeBatchRequest's 'subfleet_ids' rule was
   ['required', 'array', 'min:0']. 'required' rejects empty arrays
   in Laravel, contradicting 'min:0'. Relaxed to ['present', 'array'];
   L3 lint catches the empty case as a warning downstream.

4. RouteForgeService::commit() called auth()->user() directly,
   violating tests/Arch/GlobalTest's http-helpers rule (auth/session/
   request only allowed in App\Http / App\Filament / App\Livewire /
   App\Providers\Filament). Added $causerId field to CommitInput;
   controller stamps it from auth()->id(); service resolves User by id.

Infrastructure:
- tests/Support/RouteForgeTestHelpers.php — shared LintContext + row +
  airport + batchPayload builders. PSR-4 autoloaded via Tests\ namespace;
  static class avoids global-function name collisions across the 15+
  RouteForge test files.
- vitest.config.ts at project root, scoped to
  resources/js/admin/routeforge/**/*.test.ts. happy-dom provides the
  minimal window + DOM globals lib/i18n.ts depends on.
- package.json gains 'test': 'vitest run' script.
- Added vitest, happy-dom, @types/node as devDependencies.

Task 4.6.3 stays N/A — FlightNumberAssigner was removed per the
Section 4 banner; no PHP equivalent to test. Section 6.4.7's planned
PHP↔TS shared fixtures (tests/fixtures/routeforge/generator/) also
N/A for the same reason; TS generator tests stand alone.

Quality gates green:
- tsc --noEmit: clean
- oxlint (40 files / 93 rules): 0 warnings, 0 errors
- oxfmt --check: all formatted
- npm run build: routeforge bundle stays at 26.69 KB gzip
  (Decision 16 budget 60 KB → 33.31 KB headroom)
- vendor/bin/pint --dirty: passed
- vendor/bin/phpstan analyse: OK no errors
- vendor/bin/rector --dry-run: clean for RouteForge files
2026-05-24 11:55:36 -05:00
.github Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
.hooks fix(pre-commit): add '--' to npm commands for proper argument handling 2026-04-25 10:15:33 +02:00
app test(routeforge): pest + vitest coverage + service fixes 2026-05-24 11:55:36 -05:00
bin Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
bootstrap [8.x] refactor: migrate to the new modern laravel structure (#2207) 2026-05-07 14:58:11 -05:00
config feat(routeforge): admin batch flight composer + lint pipeline 2026-05-24 11:55:33 -05:00
database Merge branch 'main' into refactor-subfleets-filtering 2026-05-23 22:35:50 +02:00
docs Remove is_default and composer update 2026-05-23 12:05:32 -05:00
modules refactor: remove VaCentral package and update airport lookup implementation 2026-05-22 18:27:54 +02:00
public Remove is_default and composer update 2026-05-23 12:05:32 -05:00
resources test(routeforge): pest + vitest coverage + service fixes 2026-05-24 11:55:36 -05:00
routes feat(routeforge): admin batch flight composer + lint pipeline 2026-05-24 11:55:33 -05:00
scripts Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
storage [8.x] Add composer run dev command (#2009) 2025-03-14 12:26:44 -05:00
tests test(routeforge): pest + vitest coverage + service fixes 2026-05-24 11:55:36 -05:00
.editorconfig Workflow fixes 2025-01-10 14:09:48 -06:00
.env.example Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
.gitignore Update gitignore/rebase 2026-05-23 12:06:29 -05:00
.htaccess Remove vendor from .htaccess (#1994) 2025-02-14 14:24:19 -06:00
.oxfmtrc.json Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
.oxlintrc.json Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
artisan [8.x] refactor: migrate to the new modern laravel structure (#2207) 2026-05-07 14:58:11 -05:00
bun.lock Flight bulk actions 2026-05-23 12:05:09 -05:00
CHANGELOG.md add oxlint and oxfmt 2026-03-18 23:17:18 +01:00
compose.sail.yml feat(schema-modernization): foundations for RouteForge 2026-05-23 12:05:09 -05:00
composer.json feat(routeforge): admin batch flight composer + lint pipeline 2026-05-24 11:55:33 -05:00
composer.lock feat(routeforge): admin batch flight composer + lint pipeline 2026-05-24 11:55:33 -05:00
Directory.Build.props chore: remove outdated release notes step and add GitVersioning configuration 2025-08-13 11:33:05 -05:00
docker-compose.example.yml add oxlint and oxfmt 2026-03-18 23:17:18 +01:00
Dockerfile ci: build assets during pipeline instead of committing them (#2072) 2025-08-15 09:45:14 -05:00
intellij_style.xml 7.0.0-beta3 Release (#541) 2020-02-08 13:29:34 -05:00
justfile Updating styling and looks of the installer/admin/system filament pages (#2211) 2026-05-20 11:05:32 -05:00
LICENSE Update LICENSE 2024-10-15 09:14:15 -05:00
Makefile [8.x] refactor: update console commands for improved structure and functionality (#2209) 2026-05-13 15:05:04 -05:00
package-lock.json test(routeforge): pest + vitest coverage + service fixes 2026-05-24 11:55:36 -05:00
package.json test(routeforge): pest + vitest coverage + service fixes 2026-05-24 11:55:36 -05:00
phpstan.neon feat(schema-modernization): foundations for RouteForge 2026-05-23 12:05:09 -05:00
phpunit.xml test: force APP_ENV=testing in \$_SERVER too (fix 9 local test failures) 2026-05-23 12:05:09 -05:00
pint.json add oxlint and oxfmt 2026-03-18 23:17:18 +01:00
Procfile Working docker-compose files for development 2019-05-10 18:40:07 -05:00
README.md add oxlint and oxfmt 2026-03-18 23:17:18 +01:00
rector.php [8.x] feature: upgrade to Laravel 13 (#2204) 2026-05-06 11:27:21 -05:00
symfony.lock refactor: remove VaCentral package and update airport lookup implementation 2026-05-22 18:27:54 +02:00
tsconfig.json feat(routeforge): admin batch flight composer + lint pipeline 2026-05-24 11:55:33 -05:00
version.json add oxlint and oxfmt 2026-03-18 23:17:18 +01:00
vite.config.js feat(routeforge): admin batch flight composer + lint pipeline 2026-05-24 11:55:33 -05:00
vitest.config.ts test(routeforge): pest + vitest coverage + service fixes 2026-05-24 11:55:36 -05:00

phpVMS 8

Build StyleCI License

phpVMS is a PHP application to run and simulate an airline. It allowed users to register, view flight schedules that you create, and file flight reports, built on the Laravel framework. The latest documentation, with installation instructions is available on the phpVMS documentation site.

Installation

A full distribution, with all the composer dependencies, is available at this GitHub Releases link.

Requirements

  • PHP 8.3+, extensions:
    • cURL
    • JSON
    • fileinfo
    • mbstring
    • openssl
    • pdo
    • tokenizer
    • intl
    • zip
  • Database:
    • MySQL 5.7+ (or MySQL variant, including MariaDB and Percona)

View more details on requirements

Installer

  1. Upload to your server
  2. Visit the site, and follow the link to the installer

View installation details

Development Environment with Docker

A full development environment can be brought up using Docker and Laravel Sail, without having to install composer/npm locally

make docker-test

# **OR** with docker directly

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php84-composer:latest \
    composer install --ignore-platform-reqs

# Then you can start sail
./vendor/bin/sail up

Then go to http://localhost.

Instead of repeatedly typing vendor/bin/sail to execute Sail commands, you may wish to configure a shell alias that allows you to execute Sail's commands more easily:

alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'

Then you can execute php, artisan, composer, npm, etc. commands using the sail prefix:

# PHP commands within Laravel Sail...
sail php --version

# Artisan commands within Laravel Sail...
sail artisan about

# Composer commands within Laravel Sail...
sail composer install

# NPM commands within Laravel Sail...
sail npm run dev

To interact with databases (MariaDB, Redis...), please refer to the Laravel Sail documentation

Building JS/CSS assets

Yarn is required, run:

make build-assets

This will build all the assets according to the webpack file.

Laravel Boost

If you want to use AI agents for your development workflow, please ensure you install Laravel Boost by running the following command:

php artisan boost:install

Contributors

Thank you to everyone who've contributed to phpVMS!

contributors images