简体   繁体   中英

How can I use SQLite for PHPUnit Functional Testing in TYPO3 9LTS

Since TYPO3 9.4 [1] there is support for SQLite in TYPO3, This is recommended for small websites, development environments or testing.

But I don't know how to use this in testing context, the MySQL I've used for ages like this TYPO3_PATH_WEB=$PWD/.Build/Web typo3DatabaseName=database typo3DatabaseHost=localhost typo3DatabaseUsername=root typo3DatabasePassword=root .Build/bin/phpunit -c config.xml Tests/Functional

I'm looking into this option with the hope of being able to speed up my functional testing, which I currently finds to slow.

1) https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.4/Feature-85256-InstallTYPO3OnSQLite.html

You need sqlite on the server or in the docker container where you run your tests and then simply set

typo3DatabaseDriver=pdo_sqlite

as environment variable in front of your command. That's sufficient to run your tests with sqlite.

I've written an article where I cover this too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM