Codeception / module-yii2

Codeception module for Yii2 framework
MIT License
16 stars 36 forks source link

if [yii\filters\ContentNegotiator] is in `bootstrap` it does not work #101

Open mikk150 opened 2 months ago

mikk150 commented 2 months ago

IF I want to use yii\filters\ContentNegotiator in bootstrap(as it implements yii\base\BootstrapInterface and therefore I should be able to do so)

It unfortunately does not work as

Therefore it does not work

There are 2 solutions how to fix it

  1. Move Request making to L345 and remove L355-L363 entirely
  2. yii\filters\ContentNegotiator::bootstrap() should only register eventHandler on yii\base\Application on beforeAction event and handle it's own yii\filters\ContentNegotiator::beforeAction()
samdark commented 2 months ago

I'd go way 1 since that's not touching framework itself. Do you have time for implementation?