Codeception / module-phalcon4

Phalcon 4 module for Codeception
https://codeception.com/docs/modules/Phalcon4
MIT License
3 stars 8 forks source link

request service should be removed before changing his definition #7

Closed Druid33 closed 3 years ago

Druid33 commented 4 years ago

Without this change its not possible fill content to request body using _request() method.

I add some more info:

I had problem set json content to _request() method. After some research, diging into code i realize, it is not possible replace shared service with other shared service. One can replace shared service only with non-shared service.

$di->set('service', {some_definition}, true);
// this line does not change service.
$di->set('service', {some_other_definition}, true);
// this line change service
$di->set('service', {some_other_definition}, false);

Its not possible change shared service with "array' notation like this:

$di->set('service', {some_definition}, true);
// this line does not change service.
$di['service'] =  {some_other_definition};

Using "array" notation you only change service definition. but if shared service is resolved before, changing definition has not effect on next geting service

ruudboon commented 4 years ago

Thnx @Druid33 Can you add a few tests for this as well?

Related to: https://github.com/phalcon/cphalcon/pull/14834

Druid33 commented 4 years ago

ok, I try to find some time :)

Druid33 commented 3 years ago

Thnx @Druid33 Can you add a few tests for this as well?

Related to: phalcon/cphalcon#14834

Hi, finally i write test i promise a year ago...hope it will be enough.

Jeckerson commented 3 years ago

@Druid33 Thanks!

Jeckerson commented 3 years ago

Released in https://github.com/Codeception/module-phalcon4/releases/tag/v1.0.6