2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test whichCrlf function
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_whichCrlf_test.php
13 require_once 'PHPUnit/Framework.php';
18 require_once './libraries/common.inc.php';
21 * Test whichCrlf function.
24 class PMA_whichCrlf_test
extends PHPUnit_Framework_TestCase
28 * @using runkit pecl extension
29 * if not define PMA_USR_OS, then define it as Win
30 * if installed runkit, then constant will not change
33 public function testWhichCrlf()
35 $runkit = function_exists('runkit_constant_redefine');
36 if ($runkit && defined('PMA_USR_OS'))
37 $pma_usr_os = PMA_USR_OS
;
39 if (defined('PMA_USR_OS') && !$runkit) {
41 if (PMA_USR_OS
== 'Win')
42 $this->assertEquals("\r\n", PMA_whichCrlf());
44 $this->assertEquals("\n", PMA_whichCrlf());
46 $this->markTestIncomplete('Cannot redefine constant');
51 define('PMA_USR_OS', 'Linux');
52 $this->assertEquals("\n", PMA_whichCrlf());
55 runkit_constant_redefine('PMA_USR_OS', 'Win');
57 define('PMA_USR_OS', 'Win');
58 $this->assertEquals("\r\n", PMA_whichCrlf());
63 if (isset($pma_usr_os))
64 runkit_constant_redefine('PMA_USR_OS', 'Win');
66 runkit_constant_remove('PMA_USR_OS');