HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System: Linux li317-225.members.linode.com 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64
User: apache (48)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //usr/share/phpMyAdmin/test/libraries/PMA_prettyPrint_test.php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * tests for PMA_prettyPrint()
 *
 * @package PhpMyAdmin-test
 */

/*
 * Include to test
 */
require_once 'libraries/error_report.lib.php';

/**
 * tests for PMA_prettyPrint()
 *
 * @package PhpMyAdmin-test
 */
class PMA_PrettyPrint_Test extends PHPUnit_Framework_TestCase
{
    /**
     * Tests correct display of none array objects.
     *
     * @return void
     */
    public function testNonArray()
    {
        $this->assertEquals(
            "test\n",
            PMA_prettyPrint('test')
        );
    }

    /**
     * Tests correct display of multilevel associative arrays.
     *
     * @return void
     */
    public function testDeepArray()
    {
        $this->assertEquals(
            "key[test0]: \"value0\"\nkey[test1]: \"value1\"\n",
            PMA_prettyPrint(
                array('key' => array('test0' => 'value0', 'test1' => 'value1'))
            )
        );
    }

    /**
     * Tests correct display of multilevel associative arrays.
     *
     * @return void
     */
    public function testNonAssociativeArray()
    {
        $this->assertEquals(
            "key[0]: \"value0\"\nkey[1]: \"value1\"\n",
            PMA_prettyPrint(array('key' => array('value0', 'value1')))
        );
    }
}
?>