Non PSR-4 compliant test class namespace #4828

Closed
opened 2026-02-05 09:18:59 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @LordSimal on GitHub (Jun 17, 2024).

Describe the Bug

After a composer install command it shows the following warnings:

Class Activity\WebhookCallTest located in ./tests/Activity/WebhookCallTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping.
Class Activity\WebhookFormatTesting located in ./tests/Activity/WebhookFormatTesting.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping.
Class Activity\AuditLogApiTest located in ./tests/Activity/AuditLogApiTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping.
Class Activity\WebhookManagementTest located in ./tests/Activity/WebhookManagementTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping.
Class Activity\AuditLogTest located in ./tests/Activity/AuditLogTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping.

Steps to Reproduce

  1. Download latest Bookstack (24.05.2 as of right now)
  2. perform a composer install with PHP 8.3 and composer 2.7.7

Expected Behaviour

No PSR autoloading warnings on composer install

Screenshots or Additional Context

This can be fixed rather easily by adjusting the namespace of e.g. tests/Activity/WebhookCallTest.php (and all other files from above) from

namespace Activity;

to

namespace Tests\Activity;

since the Tests namesapce is defined in the composer.json

Browser Details

No response

Exact BookStack Version

24.05.2

Originally created by @LordSimal on GitHub (Jun 17, 2024). ### Describe the Bug After a `composer install` command it shows the following warnings: ``` Class Activity\WebhookCallTest located in ./tests/Activity/WebhookCallTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping. Class Activity\WebhookFormatTesting located in ./tests/Activity/WebhookFormatTesting.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping. Class Activity\AuditLogApiTest located in ./tests/Activity/AuditLogApiTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping. Class Activity\WebhookManagementTest located in ./tests/Activity/WebhookManagementTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping. Class Activity\AuditLogTest located in ./tests/Activity/AuditLogTest.php does not comply with psr-4 autoloading standard (rule: Tests\ => ./tests). Skipping. ``` ### Steps to Reproduce 1. Download latest Bookstack (24.05.2 as of right now) 2. perform a `composer install` with PHP 8.3 and composer 2.7.7 ### Expected Behaviour No PSR autoloading warnings on `composer install` ### Screenshots or Additional Context This can be fixed rather easily by adjusting the namespace of e.g. `tests/Activity/WebhookCallTest.php` (and all other files from above) from ``` namespace Activity; ``` to ``` namespace Tests\Activity; ``` since the `Tests` namesapce is defined in the composer.json ### Browser Details _No response_ ### Exact BookStack Version 24.05.2
OVERLORD added the 🐛 Bug label 2026-02-05 09:18:59 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4828