Codeception / module-symfony

Codeception module for testing apps using Symfony framework
MIT License
89 stars 24 forks source link

no $data for seeEventTriggered & dontSeeEventTriggered #170

Closed dqualmann closed 10 months ago

dqualmann commented 1 year ago

Since symfony/http-kernel 6.3.0 \Symfony\Component\HttpKernel\DataCollector\EventDataCollector has a new property $defaultDispatcher. Now it is no longer possible to use $eventCollector->getCalledListeners, $eventCollector->getNotCalledListeners or $eventCollector->getOrphanedEvents without a filled param $dispatcher because Symfony\Component\HttpKernel\Profiler\Profiler::loadProfileFromResponse fill not this new property.

Alternative it is possible to use \Symfony\Component\HttpKernel\DataCollector\EventDataCollector::getData.

Currently this error occurs:

[Error] Typed property Symfony\Component\HttpKernel\DataCollector\EventDataCollector::$defaultDispatcher must not be accessed before initialization

StackTrace:

#1 /app/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php:100
#2 Codeception\Module\Symfony->dontSeeEventTriggered
TavoNiievez commented 10 months ago

Hi @dqualmann ,

A few days ago I released version 3.2.0 of this module and this was one of the issues that was fixed.

Could you check again if everything works as expected?

Thanks!

dqualmann commented 10 months ago

Hey,

i have been using this version since last Friday. And I was able to remove my quick fix and everything is now running as expected with Symfony Kernel 6.4.

Thanks.