Code Duplication    Length = 11-11 lines in 8 locations

risoluto/lib/vendor_test/Risoluto/UrlTest/UrlTest4GetBaseUrl.php 8 locations

@@ 52-62 (lines=11) @@
49
     *
50
     * getBaseUrl()の動作をテストする(ノーマルな指定その1)
51
     */
52
    public function test_GetBaseUrl_WithNormalPart1()
53
    {
54
        $test = [
55
            'HTTP_HOST' => 'example.com',
56
            'SERVER_PORT' => '80',
57
            'PHP_SELF' => '/index.html',
58
        ];
59
        $want = 'http://example.com/index.html';
60
61
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
62
    }
63
64
    /**
65
     * test_GetBaseUrl_WithNormalPart2()
@@ 69-79 (lines=11) @@
66
     *
67
     * getBaseUrl()の動作をテストする(ノーマルな指定その2)
68
     */
69
    public function test_GetBaseUrl_WithNormalPart2()
70
    {
71
        $test = [
72
            'HTTP_HOST' => 'example.com',
73
            'SERVER_PORT' => '80',
74
            'PHP_SELF' => '/test.php',
75
        ];
76
        $want = 'http://example.com/test.php';
77
78
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
79
    }
80
81
    /**
82
     * test_GetBaseUrl_WithNormalPart3()
@@ 86-96 (lines=11) @@
83
     *
84
     * getBaseUrl()の動作をテストする(ノーマルな指定その3)
85
     */
86
    public function test_GetBaseUrl_WithNormalPart3()
87
    {
88
        $test = [
89
            'HTTP_HOST' => 'example.com',
90
            'SERVER_PORT' => '80',
91
            'PHP_SELF' => '/index.php',
92
        ];
93
        $want = 'http://example.com/';
94
95
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
96
    }
97
98
    /**
99
     * test_GetBaseUrl_WithSslPart1()
@@ 103-113 (lines=11) @@
100
     *
101
     * getBaseUrl()の動作をテストする(SSLな指定その1)
102
     */
103
    public function test_GetBaseUrl_WithSslPart1()
104
    {
105
        $test = [
106
            'HTTP_HOST' => 'example.com',
107
            'SERVER_PORT' => '443',
108
            'PHP_SELF' => '/index.html',
109
        ];
110
        $want = 'https://example.com/index.html';
111
112
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
113
    }
114
115
    /**
116
     * test_GetBaseUrl_WithSslPart2()
@@ 120-130 (lines=11) @@
117
     *
118
     * getBaseUrl()の動作をテストする(SSLな指定その2)
119
     */
120
    public function test_GetBaseUrl_WithSslPart2()
121
    {
122
        $test = [
123
            'HTTP_HOST' => 'example.com',
124
            'SERVER_PORT' => '443',
125
            'PHP_SELF' => '/test.php',
126
        ];
127
        $want = 'https://example.com/test.php';
128
129
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
130
    }
131
132
    /**
133
     * test_GetBaseUrl_WithNotStdPortPart1()
@@ 137-147 (lines=11) @@
134
     *
135
     * getBaseUrl()の動作をテストする(8000ポートを指定)
136
     */
137
    public function test_GetBaseUrl_WithNotStdPortPart1()
138
    {
139
        $test = [
140
            'HTTP_HOST' => 'example.com',
141
            'SERVER_PORT' => '8080',
142
            'PHP_SELF' => '/index.html',
143
        ];
144
        $want = 'http://example.com:8080/index.html';
145
146
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
147
    }
148
149
    /**
150
     * test_GetBaseUrl_WithNotStdPortPart2()
@@ 154-164 (lines=11) @@
151
     *
152
     * getBaseUrl()の動作をテストする(8443ポートを指定)
153
     */
154
    public function test_GetBaseUrl_WithNotStdPortPart2()
155
    {
156
        $test = [
157
            'HTTP_HOST' => 'example.com',
158
            'SERVER_PORT' => '8443',
159
            'PHP_SELF' => '/index.html',
160
        ];
161
        $want = 'https://example.com:8443/index.html';
162
163
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
164
    }
165
166
    /**
167
     * test_GetBaseUrl_WithNotStdPortPart3()
@@ 171-181 (lines=11) @@
168
     *
169
     * getBaseUrl()の動作をテストする(8888ポートを指定)
170
     */
171
    public function test_GetBaseUrl_WithNotStdPortPart3()
172
    {
173
        $test = [
174
            'HTTP_HOST' => 'example.com',
175
            'SERVER_PORT' => '8888',
176
            'PHP_SELF' => '/index.html',
177
        ];
178
        $want = 'http://example.com:8888/index.html';
179
180
        $this->assertEquals( Url::getBaseUrl( $test ), $want );
181
    }
182
}