1<?php
2
3namespace Sabre\Uri;
4
5class NormalizeTest extends \PHPUnit_Framework_TestCase{
6
7    /**
8     * @dataProvider normalizeData
9     */
10    function testNormalize($in, $out) {
11
12        $this->assertEquals(
13            $out,
14            normalize($in)
15        );
16
17    }
18
19    function normalizeData() {
20
21        return [
22            ['http://example.org/',             'http://example.org/'],
23            ['HTTP://www.EXAMPLE.com/',         'http://www.example.com/'],
24            ['http://example.org/%7Eevert',     'http://example.org/~evert'],
25            ['http://example.org/./evert',      'http://example.org/evert'],
26            ['http://example.org/../evert',     'http://example.org/evert'],
27            ['http://example.org/foo/../evert', 'http://example.org/evert'],
28            ['/%41',                            '/A'],
29            ['/%3F',                            '/%3F'],
30            ['/%3f',                            '/%3F'],
31            ['http://example.org',              'http://example.org/'],
32            ['http://example.org:/',            'http://example.org/'],
33            ['http://example.org:80/',          'http://example.org/'],
34            // See issue #6. parse_url corrupts strings like this, but only on
35            // macs.
36            //[ 'http://example.org/有词法别名.zh','http://example.org/%E6%9C%89%E8%AF%8D%E6%B3%95%E5%88%AB%E5%90%8D.zh'],
37
38        ];
39
40    }
41
42}
43