Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101768 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53671 invoked from network); 5 Feb 2018 10:53:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2018 10:53:55 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wm0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:39924] helo=mail-wm0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/FA-49805-1C7387A5 for ; Mon, 05 Feb 2018 05:53:53 -0500 Received: by mail-wm0-f51.google.com with SMTP id b21so24953641wme.4 for ; Mon, 05 Feb 2018 02:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=w7H9Iv3eRMZxNlxQ9/OCI4gXTxqBA9ZOhdGbMghgbGE=; b=e+3fyuxP6tM3R7Xxgu9qwm1s2gn7XmlHyuJ1oGLotnNCCFcj8MJx0vuPEeFOSoQHlH pI7sze946haGmEKCxugXYqXvO9oZcOqoN8XaGJRyIZmTx3705m1iGm13C35OR9TD0IWB edTUUTQD7E5GSW/+COxD4+r0Taic4xqdg3ICRIbDZpg5VgV2apK6GZTtwqJ6UvEDNAyW BvJX2futjkP/VmlAlSTpboWA8p9V2sbWyATBIqK6EG24wNCpL5gMFU9N+Q8vE8Rv1lZo agkFl3TFi1fd0l/xSpj+btKv960on9rsg/Xs7u5Ol7d+v7hD/hGmC5PIKRs5kJ9Isjts l+3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=w7H9Iv3eRMZxNlxQ9/OCI4gXTxqBA9ZOhdGbMghgbGE=; b=cLVuKxpalIggwSMQT27y8gzOEJDQOAc9xAfzl97CpRlzakUYjvJfEz1JGHJVNojC+5 qgkjMbUYUoz0GjEzod5npDiHFLaV8Fq0BYTtkkka1yZv2SmoLMPp9PsLf2WIjIUqj2ys Me7mmmDhZPWCPe7eg0ktV2lNnm8UGDnbMgogzvx8CkQp1VzeNxiXIXyt0bN3VO/CiPKb HgEzvHlOTcPMwmJyvrJrpWT080zWk5MfyU7OeUCcI5om4sON9k46CV4Nkwn9KzCaCXsR 5XRXPz6r+sng9xjgf/e9v4FX/Y3LEUssYTTy7N07Ih2s1ph1eH0TyYUCDCVjE4nbN2JN xElw== X-Gm-Message-State: AKwxyteSUAmJ4SkJebmqMX3Ffn8sm1fMF0Swno69aZqEkMfUCop07Kgm Wjh8jxgKBXbLyNk2tdzhrnq6Z3GlHuIcW7+n3zc= X-Google-Smtp-Source: AH8x226DUv5s7fn4/KL1Uzz7DbV5aZzhJzKs5eKErOAjqbtNSeHN1I8zLiNfql8JQAHySf+5+LBcdgEsWe8G72agnT0= X-Received: by 10.28.108.4 with SMTP id h4mr33154405wmc.161.1517828030305; Mon, 05 Feb 2018 02:53:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.135.61 with HTTP; Mon, 5 Feb 2018 02:53:49 -0800 (PST) Received: by 10.223.135.61 with HTTP; Mon, 5 Feb 2018 02:53:49 -0800 (PST) In-Reply-To: <59e48427-ce88-58fb-f802-48b7412e480d@hoa-project.net> References: <59e48427-ce88-58fb-f802-48b7412e480d@hoa-project.net> Date: Mon, 5 Feb 2018 11:53:49 +0100 Message-ID: To: Ivan Enderlin Cc: Wes , PHP Internals List Content-Type: multipart/alternative; boundary="089e082f8608939b1d056474e08e" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope From: ocramius@gmail.com (Marco Pivetta) --089e082f8608939b1d056474e08e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Ivan, On 5 Feb 2018 11:18, "Ivan Enderlin" wrote: Hello :-), Thank you for the RFC. I really appreciate it, for sure, but I would like to raise a concern regarding the atoum test framework [1]. atoum provides 3 mock engines, resp. for class-like entitites, functions, and constants. The function and constant mock engines are both based on the same principle, i.e. it relies on the =E2=80=9Centity bubble look up resolution= =E2=80=9D algorithm to mock functions or constants. Typically, one might mock the `file_exists` function like this: `$this->function->file_exists =3D functio= n (=E2=80=A6) { =E2=80=A6 };`. In this case, atoum creates a new `file_exists= ` function in the same namespace than the system under test (if testing `A\B\C`, then atoum creates `A\B\file_exists`). It is a very convinient and beloved way to mock functions and constants. And thus, this RFC raises the following issue: *This feature is used a lot by atoum users. The RFC will destroy this feature. It's not about atoum loosing a master feature, it's more about: How users will be able to mock functions and constants after that? This is an important question*. That's a hard question to answer, I know, but in its actual form, the RFC breaks a non-negligeable part of the testing ecosystem. This is something to take into account :-). It is still possible to use moles instead of mocks to achieve the same behavior, but restricted to user-defined functions only. Moles do not allow to change the behavior of =E2=80=9CVM-defined=E2=80=9D functions. Regards. [1] http://atoum.org/ 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. --089e082f8608939b1d056474e08e--