babdev / supplier-plugin
为 Sylius 提供供应商处理。
v0.1.0
2018-08-21 00:58 UTC
Requires
- php: ^7.1
- sylius/sylius: ^1.0.4
Requires (Dev)
- behat/behat: ^3.3
- behat/mink: ^1.7
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/context-service-extension: ^1.0
- friends-of-behat/cross-container-extension: ^1.0
- friends-of-behat/service-container-extension: ^1.0
- friends-of-behat/symfony-extension: ^1.0
- friends-of-behat/variadic-extension: ^1.0
- lakion/mink-debug-extension: ^1.2.3
- phpspec/phpspec: ^3.2
- phpstan/phpstan-shim: ^0.9.2
- phpunit/phpunit: ^6.5
- se/selenium-server-standalone: ^2.52
- sylius-labs/coding-standard: ^1.0
- symplify/easy-coding-standard: ^2.4
README
Sylius 供应商插件增加了对供应商模型的支撑,可以用来扩展产品。
文档
有关 Sylius 插件开发的全面指南,请访问 Sylius 文档,在那里您可以找到插件开发指南,其中包含许多示例。
快速安装
-
运行
composer create-project sylius/plugin-skeleton ProjectName
。 -
从插件骨架根目录,运行以下命令
$ (cd tests/Application && yarn install) $ (cd tests/Application && yarn build) $ (cd tests/Application && APP_ENV=test bin/console assets:install public) $ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create) $ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
要设置插件数据库,请记住在 tests/Application/.env
和 tests/Application/.env.test
中配置数据库凭据。
使用
运行插件测试
-
PHPUnit
vendor/bin/phpunit
-
PHPSpec
vendor/bin/phpspec run
-
Behat(非 JS 场景)
vendor/bin/behat --strict --tags="~@javascript"
-
Behat(JS 场景)
-
启动无头 Chrome
google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
- 安装 SSL 证书(仅需要一次)并在
127.0.0.1:8080
上运行测试应用的 Web 服务器
symfony server:ca:install APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
- 运行 Behat
vendor/bin/behat --strict --tags="@javascript"
-
静态分析
-
Psalm
vendor/bin/psalm
-
PHPStan
vendor/bin/phpstan analyse -c phpstan.neon -l max src/
-
-
编码规范
vendor/bin/ecs check src
用您的插件打开 Sylius
-
使用
test
环境(cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=test bin/console server:run -d public)
-
使用
dev
环境(cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=dev bin/console server:run -d public)
安全
如果您认为您发现了此插件的安全问题,请通过电子邮件将有关该问题的信息发送至 michael.babker@gmail.com。请不要使用公共问题跟踪器报告安全问题。
许可证
Sylius 和此插件遵循 MIT 许可证。有关完整详情,请参阅LICENSE 文件。