Make WordPress Core

Changeset 710 in tests for wp-testlib/base.php


Ignore:
Timestamp:
05/03/2012 04:40:01 PM (14 years ago)
Author:
nacin
Message:

Move the tearDown() output buffering flush-all from WPXMLRPCServerTestCase
to WPTestCase, for which [625] was intended.

Do not flush the last output buffer, as PHPUnit does one level of output
buffering in PHPUnit_Framework_TestCase. This prevents a notice from being
issued when WordPress has flushed all output buffers, then PHPUnit
unconditionally calls ob_end_clean() for its own output buffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testlib/base.php

    r692 r710  
    3838
    3939        function tearDown() {
     40                // Multi-level flush, when necessary, if a test did not clean up after themselves.
     41                // Avoid flushing the main PHPUnit buffer.
     42                $levels = ob_get_level();
     43                for ( $i = 1; $i < $levels; $i++ )
     44                        ob_end_flush();
     45
    4046                if (!is_null($this->_old_handler)) {
    4147                        restore_error_handler();
     
    651657
    652658        function tearDown() {
    653                 // Multi-level flush, when necessary, if a test did not clean up after themselves
    654                 wp_ob_end_flush_all();
    655659                parent::tearDown();
    656660                // delete any users and uploads that were created during tests
Note: See TracChangeset for help on using the changeset viewer.