locastic/sylius-catalog-promotion-plugin

Sylius 插件,允许您创建目录促销。


README

插件骨架

安装

  1. 运行 composer create-project sylius/plugin-skeleton ProjectName

  2. 从插件骨架根目录,运行以下命令

    $ (cd tests/Application && yarn install)
    $ (cd tests/Application && yarn run gulp)
    $ (cd tests/Application && bin/console assets:install web -e test)
    
    $ (cd tests/Application && bin/console doctrine:database:create -e test)
    $ (cd tests/Application && bin/console doctrine:schema:create -e test)

用法

运行插件测试

  • PHPUnit

    $ bin/phpunit
  • PHPSpec

    $ bin/phpspec run
  • Behat(非JS场景)

    $ bin/behat --tags="~@javascript"
  • Behat(JS场景)

    1. 下载 Chromedriver

    2. 使用之前下载的 Chromedriver 运行 Selenium 服务器

      $ bin/selenium-server-standalone -Dwebdriver.chrome.driver=chromedriver
    3. localhost:8080 上运行测试应用程序的 web 服务器

      $ (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web -e test)
    4. 运行 Behat

      $ bin/behat --tags="@javascript"

使用您的插件打开 Sylius

  • 使用 test 环境

    $ (cd tests/Application && bin/console sylius:fixtures:load -e test)
    $ (cd tests/Application && bin/console server:run -d web -e test)
  • 使用 dev 环境

    $ (cd tests/Application && bin/console sylius:fixtures:load -e dev)
    $ (cd tests/Application && bin/console server:run -d web -e dev)