Skip to content

[LiveComponent] Use test stubs instead of mocks - #3823

Open
smnandre wants to merge 1 commit into
symfony:3.xfrom
smnandre:fix/live-component-test-deprecation
Open

[LiveComponent] Use test stubs instead of mocks#3823
smnandre wants to merge 1 commit into
symfony:3.xfrom
smnandre:fix/live-component-test-deprecation

Conversation

@smnandre

Copy link
Copy Markdown
Member
Q A
Bug fix? no
New feature? no
Deprecations? no
Documentation? no
Issues Fix #...
License MIT

PHPUnit 12 emits a notice for every mock object created without an expectation, since such
an object is a stub rather than a mock. The LiveComponent suite triggers 23 of them.

  • Replaces 16 createMock() calls with createStub() across 3 test files
  • None of them had expects(), method() or willReturn(): all were constructor fillers
  • Notices drop from 23 to 4

LiveCollectionTraitTest still trigger 4 notices, but this must be fixed in symfony/form

@smnandre smnandre added the Bug Bug Fix label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants