Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 1.16 KB

2023-01-12-make-kerneltestbehaviour-compatible-with-mailerassertionstrait.md

File metadata and controls

30 lines (26 loc) · 1.16 KB
title issue author author_email author_github
Make KernelTestBehaviour compatible with Symfony MailerAssertionsTrait
NEXT-25500
Rafael Kraut
rk@vi-arise.com
RafaelKr

Core

Change all getKernel and getContainer methods related to KernelTestBehaviour trait to static.

This makes it compatible with Symfony\Bundle\FrameworkBundle\Test\MailerAssertionsTrait.
The MailerAssertionsTrait was introduces with Symfony 4.4
https://symfony.com/blog/new-in-symfony-4-4-phpunit-assertions-for-email-messages

Also make the methods static in Shopware\Tests\Bench and Shopware\Tests\Unit\Storefront\DependencyInjection\ReverseProxyCompilerPassTest


Upgrade Information

Changes to KernelTestBehaviour trait

If you defined method getKernel and/or getContainer for anything using the Shopware\Core\Framework\Test\TestCaseBase\KernelTestBehaviour trait, make them static:

abstract protected function getKernel(): KernelInterface;

abstract protected function getContainer(): ContainerInterface;

to

abstract protected static function getKernel(): KernelInterface;

abstract protected static function getContainer(): ContainerInterface;