I'm trying to understand concepts of Functional Testing in a scope of TYPO3 and overall.
My intention is to test Controller of my extension. For simplicity let's imagine, that it has only two methods: listAction()
and addAction($object)
.
I've checked some Core tests and one of them was EnableFieldsTest
from Extbase, which does following: loads some special crafted extension, simulates FE (via special JsonRenderer.ts
), which calls listAction()
of that extension and the output (specail JSON) is examined then.
So, I decided to do same with my Controller, simulated FE, which called my listAction()
. The only difference is that my extension doesn't use JSON View, but usual Fluid, which produces HTML.
To make it work as expected I need either:
HasRecordConstraint
from the Core, but simply examine HTML, that was output with assertContains()
, which also seems hacky.Therefore I'm stuck at this point and need to understand:
addAction($object)
and ensure, that f.e. a request to a REST service is made, should I stub that Service or I can catch a call somehow different?Since TYPO3 8, acceptance tests are integrated which are more the thing you want to have.
The best would be to check out the acceptance tests of the core.