Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84083 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38434 invoked from network); 28 Feb 2015 19:08:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2015 19:08:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:52121] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/63-20255-F1212F45 for ; Sat, 28 Feb 2015 14:08:16 -0500 Received: (qmail 16444 invoked by uid 1009); 28 Feb 2015 20:08:13 +0100 Received: from 209.85.192.41 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/20124. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.192.41):. Processed in 0.276793 secs); 28 Feb 2015 19:08:13 -0000 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.192.41):. Processed in 0.276793 secs Process 16404) Received: from mail-qg0-f41.google.com (gmail@bof.de@209.85.192.41) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 28 Feb 2015 20:08:12 +0100 Received: by mail-qg0-f41.google.com with SMTP id i50so19240808qgf.0 for ; Sat, 28 Feb 2015 11:08:10 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.94.87 with SMTP id f81mr37689246qge.38.1425150490483; Sat, 28 Feb 2015 11:08:10 -0800 (PST) Received: by 10.140.82.198 with HTTP; Sat, 28 Feb 2015 11:08:10 -0800 (PST) Received: by 10.140.82.198 with HTTP; Sat, 28 Feb 2015 11:08:10 -0800 (PST) In-Reply-To: <54F209B9.5020200@googlemail.com> References: <54E5F77D.9090406@fischer.name> <54E6F48A.9040906@fischer.name> <54E72FE7.9030803@googlemail.com> <54E7312D.9090404@googlemail.com> <54E73E70.5020403@googlemail.com> <54F209B9.5020200@googlemail.com> Date: Sat, 28 Feb 2015 20:08:10 +0100 Message-ID: To: Crypto Compress Cc: Yasuo Ohgaki , internals Content-Type: multipart/alternative; boundary=001a113a7fd8bca3fc05102ab498 Subject: Re: [PHP-DEV] [VOTE] Expectations From: php@bof.de (Patrick Schaaf) --001a113a7fd8bca3fc05102ab498 Content-Type: text/plain; charset=UTF-8 Am 28.02.2015 19:32 schrieb "Crypto Compress" : > > class BankAccount { > function Add($amount) { > assert($amount > 0); > // ... code block ... > } > } > > Now the programmer implementing "code block" to gracefully handle $amount > 0 has a problem. There is no way to (Unit)test failing path on development machine. Code after assertion is never called for failing contitions. What to do? Put the assert AFTER handling the always-to-be-done validation, of course. Doesn't make sense otherwise. Patrick --001a113a7fd8bca3fc05102ab498--