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
8 * @group common.lib-tests
14 require_once 'libraries/common.lib.php';
16 class PMA_whichCrlf_test
extends PHPUnit_Framework_TestCase
20 * @using runkit pecl extension
21 * if not define PMA_USR_OS, then define it as Win
22 * if installed runkit, then constant will not change
24 public function testWhichCrlf()
26 $runkit = function_exists('runkit_constant_redefine');
27 if ($runkit && defined('PMA_USR_OS'))
28 $pma_usr_os = PMA_USR_OS
;
30 if (defined('PMA_USR_OS') && !$runkit) {
32 if (PMA_USR_OS
== 'Win')
33 $this->assertEquals("\r\n", PMA_whichCrlf());
35 $this->assertEquals("\n", PMA_whichCrlf());
37 $this->markTestIncomplete('Cannot redefine constant');
42 define('PMA_USR_OS', 'Linux');
43 $this->assertEquals("\n", PMA_whichCrlf());
47 runkit_constant_redefine('PMA_USR_OS', 'Win');
49 define('PMA_USR_OS', 'Win');
50 $this->assertEquals("\r\n", PMA_whichCrlf());
55 if (isset($pma_usr_os))
56 runkit_constant_redefine('PMA_USR_OS', 'Win');
58 runkit_constant_remove('PMA_USR_OS');