[TASK] Enable mock of ResourceFactory in ContentObjectRenderer 21/24821/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 15 Oct 2013 20:48:59 +0000 (22:48 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 15 Oct 2013 21:19:42 +0000 (23:19 +0200)
commit684acdd316ada696c10ecf2d0daa58544ab9d2e7
tree98ccd4bc9e7ccf0f9b5495f6dd0c7e90231a8009
parent60670fb61adcb2efce33b46218f6613d141a5b20
[TASK] Enable mock of ResourceFactory in ContentObjectRenderer

ext:frontend ContentObjectRenderer calls ResourceFactory::getInstance
at various places. This static call can not be mocked and is a hard
dependency to FAL.
The patch encapsulates the static call in a method and uses this
to mock instances of the ResourceFactory within some tests to have
controlled return values.
As a side effect one test does not fail anymore if only the
ext:frontend tests are executed and not the whole test suite. The
according hook-test was renamed and now tests the method that calls
the hook directly.

Change-Id: I0ee75462b7e7f25f70c6c8fb132045084b9ac537
Resolves: #52868
Resolves: #52643
Releases: 6.2
Reviewed-on: https://review.typo3.org/24821
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php