[TYPO3-dev] TestDrivenDevelopment & Typo3

Oliver Klee typo3-german-02 at oliverklee.de
Thu Oct 22 12:59:37 CEST 2009


Hi,

Michael Knoll schrieb:
> So here's my question: Is there an easy way to write tests that require
> TS configuration in order to create objects that should be tested? Are
> there any experiences?

For my pibase-based-extensions, I just provide the configuration array
to ...pi1:main() in my test cases.

Have a look at the "seminars" extension (from SVN as the tests are not
in he TER) about how we do this.

> I suppose for FE plugins, I still have to emulate a FE session, for
> which I have already written helper classes, so that should be no problem.

You can use the oelib extension which provides a class testingFramework
which can create a fake FE, create dummy records (including TS template
records and page records) and clean it all up afterwards. There are
plans for moving this class to the phpunit extension, too.

> As I want to run my tests without even putting an instance of a plugin
> on a page, I think that using Page IDs with Typoscript in my testcode is
> a rather dirty way - isn't it?

Yes, that's dirty indeed. :-)



Oliver




More information about the TYPO3-dev mailing list