- Require and install the plugin
- Run
composer require friendsofsylius/sylius-exchange-rate-plugin --dev
- Add plugin dependencies to your AppKernel.php file:
public function registerBundles()
{
return array_merge(parent::registerBundles(), [
...
new \Florianv\SwapBundle\FlorianvSwapBundle(),
new \FriendsOfSylius\SyliusExchangeRatePlugin\FOSSyliusExchangeRatePlugin(),
]);
}
sylius_grid:
templates:
action:
import_exchange_rates: "@FOSSyliusExchangeRatePlugin/importAction.html.twig"
grids:
sylius_admin_exchange_rate:
actions:
main:
import:
type: import_exchange_rates
florianv_swap:
providers:
# choose the provider you want, for example google finance
# for the full list of options see:
# https://github.com/florianv/symfony-swap/blob/master/Resources/doc/index.md#builtin-providers
google_finance: ~
fos_sylius_exchange_rate: ~
sylius_exchange_rate:
resource: "@FOSSyliusExchangeRatePlugin/Resources/config/routing.yml"
-
Import configured exchange rates
$ bin/console sylius:import-exchange-rates
-
Test application install
$ composer install $ (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 (non-JS scenarios)
$ bin/behat features --tags="~@javascript"
-
Behat (JS scenarios)
-
Download Chromedriver
-
Run Selenium server with previously downloaded Chromedriver:
$ bin/selenium-server-standalone -Dwebdriver.chrome.driver=chromedriver
-
Run test application's webserver on
localhost:8080
:$ (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web -e test)
-
Run Behat:
$ bin/behat features --tags="@javascript"
-
-
Using
test
environment:$ (cd tests/Application && bin/console sylius:fixtures:load -e test) $ (cd tests/Application && bin/console server:run -d web -e test)
-
Using
dev
environment:$ (cd tests/Application && bin/console sylius:fixtures:load -e dev) $ (cd tests/Application && bin/console server:run -d web -e dev)