Review main Merged

95276[TASK] Use stubs for test doubles without expectations, part 2

Benni Mack CR +2 V +2 Hard +341 −365 updated 08/12/26, 10:06

Commit message

Continuation of #110279: a test double that only configures return
values is a stub, not a mock. Only doubles that assert how often or
with which arguments a method is called need to be mock objects.

Migrate the remaining doubles that never set up an invocation
expectation from createMock() and getMockBuilder()->getMock() to
createStub(), and follow through on the naming and the types:

* rename the affected variables, properties and helper methods from
  "mock" to "stub"

* change intersection types and return types from MockObject&Foo to
  Stub&Foo accordingly

This moves another 276 doubles, leaving createMock() only where an
expectation is actually asserted.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Wouter Wolters +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Wouter Wolters +1
    • core-ci +1 CI

Issues 1

Files 85

Show 65 more files

Review log 89

  1. Benni Mack uploaded patch set 1 08/12/26, 06:16

  2. core-ci voted on patch set 1 V +1 08/12/26, 06:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106490

  3. Wouter Wolters voted on patch set 1 CR +1 V +1 08/12/26, 07:55

  4. Oliver Klee voted on patch set 1 CR +1 V +1 08/12/26, 08:07

  5. Benni Mack voted on patch set 1 CR +2 V +2 08/12/26, 08:10

  6. Benni Mack voted on patch set 1 CR 0 V 0 08/12/26, 08:10

  7. Georg Ringer voted on patch set 1 CR +1 V +1 08/12/26, 10:01

  8. Benni Mack voted on patch set 1 CR +2 V +2 08/12/26, 10:06

  9. Benni Mack merged patch set 2 08/12/26, 10:06