Avoid nested output buffer problems in test
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
2d47e41084
commit
b5b869419f
@ -30,11 +30,13 @@ require_once './libraries/js_escape.lib.php';
|
||||
|
||||
$buffer = PMA\libraries\OutputBuffering::getInstance();
|
||||
$buffer->start();
|
||||
register_shutdown_function(
|
||||
function () {
|
||||
echo PMA\libraries\OutputBuffering::getInstance()->getContents();
|
||||
}
|
||||
);
|
||||
if (!defined('TESTSUITE')) {
|
||||
register_shutdown_function(
|
||||
function () {
|
||||
echo PMA\libraries\OutputBuffering::getInstance()->getContents();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$js_messages['strNoDropDatabases'] = __('"DROP DATABASE" statements are disabled.');
|
||||
if ($cfg['AllowUserDropDatabase']) {
|
||||
|
||||
@ -31,15 +31,17 @@ class FilesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function testJsMessages()
|
||||
{
|
||||
ob_start();
|
||||
$GLOBALS['pmaThemeImage'] = '';
|
||||
$cfg = array(
|
||||
'AllowUserDropDatabase' => true,
|
||||
'GridEditing' => 'click',
|
||||
'OBGzip' => false,
|
||||
'ServerDefault' => 1,
|
||||
);
|
||||
$GLOBALS['cfg'] = $cfg;
|
||||
require 'js/messages.php';
|
||||
$out = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$buffer->stop();
|
||||
$out = $buffer->getContents();
|
||||
$this->assertContains('var PMA_messages = new Array();', $out);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user