Task #43145

Integrate possibility to call inaccessible methods in BaseTestCase

Added by Oliver Hader almost 7 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Tests
Target version:
Start date:
2012-11-20
Due date:
% Done:

100%

TYPO3 Version:
6.0
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

The BaseTestCase already has a possibility to create full blown accessible object proxies.
However if one does not want to have the class stack cluttered with temporary existing classes, there shall be a possibility to directly invoke protected/private methods of a fixture object.

The new method callInaccessibleMethod method is taken and rewritten from ModuleControllerTest.

Example to use it in unit tests:
$this->fixture = new \TYPO3\CMS\Core\SomeClassName();
$result = $this->callInaccessibleMethod($this->fixture, 'privateMethod', $first, $second, $third, ...);

Associated revisions

Revision b92539c5 (diff)
Added by Oliver Hader almost 7 years ago

[TASK] Integrate possibility to call inaccessible methods in BaseTestCase

The BaseTestCase already has a possibility to create full blown
accessible object proxies. However if one does not want to have
the class stack cluttered with temporary existing classes, there
shall be a possibility to directly invoke protected/private
methods of a fixture object.

The new method callInaccessibleMethod method is taken and
rewritten from ModuleControllerTest.

Example to use it in unit tests:
$this->fixture = new \TYPO3\CMS\Core\SomeClassName();
$result = $this->callInaccessibleMethod(
$this->fixture,
'privateMethod',
$first, $second, $third, ...
);

Change-Id: I2c90c136c350129b28809d8b8b88286149894a10
Resolves: #43145
Releases: 6.0
Reviewed-on: http://review.typo3.org/16598
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

History

#1 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16598

#2 Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16598

#3 Updated by Oliver Hader almost 7 years ago

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

#4 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF