2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for PMA_fatalError() from libraries/core.lib.php
6 * PMA_fatalError() displays the given error message on phpMyAdmin error page in foreign language
7 * and ends script execution and closes session
9 * @package phpMyAdmin-test
15 require_once 'libraries/select_lang.lib.php';
16 require_once 'libraries/core.lib.php';
17 require_once 'libraries/sanitizing.lib.php';
18 require_once 'libraries/Config.class.php';
20 class PMA_fatalError_test
extends PHPUnit_Extensions_OutputTestCase
22 public function testFatalErrorMessage()
24 $this->expectOutputRegex("/FatalError!/");
25 PMA_fatalError("FatalError!");
28 public function testFatalErrorMessageWithArgs()
30 $message = "Fatal error #%d in file %s.";
31 $params = array(1, 'error_file.php');
33 $this->expectOutputRegex("/Fatal error #1 in file error_file.php./", "Not EQ");
34 PMA_fatalError($message, $params);
36 $message = "Fatal error in file %s.";
37 $params = 'error_file.php';
39 $this->expectOutputRegex("/Fatal error in file error_file.php./");
40 PMA_fatalError($message, $params);