Advisor: mark that 'Rate of reading fixed position' may be wrong, requires further...
[phpmyadmin/thilanka.git] / test / libraries / common / PMA_whichCrlf_test.php
blob52d8323bbd5bfa075d0cf8f26f7d0e98ded89d88
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Test whichCrlf function
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_whichCrlf_test.php
8 * @group common.lib-tests
9 */
12 * Include to test.
14 require_once 'libraries/common.lib.php';
16 class PMA_whichCrlf_test extends PHPUnit_Framework_TestCase
19 /**
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());
34 else
35 $this->assertEquals("\n", PMA_whichCrlf());
37 $this->markTestIncomplete('Cannot redefine constant');
39 } else {
41 if ($runkit) {
42 define('PMA_USR_OS', 'Linux');
43 $this->assertEquals("\n", PMA_whichCrlf());
46 if ($runkit)
47 runkit_constant_redefine('PMA_USR_OS', 'Win');
48 else
49 define('PMA_USR_OS', 'Win');
50 $this->assertEquals("\r\n", PMA_whichCrlf());
54 if ($runkit) {
55 if (isset($pma_usr_os))
56 runkit_constant_redefine('PMA_USR_OS', 'Win');
57 else
58 runkit_constant_remove('PMA_USR_OS');