<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/phpunit/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/phpunit/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/phpunit/bugs/</id><updated>2013-11-19T18:15:13.364000Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>PHPUnit_Util_Printer::write writes HTTP headers before unit tests run</title><link href="https://sourceforge.net/p/phpunit/bugs/18/" rel="alternate"/><published>2013-11-19T18:15:13.364000Z</published><updated>2013-11-19T18:15:13.364000Z</updated><author><name>Daniel Barrett</name><uri>https://sourceforge.net/u/djbarrett/</uri></author><id>https://sourceforge.nete6ea29b0223722f1fe8ba0c7fe5e1582810133bb</id><summary type="html">&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;</summary></entry><entry><title>runtimeexception phpunit does not like "die()" </title><link href="https://sourceforge.net/p/phpunit/bugs/17/" rel="alternate"/><published>2011-12-27T06:35:28Z</published><updated>2011-12-27T06:35:28Z</updated><author><name>Hayden Virtue</name><uri>https://sourceforge.net/u/hrvirtue/</uri></author><id>https://sourceforge.netb6459d44204c18aeaf2f66cb726a7d55955040a7</id><summary type="html">&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;</summary></entry><entry><title>phpunit CLI</title><link href="https://sourceforge.net/p/phpunit/bugs/16/" rel="alternate"/><published>2005-06-01T00:19:14Z</published><updated>2005-06-01T00:19:14Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net9ef8e44fea4aad9efd9d82e958edfb7df753e788</id><summary type="html">&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;</summary></entry><entry><title>class Exception is a predefined one in php 5.0.2</title><link href="https://sourceforge.net/p/phpunit/bugs/15/" rel="alternate"/><published>2004-09-15T14:12:45Z</published><updated>2004-09-15T14:12:45Z</updated><author><name>Anton Kovalenko</name><uri>https://sourceforge.net/u/robocomp/</uri></author><id>https://sourceforge.net4761c5c246064501c152d926ddc221a53898e246</id><summary type="html">&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;</summary></entry><entry><title>set_error_handler complains with NULL arugment</title><link href="https://sourceforge.net/p/phpunit/bugs/14/" rel="alternate"/><published>2004-02-27T08:34:22Z</published><updated>2004-02-27T08:34:22Z</updated><author><name>Ralfoide</name><uri>https://sourceforge.net/u/ralfoide/</uri></author><id>https://sourceforge.net8fc676f0b80911881247cf48f3bd34be06959feb</id><summary type="html">&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;</summary></entry><entry><title>SHUTTING DOWN crash</title><link href="https://sourceforge.net/p/phpunit/bugs/13/" rel="alternate"/><published>2004-02-26T11:23:33Z</published><updated>2004-02-26T11:23:33Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net4650ee33ad11cb6d89ab765ed5cd7855b365e87b</id><summary type="html">&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;</summary></entry><entry><title>Operator '@' not supported</title><link href="https://sourceforge.net/p/phpunit/bugs/12/" rel="alternate"/><published>2003-07-14T22:15:37Z</published><updated>2003-07-14T22:15:37Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net0ed9b6406e6bdb8a19f3c5f6c5f6dc23522f3d2a</id><summary type="html">&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;</summary></entry><entry><title>More Detailed Error Message</title><link href="https://sourceforge.net/p/phpunit/bugs/11/" rel="alternate"/><published>2003-05-01T15:05:14Z</published><updated>2003-05-01T15:05:14Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netfaa8d885842f38e8c04200df51f4811c6d1c5455</id><summary type="html">&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;</summary></entry><entry><title>Segmentation faults from runtests.php</title><link href="https://sourceforge.net/p/phpunit/bugs/10/" rel="alternate"/><published>2003-03-27T21:19:31Z</published><updated>2003-03-27T21:19:31Z</updated><author><name>Last Obelus</name><uri>https://sourceforge.net/u/lastobelus/</uri></author><id>https://sourceforge.net0f8e06088f48f0f4188376dd148bb5bd9bc22c3e</id><summary type="html">&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;</summary></entry><entry><title>error when restoring error_handler</title><link href="https://sourceforge.net/p/phpunit/bugs/9/" rel="alternate"/><published>2002-12-28T18:49:55Z</published><updated>2002-12-28T18:49:55Z</updated><author><name>Fred Yankowski</name><uri>https://sourceforge.net/u/fredy/</uri></author><id>https://sourceforge.net0d3eaaa778a274ecc37e58af1706f80aaaa8ab73</id><summary type="html">&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;</summary></entry></feed>