Why do I get "BORKED --CLEAN-- section" using PHPT in PHPUnit?
===

I have some PHPT tests that are being run in PHPUnit.  These tests include a `--CLEAN--` section that handles the deletion of files created during the test.  Running the PHPT tests at the command line using `pear run-tests` works fine, but when they are run though PHPUnit I get the following error:

>BORKED --CLEAN-- section! output:<br>
>X-Powered-By: PHP/5.3.10-1ubuntu3.2<br>
Content-type: text/html

This obviously looks like an HTTP header, but there is no further text, and the actions in the clean section still work as planned.  Any ideas on what these are caused by, and how to get rid of them?  They're not breaking the tests, but they look untidy in the output.

A PHPT test:

    --TEST--
    Test file upload
    
    --POST_RAW-- 
    Content-Type: multipart/form-data; boundary=---------------------------168481652011378167832091260413
    Content-Length: 3510
    -----------------------------168481652011378167832091260413
    Content-Disposition: form-data; name="code"
    
    te
    -----------------------------168481652011378167832091260413
    Content-Disposition: form-data; name="name"
    
    test
    -----------------------------168481652011378167832091260413
    Content-Disposition: form-data; name="file"; filename="test.xml"
    Content-Type: text/xml
    
    <?xml  version="1.0" encoding="utf-8"?>
    <testElement>
        <innerElement />
    </testElement
    
    -----------------------------168481652011378167832091260413--
    
    --FILE--
    <?php
    // Zend/PHPUnit bootstrap
    require_once __DIR__ . '/../../../bootstrap.php';
    
    $upload = new My_File_Upload();
    var_dump($upload->handleFile(
        'file', 
        APPLICATION_PATH . '/../datafiles/request/',
        'application/xml',
        'testname'
    ));
    var_dump(file_exists(APPLICATION_PATH . '/../datafiles/request/testname.xml'))
    ?>
    
    --CLEAN--
    <?php
        $file = dirname(__FILE__) . '/../../../../datafiles/request/testname.xml';
        if(file_exists($file)) unlink($file);
    ?>
    
    --EXPECT--
    string(12) "testname.xml"
    bool(true)

A Zend/PHPUnit test wrapper:

    <?php
    require_once 'PHPUnit/Extensions/PhptTestCase.php';
    /**
     * UploadFileHandleTest
     * 
     * PHPUnit wrapper for the phpt test file UploadFileHandleTest.phpt
     *
     */
    class My_File_UploadFileHandle extends PHPUnit_Extensions_PhptTestCase
    {
        /**
         * Test file uploads
         * 
         * Test the file uploads using associated .phpt test files. These test have to 
         * be abstracted to the php-cgi environment to permit accurate manipulation of 
         * the $_FILES superglobal. 
         * 
         * @see http://qafoo.com/blog/013_testing_file_uploads_with_php.html
         * 
         * @covers My_File_Upload::handleFile
         * 
         * @return void
         */
        public function __construct() 
        { 
            parent::__construct(__DIR__ . '/UploadFileHandleTest.phpt'); 
        }
        
        /**
         * Implement missing hasOutput method for PHPUnit
         * 
         * @return boolean 
         */
        public function hasOutput()
        {
            return false;
        }
    }

The test suite to trigger the wrappers:

    <?php
    
    require_once 'UploadFileExists.php';
    require_once 'UploadFileHandle.php';
    require_once 'UploadFileHandleNoName.php';
    require_once 'UploadFileHandleExceptions.php';
    
    class My_File_UploadTestSuite extends PHPUnit_Framework_TestSuite
    {
        public static function suite()
        {
            $suite = new My_File_UploadTestSuite('My_File_UploadFileTests');
            
            $suite->addTest(new My_File_UploadFileExists());
            $suite->addTest(new My_File_UploadFileHandle());
            $suite->addTest(new My_File_UploadFileHandleNoName());
            $suite->addTest(new My_File_UploadFileHandleExceptions());
            
            return $suite;
        }
    }

