Codeception / module-yii2

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

[Yii2] [Exception] No content was sent from Yii application (DELETE method) #26

Closed drlibra closed 2 years ago

drlibra commented 4 years ago

What are you trying to achieve?

Execute sendDELETE() method of REST module.

What do you get instead?

[Exception] No content was sent from Yii application

Details

Suite is configured as stated here: https://codeception.com/for/yii#api-tests

actor: ApiTester
modules:
    enabled:
      - REST:
          url: /
          depends: Yii2
      - \Helper\Api
    config:
      - Yii2

As far as I understand there is a check that something have to be returned https://github.com/Codeception/base/blob/3.1/src/Codeception/Lib/Connector/Yii2.php#L363, but in case of DELETE method there is no any output, so this condition should not be applied.

Naktibalda commented 4 years ago

Please make pull request to https://github.com/Codeception/module-yii2/ to fix it.

SamMousa commented 3 years ago

No, the check only fails if response content is non empty and the data we captured is. So in your case, you are probably setting the response content in your code, which makes no sense for a delete method handler.