riconet / extension-skeleton
0.8.6
2019-03-06 16:28 UTC
Requires
- php: ^7.0
README
需要了解的
- 此项目假设您正在使用gitlab来托管您的扩展。
- 当前厂商定义是静态的(这很快就会改变,不用担心。)
- 目前不支持Windows。
描述
此Composer项目是为了简化创建新扩展的过程,适用于CMS TYPO3。此设置包含创建扩展常用的文件和文件夹。它还提供配置,以运行单元和功能测试,并包含一个完整的gitlab-ci.yml。
如何创建新扩展 / 如何使用此项目
打开您的shell,导航到即将创建的扩展的目录。执行以下命令,并记得为您的扩展定义一个名称。
composer create-project riconet/extension-skeleton my_new_extension
如何运行测试
在扩展根目录中编写一些测试文件后,运行composer install。这将创建一个名为.Build
的新文件夹。此文件夹包含一个链接到您的扩展的TYPO3实例、测试执行的shell脚本和docker-compose.yml。您还可以运行代码质量检查以检查您的源代码。要运行测试,请执行脚本Build/Scripts/runTests.sh
。
如何使用runTests.sh脚本
要执行脚本,请在扩展根目录中运行./Build/Scripts/runTests.sh
。
无参数:使用PHP 7.2运行所有单元测试
选项
-s
Specifies which test suite to run
- composerInstall: "composer install", handy if host has no PHP, uses composer cache of users home
- composerValidate: "composer validate"
- functional: functional tests
- lint: PHP linting
- unit (default): PHP unit tests
- code-quality: executes code quality checks (phpstan, phpcs, phpmd).
-p <7.2|7.3>
Specifies the PHP minor version to be used
- 7.2 (default): use PHP 7.2
- 7.3: use PHP 7.3
-e "<phpunit options>"
Only with -s functional|unit
Additional options to send to phpunit (unit & functional tests).
Starting with "--" must be added after options starting with "-".
Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests
named "canRetrieveValueWithGP"
-x
Only with -s functional|unit
Send information to host instance for test or system under test break points. This is especially
useful if a local PhpStorm instance is listening on default xdebug port 9000. A different port
can be selected with -y
-y <port>
Send xdebug information to a different port than default 9000 if an IDE like PhpStorm
is not listening on default port.
-u
Update existing typo3gmbh/phpXY:latest docker images. Maintenance call to docker pull latest
versions of the main php images. The images are updated once in a while and only the youngest
ones are supported by core testing. Use this if weird test errors occur. Also removes obsolete
image versions of typo3gmbh/phpXY.
-v
Enable verbose script output. Shows variables and docker commands.
-h
Show this help.
示例
使用PHP 7.2运行单元测试:
/Build/Scripts/runTests.sh
使用PHP 7.3运行单元测试:
./Build/Scripts/runTests.sh -p 7.3