The first step is upgrading Sylius with Composer
composer require sylius/sylius:~1.4.0
- Change base
AbstractMigrationnamespace toDoctrine\Migrations\AbstractMigration - Add
: voidreturn types to bothupanddownfunctions - Copy this and this migration to your migrations folder or run
doctrine:migrations:diffto generate new migration with changes from Sylius
composer require symfony/dotenv:^4.2 --dev --no-update- Follow Symfony dotenv update guide to incorporate required changes in
.envfiles structure. Optionally, you can take a look at corresponding PR introducing these changes in Sylius-Standard
At the apply migrations with bin/console doctrine:migrations:migrate.
Don't forget to clear the cache (bin/console cache:clear) to be 100% everything is loaded properly.
If you're using Behat and want to be up-to-date with our configuration, introduce following changes (you can also take a look at SymfonyExtension UPGRADE file) for more details:
- Update required extensions with
composer require friends-of-behat/symfony-extension:^2.0 friends-of-behat/page-object-extension:^0.3 --dev - Remove extensions that are not needed with
composer remove friends-of-behat/context-service-extension friends-of-behat/cross-container-extension friends-of-behat/service-container-extension --dev - Update your
behat.yml- look at the diff here - Add
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],to yourbundles.php - Create
config/services_test.yamlfile with the following code and add these your own Behat services as well:imports: - { resource: "../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" }
- If you use our Travis CI configuration, create also
config/services_test_cached.yamland import theconfig/services_test.yamlfile:imports: - { resource: "services_test.yaml" }
- Remove all
__symfony__prefixes in your Behat services - Remove all
<tag name="fob.context_service" />tags from your Behat services - Make your Behat services public by default with
<defaults public="true" /> - Change
contexts_servicesin your suite definitions tocontexts - If you use our Travis CI configuration, follow these
and these changes introduced in
.travis.ymlfile
Firstly, check out the Sylius 1.3 upgrade guide to update Sylius version step by step. To upgrade to Sylius 1.4 follow instructions from the previous section with following changes:
- Change namespaces of copied migrations to
Sylius\Migrations
- These changes are not required, but can be done as well, if you've changed application directory structure in
1.2.xto1.3update
- Add
\FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle()to your bundles lists inAppKernel.php(preferably only intestenvironment) - Import Sylius Behat services in
app/config/config_test.ymland your own Behat services as well:imports: - { resource: "../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" }
- Not passing
Sylius\Component\Locale\Context\LocaleContextInterfaceinstance as the second argument toSylius\Bundle\LocaleBundle\Templating\Helper\LocaleHelper's constructor was deprecated