Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.24 KB

tests.md

File metadata and controls

54 lines (35 loc) · 1.24 KB

Test the plugin

We are using Behat, PHPSpec and PHPUnit to test this plugin.

How to run the tests

From the plugin root directory, run the following commands:

$ (cd tests/Application && yarn install)
$ (cd tests/Application && yarn run gulp)
$ (cd tests/Application && bin/console assets:install public -e test)

$ (cd tests/Application && bin/console doctrine:database:create -e test)
$ (cd tests/Application && bin/console doctrine:schema:create -e test)

To be able to setup a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.

Usage

Running plugin tests

  • PHPUnit

    $ bin/phpunit
  • PHPSpec

    $ bin/phpspec run
  • Behat

    $ bin/behat

Opening Sylius with this plugin

  • Using test environment:

    $ (cd tests/Application && bin/console sylius:fixtures:load -e test)
    $ (cd tests/Application && bin/console server:run -d public -e test)
  • Using dev environment:

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