Bug: system/Config/BaseService.php getSharedInstance() will not return mocks with non-lowercase key #2534
Labels
bug
Verified issues on the current code behavior or pull requests that will fix them
Direction
We use github issues to track bugs, not for support.
If you have a support question, or a feature request, raise these as threads on our
forum.
Describe the bug
system/Config/BaseService.php injectMock() method converts argument $name to lowercase,
but getSharedInstance() does not, which leads to BaseService not returning mocks with name containing uppercase letter.
CodeIgniter 4 version
4.0.0-rc.3,
Develop [checkout @ 2020.02.09 09:05]
Affected module(s)
CodeIgniter\Config\BaseService
Expected behavior, and steps to reproduce if appropriate
Steps to reproduce:
create a pair of classes, e.g MyClass and MockMyClass
add method to Config\Services, e.g.:
Create a test case that injects MockMyClass
Expected behaviour: Services should return instance of MockMyClass
Actual behaviour: Services returns new (shared) instance of MyClass
The text was updated successfully, but these errors were encountered: