DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Writing tests for extensions with extbaseΒΆ
Note: These instructions assume that you're using extbase >= 1.3.
For testing extbase-based extensions, your testcases need to
extend Tx_Extbase_Tests_Unit_BaseTestCase
instead of
Tx_Phpunit_TestCase
. This makes sure that the extbase autoloader
gets activated correctly.
If you are testing repository classes or any class that instantiates a
repository class, you will need to provide any repository instance
with a mock of Tx_Extbase_Object_ObjectManagerInterface
(or you you
skip the original constructor when creating a mock of a repository).