2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test whichCrlf function
6 * @author Michal Biniek <michal@bystrzyca.pl>
7 * @package phpMyAdmin-test
8 * @version $Id: PMA_whichCrlf_test.php
14 require_once 'PHPUnit/Framework.php';
19 require_once './libraries/common.lib.php';
22 * Test whichCrlf function.
25 class PMA_whichCrlf_test
extends PHPUnit_Framework_TestCase
29 * @using runkit pecl extension
30 * if not define PMA_USR_OS, then define it as Win
31 * if installed runkit, then constant will not change
34 public function testWhichCrlf()
36 $runkit = function_exists('runkit_constant_redefine');
37 if ($runkit && defined('PMA_USR_OS'))
38 $pma_usr_os = PMA_USR_OS
;
40 if (defined('PMA_USR_OS') && !$runkit) {
42 if (PMA_USR_OS
== 'Win')
43 $this->assertEquals("\r\n", PMA_whichCrlf());
45 $this->assertEquals("\n", PMA_whichCrlf());
47 $this->markTestIncomplete('Cannot redefine constant');
52 define('PMA_USR_OS', 'Linux');
53 $this->assertEquals("\n", PMA_whichCrlf());
56 runkit_constant_redefine('PMA_USR_OS', 'Win');
58 define('PMA_USR_OS', 'Win');
59 $this->assertEquals("\r\n", PMA_whichCrlf());
64 if (isset($pma_usr_os))
65 runkit_constant_redefine('PMA_USR_OS', 'Win');
67 runkit_constant_remove('PMA_USR_OS');