Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PMA_prettyPrint_test.php « libraries « test - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7484a57ae7998c8d82c3776de3e77693d059869b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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')))
        );
    }
}