On 5 February 2018 at 10:53, Marco Pivetta <ocram...@gmail.com> wrote:

>
> See https://externals.io/message/101745#101752
>
> The problem is always with routines (not  functions)) that rely on shared
> global mutable state.
>
> Mocking those is generally a problem, as it exposes a dependency inversion
> issue, rather than actually getting rid of an implicit reliance on global
> state that is not declared to consumers of a SUT.
>

While that would be a perfectly fine justification for not adding this
feature, it doesn't address the impact of removing the feature now that it
has existed for over 8 years. Even before the feature is actually removed,
anyone using such tests would be faced with the following options:

* Put up with hundreds of notices until they have a chance to completely
refactor the code in question.
* Suppress all messages of a particular level (possibly E_STRICT initially
and E_DEPRECATED later) until they have the chance to refactor.
* Prepend \ to global function references, purely to stop the deprecation
notices, and break all tests that relied on this mocking mechanism.

None of these options is particularly appealing, and this will all be for a
hypothetical future improvement to the language.

Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to