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
35        ];
36
37    }
38
39}
40