<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to bugs</title><link>https://sourceforge.net/p/phpunit/bugs/</link><description>Recent changes to bugs</description><atom:link href="https://sourceforge.net/p/phpunit/bugs/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 19 Nov 2013 18:15:13 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/phpunit/bugs/feed.rss" rel="self" type="application/rss+xml"/><item><title>PHPUnit_Util_Printer::write writes HTTP headers before unit tests run</title><link>https://sourceforge.net/p/phpunit/bugs/18/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;When I call header() inside a unit test, I am told that phpunit has already set HTTP headers:&lt;/p&gt;
&lt;p&gt;Cannot modify header information - headers already sent by (output started at /usr/share/pear/PHPUnit/Util/Printer.php:172)&lt;/p&gt;
&lt;p&gt;Full report is at: &lt;a href="http://stackoverflow.com/questions/20076467/why-does-phpunit-interfere-with-setting-http-headers-in-this-code" rel="nofollow"&gt;http://stackoverflow.com/questions/20076467/why-does-phpunit-interfere-with-setting-http-headers-in-this-code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is phpunit 3.7.19 on CentOS 6.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Barrett</dc:creator><pubDate>Tue, 19 Nov 2013 18:15:13 -0000</pubDate><guid>https://sourceforge.nete6ea29b0223722f1fe8ba0c7fe5e1582810133bb</guid></item><item><title>runtimeexception phpunit does not like "die()" </title><link>https://sourceforge.net/p/phpunit/bugs/17/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;my unit tests use the database layer, which is bad however please read on...&lt;/p&gt;
&lt;p&gt;when using functionality that is NYI I put "die()" in there to make it die horribly, &lt;/p&gt;
&lt;p&gt;The die causes strange runtimeexpcetion with no error msg to  tests that do not invoke the die(), and it's hard to pinpoint the cause.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hayden Virtue</dc:creator><pubDate>Tue, 27 Dec 2011 06:35:28 -0000</pubDate><guid>https://sourceforge.netb6459d44204c18aeaf2f66cb726a7d55955040a7</guid></item><item><title>phpunit CLI</title><link>https://sourceforge.net/p/phpunit/bugs/16/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;PHP Unit does not work for Command Line based PHP scrtips.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 01 Jun 2005 00:19:14 -0000</pubDate><guid>https://sourceforge.net9ef8e44fea4aad9efd9d82e958edfb7df753e788</guid></item><item><title>class Exception is a predefined one in php 5.0.2</title><link>https://sourceforge.net/p/phpunit/bugs/15/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, I was trying to use your phpUnit with php 5.0.2&lt;br /&gt;
and met a name&lt;br /&gt;
resolution conflict. Exception class is predefined in&lt;br /&gt;
php 5.0.0, as you know. So, I've managed to fix the&lt;br /&gt;
problem.&lt;br /&gt;
Here's the patch that works fine in my case --&lt;br /&gt;
runtests2.php runs completely as it should.&lt;/p&gt;
&lt;h1 id="index-phpunitphp"&gt;Index: phpunit.php&lt;/h1&gt;
&lt;p&gt;RCS file: /cvsroot/phpunit/phpunit/phpunit.php,v&lt;br /&gt;
retrieving revision 1.20&lt;br /&gt;
diff -u -r1.20 phpunit.php&lt;br /&gt;
--- phpunit.php 31 Jul 2004 07:35:03 -0000      1.20&lt;br /&gt;
+++ phpunit.php 14 Sep 2004 09:36:38 -0000&lt;br /&gt;
@@ -53,11 +53,11 @@&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;-class Exception {&lt;br /&gt;
+class phpUnitException {&lt;br /&gt;
/* Emulate a Java exception, sort of... */&lt;br /&gt;
var $message;&lt;br /&gt;
var $type;&lt;br /&gt;
-  function Exception($message, $type = 'FAILURE') {&lt;br /&gt;
+  function phpUnitException($message, $type = 'FAILURE') {&lt;br /&gt;
$this-&amp;gt;message = $message;&lt;br /&gt;
$this-&amp;gt;type = $type;&lt;br /&gt;
}&lt;br /&gt;
@@ -260,13 +260,13 @@&lt;br /&gt;
//printf("TestCase::fail(%s)&amp;lt;br&amp;gt;\n", ($message) ?&lt;br /&gt;
$message : '');&lt;br /&gt;
/* JUnit throws AssertionFailedError here.  We&lt;br /&gt;
just record the&lt;br /&gt;
failure and carry on */&lt;br /&gt;
-    $this-&amp;gt;fExceptions[] = new Exception($message,&lt;br /&gt;
'FAILURE');&lt;br /&gt;
+    $this-&amp;gt;fExceptions[] = new&lt;br /&gt;
phpUnitException($message, 'FAILURE');&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;function error($message) {&lt;br /&gt;
/* report error that requires correction in the&lt;br /&gt;
test script&lt;br /&gt;
itself, or (heaven forbid) in this testing&lt;br /&gt;
infrastructure */&lt;br /&gt;
-    $this-&amp;gt;fExceptions[] = new Exception($message,&lt;br /&gt;
'ERROR');&lt;br /&gt;
+    $this-&amp;gt;fExceptions[] = new&lt;br /&gt;
phpUnitException($message, 'ERROR');&lt;br /&gt;
$this-&amp;gt;fResult-&amp;gt;stop();    // [does not work]&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;-- &lt;br /&gt;
With best regards, Anton Kovalenko.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anton Kovalenko</dc:creator><pubDate>Wed, 15 Sep 2004 14:12:45 -0000</pubDate><guid>https://sourceforge.net4761c5c246064501c152d926ddc221a53898e246</guid></item><item><title>set_error_handler complains with NULL arugment</title><link>https://sourceforge.net/p/phpunit/bugs/14/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I used to get this error message in phpunit's HTML output:&lt;/p&gt;
&lt;p&gt;PHP ERROR: set_error_handler() expects argument 1, '', to be a valid callback in phpunit.php at line 241&lt;/p&gt;
&lt;p&gt;The problem originates from $old_handler being NULL and PHP 4.3.3 complains when set_error_handler is used with a NULL argument 1, so I fix it by changing this line:&lt;/p&gt;
&lt;p&gt;[241] set_error_handler($old_handler); // revert to prior error handler&lt;/p&gt;
&lt;p&gt;by this:&lt;/p&gt;
&lt;p&gt;if ($old_handler != NULL)&lt;br /&gt;
set_error_handler($old_handler); // revert to prior error handler&lt;br /&gt;
else&lt;br /&gt;
restore_error_handler();&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ralfoide</dc:creator><pubDate>Fri, 27 Feb 2004 08:34:22 -0000</pubDate><guid>https://sourceforge.net8fc676f0b80911881247cf48f3bd34be06959feb</guid></item><item><title>SHUTTING DOWN crash</title><link>https://sourceforge.net/p/phpunit/bugs/13/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I had a bug where runtests worked without any tests,&lt;br /&gt;
but with one trivial test something would crash, output&lt;br /&gt;
a lot of high-bit text, then the text: "SHUTTING DOWN".&lt;/p&gt;
&lt;p&gt;Not sure what it is crashing - PHP or Apache - but by&lt;br /&gt;
removing all flush() calls in PHPunit it no longer&lt;br /&gt;
occurred.&lt;/p&gt;
&lt;p&gt;Version information follows:&lt;/p&gt;
&lt;p&gt;PHPunit: &lt;br /&gt;
// $Id: phpunit.php,v 1.11 2002/10/31 18:44:12 fredy Exp $&lt;/p&gt;
&lt;p&gt;Apache: 2.0.47&lt;/p&gt;
&lt;p&gt;PHP 4.3.4 (cgi) (built: Feb 11 2004 10:18:49)&lt;br /&gt;
Copyright (c) 1997-2003 The PHP Group&lt;br /&gt;
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend&lt;br /&gt;
Technologies&lt;br /&gt;
with Zend Extension Manager v1.0.1, Copyright (c)&lt;br /&gt;
2003, by Zend Technologies&lt;br /&gt;
with Zend Optimizer v2.1.1, Copyright (c)&lt;br /&gt;
1998-2003, by Zend Technologies&lt;br /&gt;
with &amp;lt;b&amp;gt;DISABLED&amp;lt;/b&amp;gt; Zend Performance Suite v3.6.0,&lt;br /&gt;
Copyright (c) 1999-2003, by The Accelerator presently&lt;br /&gt;
supports only Apache, ISAPI and FastCGI SAPIs&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 26 Feb 2004 11:23:33 -0000</pubDate><guid>https://sourceforge.net4650ee33ad11cb6d89ab765ed5cd7855b365e87b</guid></item><item><title>Operator '@' not supported</title><link>https://sourceforge.net/p/phpunit/bugs/12/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;PHPunit throws an error when I try to access an unset &lt;br /&gt;
element of an array, even if I use '@' in front of the &lt;br /&gt;
code to suppress errors.&lt;/p&gt;
&lt;p&gt;PHP implements '@' by temporarily setting error_reporting&lt;br /&gt;
() to equal E_NONE, so the fix is simply to add a check &lt;br /&gt;
whether error_reporting() is on in the function &lt;br /&gt;
PHPUnit_error_handler().&lt;/p&gt;
&lt;p&gt;This is the fixed function, adapted from 1.11:&lt;/p&gt;
&lt;p&gt;function PHPUnit_error_handler($errno, $errstr, $errfile, &lt;br /&gt;
$errline) {&lt;br /&gt;
global $PHPUnit_testRunning;&lt;br /&gt;
if(error_reporting()){&lt;br /&gt;
$PHPUnit_testRunning[0]-&amp;amp;gt;fail(&amp;amp;quot;&amp;amp;lt;B&amp;amp;gt;PHP ERROR:&amp;amp;lt;/B&amp;amp;gt; &amp;amp;quot;.&lt;br /&gt;
$errstr.&amp;amp;quot; &amp;amp;lt;B&amp;amp;gt;in&amp;amp;lt;/B&amp;amp;gt; &amp;amp;quot;.$errfile.&amp;amp;quot; &amp;amp;lt;B&amp;amp;gt;at line&amp;amp;lt;/B&amp;amp;gt; &amp;amp;quot;.$errline);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;My email: tom, at, meansandends, dot, com.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 14 Jul 2003 22:15:37 -0000</pubDate><guid>https://sourceforge.net0ed9b6406e6bdb8a19f3c5f6c5f6dc23522f3d2a</guid></item><item><title>More Detailed Error Message</title><link>https://sourceforge.net/p/phpunit/bugs/11/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;on line 149/150:&lt;/p&gt;
&lt;p&gt;If you change:&lt;br /&gt;
$htmlValue = &amp;amp;quot;&amp;amp;lt;code class=\&amp;amp;amp;quot;$class\&amp;amp;amp;quot;&amp;amp;gt;&amp;amp;quot; &lt;br /&gt;
. htmlspecialchars($translateValue) &lt;br /&gt;
. &amp;amp;quot;&amp;amp;lt;/code&amp;amp;gt;&amp;amp;quot;;&lt;/p&gt;
&lt;p&gt;to:&lt;br /&gt;
$htmlValue = &amp;amp;quot;&amp;amp;lt;code class=\&amp;amp;amp;quot;$class\&amp;amp;amp;quot;&amp;amp;gt;&amp;amp;quot; &lt;br /&gt;
. strtoupper($class) . &amp;amp;quot;: &amp;amp;quot;&lt;br /&gt;
. htmlspecialchars($translateValue) &lt;br /&gt;
. &amp;amp;quot;&amp;amp;lt;/code&amp;amp;gt;&amp;amp;quot;;&lt;/p&gt;
&lt;p&gt;it will print out EXPECTED: and ACTUAL: before the &lt;br /&gt;
erroneous values. It makes it more readable.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 01 May 2003 15:05:14 -0000</pubDate><guid>https://sourceforge.netfaa8d885842f38e8c04200df51f4811c6d1c5455</guid></item><item><title>Segmentation faults from runtests.php</title><link>https://sourceforge.net/p/phpunit/bugs/10/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2&lt;/p&gt;
&lt;p&gt;runtests.php &amp;amp;amp; runtests2.php cause segmentation faults on the above system (but, oddly, not all the time -- on about 2/3 of requests.&lt;/p&gt;
&lt;p&gt;Segmentation faults also occurs when I tested a test suite containing a single test with $this-&amp;amp;gt;assert (true, &amp;amp;quot;test&amp;amp;quot;)&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Last Obelus</dc:creator><pubDate>Thu, 27 Mar 2003 21:19:31 -0000</pubDate><guid>https://sourceforge.net0f8e06088f48f0f4188376dd148bb5bd9bc22c3e</guid></item><item><title>error when restoring error_handler</title><link>https://sourceforge.net/p/phpunit/bugs/9/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Per note from Ian Smith &amp;amp;lt;iansmithca@yahoo.com&amp;amp;gt;:&lt;/p&gt;
&lt;p&gt;I think that in phpunit.php on line 241 you should use&lt;/p&gt;
&lt;p&gt;restore_error_handler();&lt;/p&gt;
&lt;p&gt;instead of trying to reset the value with&lt;br /&gt;
set_error_handler($old_handler);&lt;/p&gt;
&lt;p&gt;At least on my box (win xp, apache2, php4.3RC4) this&lt;br /&gt;
produces an error because old_handler is ''. I changed&lt;br /&gt;
my copy to use the restore...() above and it works ok.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Fred Yankowski</dc:creator><pubDate>Sat, 28 Dec 2002 18:49:55 -0000</pubDate><guid>https://sourceforge.net0d3eaaa778a274ecc37e58af1706f80aaaa8ab73</guid></item></channel></rss>