Skip to content

test: add phpunit tests#288

Open
whplh wants to merge 4 commits into
feature/v2.5.0from
HKI-126-test-api-endpoint
Open

test: add phpunit tests#288
whplh wants to merge 4 commits into
feature/v2.5.0from
HKI-126-test-api-endpoint

Conversation

@whplh
Copy link
Copy Markdown
Contributor

@whplh whplh commented Apr 21, 2026

Adds example tests for external api.
Run tests: ./bin/env ci:phpunit

@whplh whplh requested a review from Neunerlei April 21, 2026 07:55
@Neunerlei
Copy link
Copy Markdown
Collaborator

This will break so hard agains: https://github.com/hawk-digital-environments/HAWKI/tree/feature/v2.5.0
Please delay this for a while.

@Neunerlei Neunerlei changed the base branch from development to feature/v2.5.0 April 21, 2026 07:58
@whplh whplh force-pushed the HKI-126-test-api-endpoint branch from 7a96ab1 to 57a17eb Compare April 28, 2026 08:07
@whplh
Copy link
Copy Markdown
Contributor Author

whplh commented Apr 28, 2026

I rebased the branch to feature/v2.5.0 and updated the new test.
fyi the tests from feature/v2.5.0 do not run successfully in the service container. If they run locally they depend on some local setup/settings or models in the db.

@whplh whplh force-pushed the HKI-126-test-api-endpoint branch 3 times, most recently from 32b47e8 to 5bdfa4d Compare April 28, 2026 09:03
…#287)

Add tests for devtooling and make php debug setup configurable from env.

Refs: HKI-126
@whplh whplh force-pushed the HKI-126-test-api-endpoint branch from 5bdfa4d to 48eeb0c Compare April 28, 2026 09:06
@whplh
Copy link
Copy Markdown
Contributor Author

whplh commented Apr 28, 2026

(~ sry took me some rounds to cleanup the rebase.)

@whplh whplh force-pushed the HKI-126-test-api-endpoint branch from b2ec545 to ff518d4 Compare April 29, 2026 08:55
@whplh
Copy link
Copy Markdown
Contributor Author

whplh commented Apr 29, 2026

The pr now includes fixes and tests for the app:token and app:removeuser commands

@whplh
Copy link
Copy Markdown
Contributor Author

whplh commented Apr 29, 2026

@Neunerlei fyi I cannot login as a testUser on this branch any more.
The login can be handled by handleLogin, but then the code crashes here because the test user is not in the database: https://github.com/hawk-digital-environments/HAWKI/blob/development/app/Http/Controllers/AuthenticationController.php#L103-L105

@whplh
Copy link
Copy Markdown
Contributor Author

whplh commented Apr 29, 2026

Ok the token creation was not fully fixed. And since the service was mocked in tests it did not show up.
Turns out dependency injection can cause issues with dynamic data. The user in the constructor was never the actual user that was used in the command.
~ I moved the injection "one level up" to the AuthFactory ( and updated the tests)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants