Commit Graph
511 Commits
Author SHA1 Message Date
72c6dcc532 Fixes for 3 code quality findings (#3450)
* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* fix: add VERIFYPEER and VERIFYHOST to cspell ignoreWords

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/c79bcd25-22d6-424f-b7cb-b17b6ef16246

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-04-26 23:01:11 +01:00
Adam DaleyandCopilot Autofix powered by AI 9ba38e4fea Fixes for 2 code quality findings (#3448)
* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-26 22:11:02 +01:00
Adam DaleyandCopilot Autofix powered by AI f981ceb518 Fixes for 4 code quality findings (#3446)
* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-26 21:41:16 +01:00
Adam DaleyandCopilot Autofix powered by AI e2052adbb2 Fixes for 2 code quality findings (#3445)
* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/System/AdminTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-26 21:12:02 +01:00
Copilotandadmdly ade0c4d0c1 Fix bugs and typos in installer/pricing templates, improve System admin test coverage (#3444)
* Initial plan

* Fix HTML/JS bugs and typos in installer and pricing templates, improve test coverage

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/d16eb3f4-9538-40af-a14b-3f110fe8bed1

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-04-26 21:04:48 +01:00
52081d284a Improved type casting and removed unnecessary parameters (#3431)
* Cast ticket ID to integer

* Added type casting and removed unnecessary $per_page params

* Fixed tests

* Updated ddev PHP and nginx config

* Support ticket validation and upgrade checks

* Add order mock and constants in ServiceTest

* Require active status for API auth and clear tokens

* Validate client/admin sessions against DB

* Invalidate sessions on user status deactivation

* Check locale availability before toggling

* Escape database name properly

* Validate and cast rel_id to int in ticketCreateForClient to prevent TypeError

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/ce700346-2168-43cc-8309-fc6baee7cc82

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Improve rel_id validation error message to include the invalid value

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/ce700346-2168-43cc-8309-fc6baee7cc82

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix Notification AdminTest mock expectation to match actual paginateDoctrineQuery call

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/2fb587cf-6312-4b98-89e5-10f074646eaa

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Validate interface and custom interface inputs

* Tighten custom interface hostname validation

* Accept `per_page` in paginated API responses

* Validate HTTP interfaces and normalize upgrades

* Enforce active status and secure config export

* Cast rel_type/rel_task/rel_status to string in SupportTicketValidator to prevent TypeError

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/1ecf2bb3-1139-420f-8421-41ae8f6d1d5f

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Use FILTER_VALIDATE_INT instead of is_numeric for rel_id validation in Service.php

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/7bacd505-ba15-42da-8f52-7621afa1d634

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Validate rel_new_value as a positive integer before using as Product ID in upgrade tickets

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/842c7e1c-255b-4f09-8235-f34681e0392b

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Tighten `sValidHttpInterface` validation

* Add page parameter to pager calls

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-04-26 20:30:22 +01:00
Copilotandadmdly 230b285dd7 Fix SSL typo, invalid transaction status, and unsafe array access in APIHelper (#3399)
* Initial plan

* Fix typos, invalid transaction status, and unsafe array access in APIHelper

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/5ec74911-4de8-4620-a3e3-cd6e36a975fb

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix getHasSll typo in Directadmin.php to match baseline suppression

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/e74d2b4a-d375-4c99-b557-9050dc9f0c55

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-04-08 07:46:23 +01:00
FOSSBilling BotandFOSSBilling Bot 3b14e9214b Apply PHP Code Styling & Quality Changes (#3393)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2026-04-08 06:48:11 +01:00
Adam Daley 435944defa Refactor pagination and API with strict types and validation (#3391)
* Add strict types; refactor pagination, tools & API

* Replace `Box_Paginator` with FOSSBilling `Paginator`

* Clarify paginator comment wording

* Validate JSON response and include HTTP code

* Cast language params to bool and add JSON preview
2026-04-06 22:06:13 +01:00
2f22c210ab Apply PHP Code Styling & Quality Changes (#3285)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2026-03-04 07:11:16 +00:00
Adam DaleyandCopilot Autofix powered by AI 5dffd5af9a Fixes for 2 code quality findings (#3280)
* Apply suggested fix to tests/Modules/Support/GuestTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/Support/GuestTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-02-27 21:48:25 +00:00
Copilotandadmdly e0ee5c5cf6 Improve test robustness in Support GuestTest (#3278)
* Improve test robustness in Support GuestTest

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix error message strings to match actual API responses

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-02-27 21:24:00 +00:00
Adam DaleyandCopilot Autofix powered by AI 74d24d4d1f Fixes for 2 code quality findings (#3274)
* Apply suggested fix to tests/Modules/Support/GuestTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests/Modules/Support/GuestTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-02-27 21:04:44 +00:00
Belle Aerni 982703d0b3 Reduce invoice & guest hash entropy (#3242)
* Reduce invoice & guest hash entropy

* Update GuestTest.php

* derp
2026-02-26 01:21:41 +00:00
Belle Aerni 6ce3bbae06 Introduce some simple phone number validation (#3186)
* Introduce some simple phone number validation

* Expanded client creation tests to include phone numbers

* Update Admin.php

* Addressed the review

* Ran CS fixes

* Fixed
2026-01-28 12:57:27 -08:00
b41aad26ce Migrated the Currency module to Doctrine (#2963)
* Migrated the Currency module to Doctrine

* Caching and other improvements

* Types, error handling and other improvements

* Don't return false but throw an exception

* Types

* Refactor currency model usage to new Currency entity

* Remove Fastnetmon submodule

Deleted the Fastnetmon submodule from src/modules. This change may be part of a cleanup or migration away from using Fastnetmon as a submodule.

* Refactor currency API admin get test

* Fix failing Currency-related tests after Doctrine migration

Updated test files to work with the new Doctrine-based Currency implementation.

* Refactor currency retrieval to use repository

* Refactor Currency database handling in several services and tests

* Replace anonymous class mocks with standard PHPUnit mocks in Invoice tests (#3037)

* Refactor currency retrieval and currency service

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Confirm updateCurrencyRates() method signature alignment (#3034)

* Add null check for currency in Cart::toApiArray to prevent fatal error (#3035)

* Initial plan

* Add null check for currency in toApiArray method

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Initial plan

* Replace anonymous class mocks with standard PHPUnit mocks for consistency

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix incorrect getRateByCode call in Order service (#3039)

* Initial plan

* Fix getRateByCode call and add null check with proper exception

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix silent failure in Currency::getBaseCurrencyRate when currency not found (#3040)

* Initial plan

* Throw exception when currency not found in getBaseCurrencyRate

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Use FOSSBilling\Exception for currency conversion rate failures (#3041)

Use FOSSBilling\Exception for conversion rate fetch failures

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Remove problematic reflection usage in Cart service tests (#3042)

Remove problematic reflection usage in Cart test

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Update tests-legacy/modules/Cart/Api/GuestTest.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Entity/Currency.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Use FOSSBilling\Exception for null currency check in Cart service (#3058)

* Initial plan

* Use FOSSBilling\Exception for null currency check in Cart service

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Use consistent error message for default currency not found

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Remove silent fallback in CurrencyRepository::findDefault() (#3057)

* Add logging for default currency fallback behavior

- Log warning when no default currency is found and falling back to ID 1
- Log critical error when neither default currency nor ID 1 exists
- Clarify return type documentation
- Cache result even if null to avoid repeated warnings

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Remove silent fallback to currency ID 1 in findDefault()

Instead of silently falling back to currency ID 1 when no default
is found, the method now returns null and lets callers handle it.

This addresses the feedback about the silent fallback hiding
configuration issues. All existing callers already properly handle
null by throwing exceptions, so this change makes the error
visible rather than hidden.

Benefits:
- No silent failures hiding misconfiguration
- Cleaner separation of concerns (repositories for data access only)
- Better adherence to Doctrine repository pattern
- All callers already handle null appropriately

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Remove redundant documentation in findDefault()

Simplified @return annotation to avoid redundancy with the description.

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix Currency entity getId() to handle uninitialized state (#3059)

Make Currency::getId() return nullable int to prevent runtime errors

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Remove static cache from CurrencyRepository to fix long-running process issues (#3061)

* Initial plan

* Remove static cache from CurrencyRepository to fix long-running process issues

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix inconsistent null handling in CurrencyRepository::getRateByCode callers (#3062)

* Fix null handling in Invoice/Service.php getRateByCode call

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix Invoice test to mock getRateByCode with valid return value

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Refactor Qwen `settings.json` structure and update version

* Verify null handling consistency in CurrencyRepository::getRateByCode (#3073)

Initial plan

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Update src/modules/Order/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Repository/CurrencyRepository.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Improve return type annotation for Currency Admin API get_pairs method (#3075)

* Initial plan

* Improve return type annotation for get_pairs method in Currency Admin API

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix return type description to accurately reflect the return format

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix nullable type inconsistency in Currency entity setCode/getCode methods (#3074)

* Initial plan

* Fix nullable type in Currency entity setCode and getCode methods

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix PHPUnit test failures by updating mock return values for getCode

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Restore deleted Cart API Guest tests for Doctrine Currency migration (#3076)

* Initial plan

* Restore deleted Cart API Guest tests and update for Doctrine Currency migration

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix testAddItemSingle mock to return boolean instead of cart object

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Refactor currency handling in `Cart` and `Invoice` services

Updated `Cart` and `Invoice` services to consistently use `CurrencyRepository` for retrieving currency entities and default currency. Improved error handling for missing currencies and updated related tests to mock new repository methods. Also fixed minor typos and improved code clarity in tests.

* Refactor currency handling in `Cart` Service

Replaced direct property access of currency code and conversion rate with getter methods in `Cart` Service. This improves encapsulation and consistency when handling currency-related operations.

* Update src/modules/Cart/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests-legacy/modules/Order/ServiceTest.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Service.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Currency/Entity/Currency.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix exception signature and type hint in `Currency` service

Updated the exception thrown in `validateCurrencyForma`t to include a null second parameter for compatibility. Also added a return type to the closure in `Cart` `ServiceTest` for better type safety.

* Refactor currency selection logic in `Cart` Service

Improves clarity by separating client currency retrieval and default currency fallback. Ensures that the default currency is only checked and exception thrown if both client and default currencies are unavailable.

* Add precision handling and caching for Currency conversionRate property (#3082)

* Add documentation and caching for conversionRate precision handling

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Use sprintf for float-to-string conversion to avoid scientific notation

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix Doctrine identity map caching issue when changing default currency (#3081)

* Fix Doctrine identity map caching issue in setAsDefault method

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Store currency code before clearing identity map to avoid detached entity access

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix PHPUnit test for setAsDefault method by mocking findOneByCode and clear

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Refactor currency test mocks for static data providers

Replaces direct mock object creation in static data providers with string flags or placeholders, enabling proper mock instantiation within test methods. Updates test signatures and logic to handle these flags, improving test maintainability and compatibility with PHPUnit static context constraints.

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2025-12-24 02:28:57 +00:00
Adam Daley a9b903c222 Codebase modernisation, configuration cleanup, and improved type safety (#2957)
* Refactor tests to replace depreciated functions

* Update Rector config and dependencies

* Rector: Add explicit string casting for stricter type safety

* Rector: Add return type hints to methods across codebase

* Rector: Increase dead code level and refactor invoice item logic

* Remove unnecessary `willReturn` from test mocks

Eliminate redundant `willReturn(null)` and similar calls from PHPUnit mock setups in legacy module tests, leaving only method expectations. Also update some test values to use floats for consistency.

* Refactor API controller and email adapter return values

* Update formatting and guidelines in `AGENTS.md`
2025-10-11 23:39:44 +01:00
Adam DaleyandCopilot 315f9f3944 Refactor Filesystem and Path handling (#2836)
* Removed legacy files

* Refactor Filesystem and Path handling

* Removed `FOSSBilling\Tools` legacy functions

* Update live-tests to include file check for `php_error.log`

* Update Extension module tables to fix wrapping issue

* Apply suggestions from @Copilot

Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Extension module icon URL handling

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-09 21:50:11 +01:00
Belle Aerni 07698df6be Re-enable the network interface tests (#2810)
* Re-enable the network interface tests

I am pretty sure a Symfomy HTTP client bug was causing the issue we saw. Some time ago they published fixes related to the BIND_TO option with IPv6

* We actually should expect the result to be empty here
2025-07-07 08:48:59 -07:00
Adam Daley 9771bd8f1f [Draft] Restore live-test Health Checks (#2634)
Restore live-test Health Checks
2025-03-10 18:45:40 +00:00
Adam Daley 43d1969f68 Refactor initial application loading (#2626)
* Refactor initial application loading

Refactor `load.php` to simplify loading, clarify loading, and to use available Symfony components. Additionally, update `index.php` as appropriate.

Add Symfony HttpFoundation as supporting dependency and for future functionality.

* Remove or disable problematic and unused functions

* Restore required FOSSBilling\Event function

* Remove / disable problematic unused functions

* Restore required FOSSBilling\Event function

* Refactor initial application loading

Refactor `load.php` to simplify loading, clarify loading, and to use available Symfony components. Additionally, update `index.php` as appropriate.

Add Symfony HttpFoundation as supporting dependency and for future functionality.

* Remove or disable problematic and unused functions

* Restore required FOSSBilling\Event function

* Remove / disable problematic unused functions

* Restore required FOSSBilling\Event function
2025-03-06 00:55:20 +00:00
Belle Aerni 45db4910a7 PHP 8.4 prep (#2464)
* Update CI for PHP 8.4

* Update composer deps for PHP 8.4

* Updates

* This is the default mode and this constant causes test failutes

* Explicily install the PDO extensions

* Temporarily downgrade the live tests to PHP 8.3

It would seem that there is some kind of problem with PHP 8.4 in regards to these tests. I believe it is outside of our control however as it installs fine for me with PHP 8.4 under DirectAdmin

* Update to address deprecations

* Make that nullable

* Fixed my typo

* Bump PHPunit to v11

* Also take care of two minor things

* Formatting fix
2024-11-21 23:16:29 -08:00
Adam Daley c0cc400b9d Fix Live Tests (#2325)
* Refactor `getExternalIP()` to use `RetryableHttpClient`

Refactor `FOSSBilling\Tools` `getExternalIP()` function to use `RetryableHttpClient`.

* Fix incorrect parameter names and add cURL timeout

* Disable Network Interface live-tests
2024-07-02 21:20:10 +01:00
FOSSBilling BotandFOSSBilling Bot 2b02c0c1a2 Apply PHP Code Styling & Quality Changes (#2323)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-07-02 20:00:28 +01:00
Belle Aerni 945a201572 Small Currency Improvements (#2311)
* Removed the hardcoded currencies list

Also streamlined the process of adding new currencies by allowing the title & exchange rate to automatically be determined.

* Use an existing translatable string

* Update the test workflows

* Dropped the legacy test, wrote two new ones

* Fixed a typo in my assert

* Whooooops
2024-06-27 09:48:37 -07:00
Belle Aerni 917b812835 Trying to resolve / workaround sporadic failures (#2313) 2024-06-26 11:59:13 -07:00
Belle Aerni 075c809881 Updated our rector configs (#2224)
* Some rector config work

* Increased type coverage, added dead code
2024-04-09 00:51:42 -07:00
FOSSBilling BotandFOSSBilling Bot a89fc342a7 Apply PHP Code Styling & Quality Changes (#2205)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-03-26 06:04:50 -07:00
Belle Aerni 57c173fe7d Fixed some errors with the previous update (#2203)
* Fixed a couple of new errors

* Missed two other spots

* I am very slightly confused as to that error
2024-03-22 19:55:03 -07:00
Belle AerniandJohn @ S4 037acce702 Bulk fix of many grammar / phraseology mistakes (#2166)
* Bulk fix of many grammar / phraseology mistakes

* Small fixes after self-review

* Corrections

* Update mod_currency_settings.html.twig

* Update mod_currency_settings.html.twig

* Update mod_formbuilder_field.html.twig

---------

Co-authored-by: John @ S4 <64874788+John-S4@users.noreply.github.com>
2024-02-27 03:01:07 -08:00
Jaap Marcus 83c2f3620b Password generated can have a small change to have no lower case aswell (#2148) 2024-02-16 15:55:03 -08:00
Belle Aerni a3c3a1ed6e Ensure random passwords meet the requirements (#2145)
I made a mistake when I setup the random password generation for the live tests and forgot that `bin2hex(random_bytes(6));` wasn't guaranteed to actually generate something with a number, this change fixes that to ensure one will be set.
2024-02-15 14:52:46 -08:00
FOSSBilling BotandFOSSBilling Bot db8ed5f4d8 Apply PHP Code Styling & Quality Changes (#2126)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-02-08 16:25:53 -08:00
Belle Aerni 0493c3a3e5 Further test improvements (#2122)
* Slight structure change to the testcases

* Fix

* Ported some random low-level tests

* Spelling

* Ported over some other low-level tests

* Fixes

* And now other fixes

* Another one
2024-02-06 13:13:04 -08:00
Belle Aerni 6e438b1a59 Add a option to disable public tickets (#2113)
* Add a option to disable public tickets

* Replaced legacy test, written a new one

* Fix an unrelated error that appeared in the error log
2024-02-02 12:18:46 -08:00
FOSSBilling BotandFOSSBilling Bot 33cfc4f793 Apply PHP Code Styling & Quality Changes (#2097)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-01-24 05:36:10 -08:00
Belle Aerni cca0515491 Transfer carts when logging in (#2083)
* Transfer the cart when logging in

* Wrote a test for it

* This should at least fix one of the tests

* Oops

* Wrong spot...

* Ah-ha!
2024-01-21 16:00:41 +01:00
Belle Aerni 8f4d0d4cac More tests and CI improvements (#2078)
* Wrote a few more tests, improvements

* Ran Rector & PHP-CS-Fixer

* Append a capital letter to the test client passwords

* Minor tweaks

* Display more info after the tests run

* Oops, I forgot to set the dir

* Fix cron behavior for test env, dropped legacy tests

* Rename the empty test suite so PHPUnit ignores it

* Update cspell.json

* Minor tweaks to the tests

* Fixes
2024-01-17 18:11:45 -08:00
Belle Aerni 76b32a6026 Feat: allow selection of the default network interface (#2065)
* Feat: allow selection of the default network interface

* Update cspell.json

* Wrote some tests, moved the setting to the config file

* Cleanup, fixes, include Sentry in the bind setting

* Use JS to update the IP rather than reload, minor tweaks

* UI tweaks

* Removed leftover incomplete sentence, mention interface names
2024-01-17 01:46:32 -08:00
FOSSBilling BotandFOSSBilling Bot 8f3740b691 Apply PHP Code Styling & Quality Changes (#2073)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-01-16 04:25:38 -08:00
Belle Aerni b061d5da04 Implemented a new class for config management (#2066)
* Implemented a new class for config management

* Run Rector & PHP-CS-Fixer

* Spelling

* Pointed a bunch of code to the new class

* Fix tests, removed 2 broken ones that did nothing

* Quick run of PHP-CS-Fixer

* Fixed issues noticed in self review

* Updated remaining old methods. Fixed minor error page issue

* Very minor code tweak

* Fixes, added a related test

* Check for OPCache functions being defined

* I don't think this timeout is needed
2024-01-15 14:12:53 -08:00
Belle Aerni 1b0fba1922 Various additional tests (#2069)
* Various additional tests

* Fixes

* More fixes

* Fixed my other mistakes

* Final fix
2024-01-15 00:46:19 -08:00
Belle Aerni ccc97a3ec9 Initial implementation of CI against a live FOSSBilling Install (#2067)
* Rename tests to tests-legacy

* Groundwork for live tests

* Somewhat working tests on a live instance

* Hmmmmmm

* Fix

* Fixed the other bug

* Added a handful of various tests

* Typos, all these are admin endpoints

* Bypass this check for testing envs

* Disable it for now

* Mini cleanup

* Cleanup from debugging, ran PHP-CS-Fixer
2024-01-14 22:51:32 -08:00
Belle Aerni 7bb98f5ffd Re-run PHP-CS-Fixer and (Hopefully) Fix Rector for GHA (#2061)
* Changed Rector parallel config. Hoping to resolve GHA issue

* Re-run Rector and PHP-CS-Fixer
2024-01-12 16:43:45 -08:00
Robert Thomas a69cdf7350 Implement passwordLength field for service hosting generated accounts (#2040)
* Implement `passwordlength` field for service hosting generated accounts
Fix testing DirectAdmin connections (it previously did nothing)

* Revert unintended change from the previous PR

* Fix changes not saving to db

* Fix `passwordlength` not showing everywhere

* Remove stray debug line

* Fix: passwords being incorrectly set to 7 asterisks when an order is uncancelled

* Requested changes + typo fix

* Include `passwordlength` as ignored term

* Fix typo change oversight

* Minor code clarity improvements

* Type safety for the `passwordlength` and `port` fields

* Fallback to the original model value

* Remove default value for new servers, to show the placeholder

* Improve customer UI
Increase padding for service hosting management tabs
Include missing badge styling for `canceled` orders

* More consistent button colours for orders

* Rename `passwordlength` to `passwordLength`
Remove `activate` and `uncancel` tests for now as they don't really work

* Remove spelling ignore for `passwordlength`

* Restore missing `$httpClient` variable

* Resolve comments

* More thorough port validation

* Fix errors caused by fixing the previous merge conflicts through the GH web interface
2024-01-13 00:35:06 +01:00
Belle Aerni 32d011225b Rector & PHP-CS-Fixer Improvements (#2047)
* Added the rector cache to the action

* Enabled PHP-CS fixer for the tests & library folder

* Use the PHP-CS-Fixer Cache

* Fix the tests

* Ensure the Sentry placeholder isn't messed up from CS changes

* Typo..
2024-01-08 00:10:00 +00:00
Samuel Apraku 76935bac0a Fix transactions search query (#2010)
* Fix transactions search query

* Fix test
2023-12-26 15:34:15 -08:00
Belle Aerni 59027a10f4 Add a configurable cron API guest endpoint (#1909)
* Add a configurable cron API guest endpoint

* PHPDoc changes

* Fix the test, added a last run check
2023-12-02 18:44:13 -08:00
Belle Aerni e39fad02b6 Fix tests (#1912) 2023-12-01 21:12:58 -08:00
Belle Aerni be36d68f61 Restructure the redirect after login functionality (#1897)
* Restructure the login after redirect functionality

* Initialize the session in the start of the app

* Fix the test

* That 100% needs to come after the fallback patcher
2023-11-29 08:45:55 +02:00