Commit Graph

40 Commits

Author SHA1 Message Date
Nabeel Shahzad
deb7afa3f8
test: force APP_ENV=testing in \$_SERVER too (fix 9 local test failures)
Root cause: shell APP_ENV=development leaks into \$_SERVER via PHP's
variables_order=EGPCS. phpunit.xml <env force> sets \$_ENV + putenv()
but NOT \$_SERVER. Dotenv's RepositoryBuilder default adapter order
puts ServerConstAdapter before EnvConstAdapter — so \$_SERVER wins.

Consequences when env() returns 'development' during tests:
- runningUnitTests() = false (checks app['env'] === 'testing')
- PreventRequestForgery middleware doesn't bypass → POST/PUT → 419
  (6 RegistrationTest failures + 1 UserTest profile update failure)
- Filament/Livewire panel behaviour differs → fillForm validation
  fires on stale state (2 Flight resource tests)

Fix: also force \$_SERVER['APP_ENV']='testing' via <server> directive.
PHPUnit treats <server> + <env> as separate superglobals.

Local: 460/9 → 471/0 (no other changes). CI unaffected (CI shell
doesn't export APP_ENV so \$_SERVER was already empty).
2026-05-23 12:05:09 -05:00
Nabeel Shahzad
bec9dde009
chore(testing): force phpunit env vars over .env
Without force="true", phpunit `<env>` only sets when the var is
absent from $_ENV. Devs with DB_CONNECTION/DB_DATABASE in their
local .env silently get those instead of sqlite/:memory:, leading
to confusing 'no such table' errors when tests run against the
wrong connection. force="true" makes the test config authoritative.
2026-04-26 12:20:36 -05:00
Nabeel Shahzad
463140709a
revert(testing): restore Laravel-standard bootstrap
Custom test bootstrap, RefreshDatabase trait override, and dedicated
sqlite-cleanup machinery were overengineered. Restore vendor/autoload.php
bootstrap, :memory: sqlite, plain TestCase, and standard Pest setup as
shipped before ef94e03f. Existing tests unchanged.

Reverts bootstrap portions of ef94e03f and all of 6f6a083d, 18c119b3.
2026-04-26 11:54:25 -05:00
Nabeel Shahzad
6f6a083dc9
fix(testing): clean sqlite databases per test run 2026-04-25 16:46:19 -05:00
Nabeel Shahzad
ef94e03f30
fix(airport): restore legacy search behavior and harden test bootstrap 2026-04-25 14:54:04 -05:00
Arthur Parienté
379a9b38cc
[8.x] feat: improve tests suite (#2166)
* wip

* fix simbrief tests

* more fixes

* run pint

* fix(tests): fake notifications in registration test

* refactor(tests): AI suggestions and performance improvements

* deprecation warning with PHP85

* fix(tests): fake notifications in access with valid invite test

* refactor(build): optimize autoload and remove unnecessary commands

* refactor(tests): update PHPUnit configuration and improve test structure

* refactor: put GeoJson under the right namespace
2026-03-18 16:35:19 -05:00
Arthur Parienté
9bf5473a70
[8.x] migrate to pest (#2048)
* update packages

* add type coverage

* more pest plugins

* update ci

* fix parallel testing

* run rector
2025-06-21 10:57:51 -05:00
Arthur Parienté
11747da6ba
[8.x] New Admin Interface, Laravel 11 Upgrade and Vite Upgrade (#1953)
* LatestPirepsChart Widget

* Apply fixes from StyleCI

* Fix Pirep widgets

* Add missing icons

* Migrate permission system to spatie and add filament shield

* Apply fixes from StyleCI

* Fix AircraftResource

* Use global RelationManagers when possible

* Apply fixes from StyleCI

* Update Maintenance page

* Update AirlineResource

* Add emptyStateActions

* Apply fixes from StyleCI

* Fix SubfleetResource

* Update Resources

* Apply fixes from StyleCI

* Add Filament Cluster

* Publish Filament Assets

* Use RichEditor for notes and descriptions

* Add Filament Global Search

* Apply fixes from StyleCI

* Remove old admin interface

* Update old admin theme (for backward compatibility)

* Add UpdatePending Middleware to Admin Dashboard

* Add OldModulesLinks widget

* Apply fixes from StyleCI

* Fix Edit Module

* Update arthurpar06's fork of coolsam/modules

* Enable shield auto-discovery

* Update arthurpar06's fork of coolsam/modules

* Update arthurpar06's fork of coolsam/modules

* Make sure only super_admins can edit roles

* Update arthurpar06's fork of coolsam/modules

* Apply fixes from StyleCI

* Remove role permissions from ShieldSeeder

* Move the upgrade role system migrations to a single one. Make previous admin users admin again

* Fix fares relationship pivot

* Fix drop table order for roles migrations

* Run the ShieldSeeder on install

* Remove sample module from old module links

* Fix permission upgrade migration

* Apply fixes from StyleCI

* Migrate from webpack to vite

* Fix missing icons in login

* Fix leaflet-bar on hover

* Fix sass division

* Build new assets

* Update brand name

* Apply fixes from StyleCI

* Add link to frontend in admin

* Apply fixes from StyleCI

* Add user avatar in filament

* Use tabs for settings

* Apply fixes from StyleCI

* Fix composer.lock

* Add backups page in admin

* Apply fixes from StyleCI

* Fix Flight Level in FlightResource

* Hot reload for filament in local

* Improve global search in admin

* Apply fixes from StyleCI

* Upgrade to filament 3.1

* Update filament

* Fix dev seeds

* Add migrations for roles and permissions

* Apply fixes from StyleCI

* Delete temp tables after new roles import

* Add missing permission checks

* Add more sortable/searchable fields

* Use ActionGroup in PirepResource

* Add UsersRelationManager in AwardResource

* Apply fixes from StyleCI

* Add sortable and searchable to AwardResource

* Apply fixes from StyleCI

* Rework PirepResource form

* Apply fixes from StyleCI

* Fix recordUrl in PirepResource

* Add aircraft button in subfleet edit page

* Add placeholders for pivot

* Add Fare > Flight relationship

* Update modules stub

* Update arthurpar06's fork of coolsam/modules

* Apply fixes from StyleCI

* Fix modules stub replacements

* Add Favicon to Filament

* Remove webpack dependencies

* Delete cache files

* Fix composer.lock

* Allow more control over custom Pirep Fields

* New actions in Maintenance

* New Aircraft Fields

* Upgrade to vite 5

* Upgrade to tailwindcss 3.4

* Move import roles and permissions to migrations data

* Apply fixes from StyleCI

* Upgrade to filament 3.2

* Upgrade filament

* Add InviteResource

* Add ability to create user from admin

* Apply fixes from StyleCI

* Fix composer.json

* Update composer.lock

* Update composer.lock

* Fix composer.lock

* Add ActivityLog to filament

* Apply fixes from StyleCI

* Upgrade dependencies

* Fix OldModulesLinksWidget

* Add access_admin gate

* Update filament plugins

* Update seeders and migrations related to permissions upgrade

* Upgrade filament

* Add unsaved changes alerts

* Remove laravelcollective/html

* Use fork for queueworker/sansdaemon

* Remove laravelcollective/html provider

* Bump dependencies

* Add mariadb db driver

* Apply fixes from StyleCI

* Update money config file

* wip

* Add ModuleLinksPlugin

* Add permissions check in ModuleLinksPlugin

* Remove OldModulesLinks Widget

* Update AdminPanelProvider stub

* Apply fixes from StyleCI

* Fix webcron id cache

* Remove some old controllers

* Add ajax calls for airports in admin

* Update Dependencies

* Hide internal userfields in admin

* Fix Expenses

* Add ability to edit news

* Apply fixes from StyleCI

* Add optimize in maintenance

* Add update app to maintenance

* Add installer in filament

* Node dependencies upgrade

* Fix new installer

* wip

* Add LegacyImporter

* Add Updater

* Add pages slugs

* Remove system link from module links

* Update redirect url

* Add migrations output to installer

* Update system middleware links

* Remove old system

* Some fixes

* Apply fixes from StyleCI

* Fix InstalledCheck middleware

* Improve Installer Page

* Apply fixes from StyleCI

* Fix Installer

* Add more types to system pages

* Add some phpdocs

* Apply fixes from StyleCI

* Update composer.lock

* Add ability to add multiple ranks to a subfleet at once

* SimBrief Airframes & Aircraft Weight Casting in filament

* Apply fixes from StyleCI

* Update primary color

* Upgrade packages (for security reasons)

* Upgrade some npm packages

* Apply fixes from StyleCI

* Upgrade to vite v6

* Use FiltersForm in Finances and migrate AirlineFinanceTable to a TableWidget

* Apply fixes from StyleCI

* Add missing policies

* Apply fixes from StyleCI

* Fix ShieldSeeder namespace

* Update composer.lock

* Remove v7 migrations

* Do not seed roles via yaml

* Update installer

* Apply fixes from StyleCI

* Migrate queueworker/sansdaemon

* Fix Finance Widgets

* Apply fixes from StyleCI

* Update ability middlewares

* remove old admin views

* make columns toggleable in AirportResource

* update sail and docker to php84

* update php versions in build

* upgrade packages to support php8.4

* fix: Implicitly marking parameter ... as nullable is deprecated, the explicit nullable type must be used instead

* fix: Implicitly marking parameter ... as nullable is deprecated, the explicit nullable type must be used instead

* add missing pagination for old admin

* Apply automatic changes

* update composer.lock

* update AdminPanelProvider stub

* update UserResource icon

* hide internal user fields

* Add go back to app in admin panel provider stub

* Apply automatic changes

* Update ModuleLinksPlugin

* Add ModuleSetupFilament command

* Apply automatic changes

* Change migrations date to ensure good order

* Update composer.lock

* Migrate create_phpvms_table migration to laravel 11 syntax

* Don't show in progress, draft and cancelled pireps in admin

* Add missing 's' in ranks navigation label

* Don't create old role tables on fresh installs

* Add back default

* Redirect /update to /system/update

* Change news default pagination

* fix admin link in nav

* fix permissions for updater

* fix permissions for updater

* Lint code

* Remove PHP 8.1 from workflow

* fix findUsersOnLeave

* update composer.lock

* Update role export

* Fix export table names

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: ArthurHetem <arthurhetemgames@gmail.com>
Co-authored-by: arthurpar06 <arthurpar06@users.noreply.github.com>
2025-01-16 10:24:26 -06:00
Arthur Parienté
edeed76d6b
Upgrade Dependencies (#1839)
* Fix CVEs in phpseclib

* Fix CVEs in composer

---------

Co-authored-by: Nabeel S. <nabeelio@users.noreply.github.com>
2024-07-15 15:41:02 -05:00
Arthur Parienté
110e6b584b
Upgrade to PHPUnit 10 (#1764)
* Remove sempro/phpunit-pretty-print

* Bump PHPUnit dependencies

* Bump nunomaduro/collision and filp/whoops

* Update phpunit.xml

* Change setUp to protected

* Remove --verbose option

* Update phpunit.xml

* Remove Bootstrap

* Add types in tests

* Make tests class final

* Remove unused variables

* Add .phpunit.cache to .gitignore

* Apply fixes from StyleCI

* Update phpunit.xml

* Break tests (to test CI/CD)

* Revert "Break tests (to test CI/CD)"

This reverts commit 928b199bc4ee09238f83f33cc7c12304992368ab.

* Update composer.lock

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2024-02-21 13:43:35 -06:00
Nabeel S
12848091a2
Laravel 9 Update (#1413)
Update to Laravel 9 and PHP 8+

Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
2022-03-14 11:45:18 -04:00
Nabeel S
ede5b74383
Make fuel_used an optional field in PIREP file (#1197) 2021-05-21 10:02:07 -04:00
Nabeel S
3800c01d94
Update to Laravel 8 (#1058)
* Update Laravel and other dependencies

* Composer version in CI

* Remove the PHP exit from env file

* Add PHP 8 to testing matrix

* Update doctrine

* Update doctrine

* Update faker lib

* Rewrite TLD check to remove deprecated library

* Update version lib

* Remove PHP 8 for now

* Style fixes
2021-03-04 17:08:51 -05:00
nabeelio
8fc0aec800 Set cache driver to array for tests 2021-02-25 13:50:37 -05:00
Nabeel S
48087fb05f
Metar: TEMPO and trend causing issue with values being overwritten (#862)
Metar: TEMPO and trend causing issue with values being overwritten
2020-10-10 14:55:12 -04:00
Nabeel Shahzad
c46fc9171c Check for airline being active; fix tests for L7 #718 2020-05-23 11:45:07 -04:00
Nabeel Shahzad
6078163d75 Initial pass at Laravel 7 support #673 2020-05-15 18:20:23 -04:00
Nabeel Shahzad
8998dabb3d Drop the unique index from subfleets.type #628 2020-03-09 16:39:07 -04:00
Nabeel S
23eb9dcbda
384 Laravel 6 changes (#385)
* 384 Laravel 6 changes

* Library versions

* Update package versions

* Add keyType to models

* Remove unused dependencies

* StyleCI fixes

* Fix models for test

* Fix tests output and update test runner

* Unused imports

* Update exceptions handler

* Fix login page
2019-09-13 08:05:02 -04:00
Nabeel S
6018a6dcaa
Add Contract interface for airport lookup functionality (#365)
* Add Contract interface for airport lookup functionality

* style ci fixes
2019-08-22 14:32:49 -04:00
Nabeel S
182aabf426
Refactor error handling internally to follow RFC7807 (#362)
* Refactor error handling internally to follow RFC7807

* style fixes
2019-08-21 08:17:44 -04:00
Nabeel S
9f3ba05880
Issue/329 refactor seeding (#337)
* Fix Contracts class names

* Refactoring of the file seeds so it's not a mess

* StyleCI fixes
2019-08-05 08:27:53 -04:00
Nabeel Shahzad
047a72f3da Force cache to array 2019-05-12 10:50:52 -05:00
Nabeel Shahzad
c102a0d858 Refactor all of the unit conversion code 2018-04-07 20:52:12 -05:00
Nabeel Shahzad
2090f05236 Composer dep updates 2018-03-29 14:24:36 -05:00
Nabeel Shahzad
699883f2fc Update dependencies, remove ide_helper generating always 2018-03-25 16:19:24 -05:00
Nabeel Shahzad
ecfda6de15 Add collision for test listeners and remove one old dep 2018-02-12 09:02:05 -06:00
Nabeel Shahzad
3b53f884d1 db cleanup/try phpunit with in-memory tests 2017-12-06 11:25:41 -06:00
Nabeel Shahzad
24c42c2e22 ignore output during tests 2017-11-23 10:03:01 -06:00
Nabeel Shahzad
7aabcda779 ignore warning about risky tests 2017-11-23 10:02:23 -06:00
Nabeel Shahzad
de91b133e7 travis - stop supressing output 2017-07-13 15:23:55 -05:00
Nabeel Shahzad
5527fb3d64 more fixes for travis 2017-07-13 14:29:46 -05:00
Nabeel Shahzad
dd6a45e567 fuu travis(x3) 2017-07-13 14:03:19 -05:00
Nabeel Shahzad
75bfe99820 trying again to get phpunit to output errors 2017-07-13 13:53:14 -05:00
Nabeel Shahzad
870eefb83d #21 Some more fixes for PIREPs 2017-07-04 13:57:08 -05:00
Nabeel Shahzad
70dbfbcd3f #21 clean up the tests 2017-07-04 13:09:44 -05:00
Nabeel Shahzad
4608e02598 skip tests that aren't working/redone (yet) 2017-07-04 01:12:55 -05:00
Nabeel Shahzad
7a79a8558e some refactoring for tests and adding some tables 2017-06-09 22:19:17 -05:00
Nabeel Shahzad
616f44f9c5 phpunit env vars 2017-06-08 22:39:38 -05:00
Nabeel Shahzad
106d6a6798 laravel base files 2017-06-08 13:28:26 -05:00