Codeception / module-symfony

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

Orphan Events assertion doesn't work using seeEventTriggered() #148

Closed Yarre closed 2 years ago

Yarre commented 2 years ago

As mentioned in the code Orphan Events can also be asserted but they don't exist in the provided Actual events array.

Reproduced with the following versions:

symfony/stopwatch                              v5.3.4 
symfony/web-profiler-bundle                    v5.3.8
symfony/framework-bundle                       v5.3.8
codeception/module-symfony                     2.0.5
TavoNiievez commented 2 years ago

Hi @yarre, can you please attach a reproducer for this issue? Maybe https://github.com/codeception/symfony-module-tests can help you achieve that.

Yarre commented 2 years ago

Hi @TavoNiievez, sorry. I am talking about seeEventTriggered() - can orphan events be asserted with this function?

TavoNiievez commented 2 years ago

@Yarre did you tried $I->seeOrphanEvent() ? That you can't use seeEventTriggered to assert about orphaned events is expected behavior.

The protected function you relate is used by both assertions, but that does not mean that both are interchangeable or fulfill the same function.

TavoNiievez commented 2 years ago

If you wish you can modify the documentation blocks to clarify this.

Yarre commented 2 years ago

Thank you, it can be closed.