Feature #72062

Mocking of concrete methods in abstract classes

Added by Stefan Rotsch almost 4 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Tests
Target version:
-
Start date:
2015-12-04
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

TYPO3 allows unit testing of protected methods in abstract classes, PHPUnit allows mocking of concrete methods in abstract classes.

I stumbled upon a case where I needed the best of both worlds, so I'd like to extend BaseTestCase::getAccessibleMockForAbstractClass by an additional parameter for specifying which methods should be mocked.


Related issues

Duplicated by TYPO3 Core - Task #69019: Allow to mock concrete methods of abstracts classes when mocking abstract class using @getAccessibleMockForAbstractClass@. Closed 2015-08-13

Associated revisions

Revision f81f223e (diff)
Added by Stefan Rotsch almost 4 years ago

[FEATURE] Mocking of concrete methods in abstract classes

Allows mocking of concrete methods when testing protected functions
in abstract classes.

Introduces a new parameter which will be passed to the corresponding
PHPUnit method when creating a mock object of an abstract class.

Change-Id: I9cbe510633300184666c6204a4d0c5be7d417ef4
Resolves: #72062
Releases: master
Reviewed-on: https://review.typo3.org/45130
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Helmut Hummel <>
Tested-by: Helmut Hummel <>

History

#1 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45130

#2 Updated by Anonymous almost 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#3 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF