Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37198 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5763 invoked from network); 23 Apr 2008 11:45:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Apr 2008 11:45:33 -0000 Received: from [127.0.0.1] ([127.0.0.1:28479]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 51/F1-29761-D512F084 for ; Wed, 23 Apr 2008 07:45:33 -0400 Authentication-Results: pb1.pair.com smtp.mail=zimnyx@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zimnyx@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.204.235 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: zimnyx@gmail.com X-Host-Fingerprint: 72.14.204.235 qb-out-0506.google.com Received: from [72.14.204.235] ([72.14.204.235:25758] helo=qb-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/C1-29761-51F1F084 for ; Wed, 23 Apr 2008 07:35:50 -0400 Received: by qb-out-0506.google.com with SMTP id e11so2560814qbe.15 for ; Wed, 23 Apr 2008 04:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=qbveZgDdq63IHXRo+3rT8JtMDJWtRo4vFdU5kCdtErk=; b=Ldt5s+PKdbRGzvdvLLsb4dNmmHCmxvm4N5+zfvJd3q/R8z797u4dLH4aCiXNNsQhqkLEPw2t3cyf9d29yyKhYG7HpdpnNeED6yMtuA28vo8Bt1t89zvZXrzrgOK60K8EhblMviGhXk1WT4oEvxU3AeroGZfZ1jhxVyGsEmRcfo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=sPAq/ytCqt5yOhnJyXnIqVfG8ItdFjXm2b1alHfLFLtwFeg44qYcRHp4A4AU63YI3L3+d4teCrethBe0FiXGwXfcy+hcitJaBc3uVVjYt/txcZI43rv/fTYGP8kIplYubIqY7zMrAaGh7LN10+L+dfHCTiv0V5KKsqwlwpwBoJg= Received: by 10.143.14.16 with SMTP id r16mr117589wfi.225.1208950547335; Wed, 23 Apr 2008 04:35:47 -0700 (PDT) Received: by 10.142.155.11 with HTTP; Wed, 23 Apr 2008 04:35:47 -0700 (PDT) Message-ID: <299f97600804230435o6bbf8eb2l9ca760458b949dd6@mail.gmail.com> Date: Wed, 23 Apr 2008 13:35:47 +0200 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Unable to unit test code containing *_uploaded_file() From: zimnyx@gmail.com ("Piotr Czachur") Hello! I use PHPUnit for unit testing of my application (but this issue is independent of PHPUnit). Tests are run from command line so it's not way (that I can imagine) to simulate file upload, because app code uses is_uploaded_file() to check if file was really uploaded. In my opionion some functions for simulation of file upload in command line script would be very handy for unit testing. What I mean is adding a function or a set of functions for setting file upload, for example: do_file_upload( upload_params, upload data). This function would be for use only in testing code, so there would be no need to change existing application code to add unit tests, and what's more important it would not leak to security risk. Regards, Piotr Czachur