Skip to content

[TEST] LegalDocuments: Replace mock with stub for simpler testing - #12355

Open
mjansenDatabay wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
mjansenDatabay:hotfix/12/ldocs-test-stubs
Open

mjansenDatabay wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
mjansenDatabay:hotfix/12/ldocs-test-stubs

Conversation

@mjansenDatabay

Copy link
Copy Markdown
Contributor

Simplified the test setup by substituting mock with stub where strict expectation verification is unnecessary. Updated related helper methods to accommodate stub creation.

@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Nov 2, 2026

@lscharmer lscharmer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all notes must be fixed the only required ones are:

  • Bug in ContainerMock::mockTree where $with_expectation is not propagated.
  • Typehint doc blocks when the called method already declares the returned type completely ($this->stub(...))

@lscharmer lscharmer assigned mjansenDatabay and unassigned lscharmer Nov 2, 2026
@mjansenDatabay
mjansenDatabay force-pushed the hotfix/12/ldocs-test-stubs branch from 81533f2 to 64a7e33 Compare November 2, 2026 14:08
Use stubTree/mockTree split, stub helpers, and mapExpecting for single Map
calls. Chain set/add in hasPublicPageWithGotoLink via mockMethod per review.
@mjansenDatabay
mjansenDatabay force-pushed the hotfix/12/ldocs-test-stubs branch from 64a7e33 to ff1234e Compare November 5, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants