Testing Examples 

Examples for writing functional and unit tests for the CKEditor Image Support extension.

Test Suites in the Extension 

The extension's own tests are the reference for writing tests against it:

  • Tests/Functional/Controller/SelectImageControllerTest.php - image dialog controller
  • Tests/Functional/Controller/ImageRenderingAdapterTypoScriptTest.php - frontend rendering via TypoScript
  • Tests/Unit/Database/RteImagesDbHookTest.php - DataHandler hook

They use the TYPO3 testing framework with PHPUnit attributes (#[Test]). Functional tests that need records load CSV fixtures with importCSVDataSet().

Run Tests 

Execute Test Suites 

# Unit tests (Build/phpunit/UnitTests.xml)
composer ci:test:php:unit

# Functional tests (Build/phpunit/FunctionalTests.xml, needs typo3DatabaseDriver=pdo_sqlite)
composer ci:test:php:functional
Copied!

Result: Automated testing suite ✅