-
In Extbase, there is a default naming scheme to map model names to database table names. As we currently don't use these for historic reasons, the mapping needs to be reconfigured:
- ext_typoscript_setup.txt is for compatibility with TYPO3 v9.
- Classes.php is for TYPO3 v10 onwards.
polyfillExtbaseClassesForTYPO3v9
(defined in Helper.php) is used for TYPO3 v9 compatibility with the expression language functiongetDocumentType()
(DocumentTypeFunctionProvider.php).
To simplify this, we may consider to rename database tables according to the default naming scheme.
The TCA field 'sys_language_uid' of table 'tx_dlf_collections' is defined as the 'languageField' and should therefore use the TCA type 'language' instead of TCA type 'select' with 'foreign_table=sys_language' or 'special=languages'.
Instead of calling $this->forward() the controller action must return a ForwardResponse
The current solution does only work with TYPO3 9 and 10.
As of TYPO3 10 a new pagination API has been introduced. This could be used as replacement in a release supporting TYPO3 10 and 11.
https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/Pagination/Index.html
Before running any of the tests, please install the project dependencies. Choose which version of TYPO3 you would like to test against.
# If you use PHP 7.3 or 7.4 (supported by Kitodo)
composer update --with=typo3/cms-core:^10.4
# If you use PHP 8
composer install-via-docker -- -t 10.4
composer install-via-docker -- -t 11.5
# Run all tests
composer test
# Run specific kind of tests
composer test:unit
composer test:unit:local # Run using locally installed PHP
composer test:func
# Run tests in watch mode
composer test:unit:watch
composer test:func:watch
Unit tests may be run either via a locally installed Composer / PHP setup, or within a Docker container.
# Run locally
vendor/bin/phpunit -c Build/Test/UnitTests.xml
# Run in Docker
Build/Test/runTests.sh
Build/Test/runTests.sh -w # Watch mode
Functional tests may only be run in Docker as they require more infrastructure to be set up.
Build/Test/runTests.sh -s functional
Build/Test/runTests.sh -s functional -w # Watch mode
To learn about available options (e.g., to select the PHP version), check the usage info:
Build/Test/runTests.sh -h
You may also interact with the Docker containers directly:
cd Build/Test/
vim .env # Edit configuration
docker compose run unit
docker compose run functional
docker compose down
- Datasets may be created, for example, by exporting records from MySQL Workbench.
- When writing datasets, please use
uid
s that are easy to search (grep
) for, and that ideally prevent merge conflicts. Some test cases use random nine-digit numbers (rand(100000000, 999999999)
).
Build/Test/
: Test-related setup files (e.g. configuration for PHPUnit and testing container)Tests/
: Test cases. In unit tests, namespacing follows the structure ofClasses/
.Tests/Fixtures
: Datasets to use in functional tests.
Build the documentation using the docs:build
script with Composer. This
script generates the documentation using the rendering tool for Typo3 and
places it in the Documentation-GENERATED-temp
folder.
composer docs:build
Take a look at the documentation by opening the file Index.html
in the folder
Documentation-GENERATED-temp
in your browser.
Starts the HTTP server and mounts the mandatory directory Documentation-GENERATED-temp
.
composer docs:start
Take a look at the documentation by opening http://localhost:8000 in your browser.
The server runs in detached mode, so you will need to stop it manually.
composer docs:stop
Generate the database reference table:
composer install
composer docs:db
The documentation container runs as a non-root user. If there are some problem regarding
the permission of container user you can link the UID and GID of host into the container
using the --user
parameter.
Example:
docker run --rm --user=$(id -u):$(id -g) [...]
In the docs:build
Composer script, this parameter is already included.
If any issues arise, you can adjust or remove it as needed.
The default documentation directory name is Documentation-GENERATED-temp
.
If you want to change the directory name add the --output
parameter at the
end of the building command.
Example:
[...] --config ./Documentation --output="My_Documentation_Directory"