Code Duplication    Length = 8-8 lines in 6 locations

risoluto/lib/vendor_test/Risoluto/TextTest/TextTest4AutoUrlLink.php 6 locations

@@ 196-203 (lines=8) @@
193
     *
194
     * autoUrlLink()の挙動をテストする(URLが含まれないテキストの場合、新規ウインドウモードOFF、アトリビュート有り)
195
     */
196
    public function test_AutoUrlLink_WithNoLinks_WithoutNewWindow_WithExtraAttr()
197
    {
198
        $test = '<p>Risoluto is PHP Framework.</p>';
199
        $attr = 'class=\'dummy\'';
200
        $want = '<p>Risoluto is PHP Framework.</p>';
201
202
        $this->assertEquals( Text::autoUrlLink( $test, false, $attr ), $want );
203
    }
204
205
    /**
206
     * test_AutoUrlLink_WithOneHttpLink_WithoutNewWindow_WithExtraAttr()
@@ 210-217 (lines=8) @@
207
     *
208
     * autoUrlLink()の挙動をテストする(URL(http://~)が1つだけ含まれるテキストの場合、新規ウインドウモードOFF、アトリビュート有り)
209
     */
210
    public function test_AutoUrlLink_WithOneHttpLink_WithoutNewWindow_WithExtraAttr()
211
    {
212
        $test = '<p>See: http://www.example.com/</p>';
213
        $attr = 'class=\'dummy\'';
214
        $want = '<p>See: <a href=\'http://www.example.com/\' class=\'dummy\'>http://www.example.com/</a></p>';
215
216
        $this->assertEquals( Text::autoUrlLink( $test, false, $attr ), $want );
217
    }
218
219
    /**
220
     * test_AutoUrlLink_WithOneHttpsLink_WithoutNewWindow_WithExtraAttr()
@@ 224-231 (lines=8) @@
221
     *
222
     * autoUrlLink()の挙動をテストする(URL(https://~)が1つだけ含まれるテキストの場合、新規ウインドウモードOFF、アトリビュート有り)
223
     */
224
    public function test_AutoUrlLink_WithOneHttpsLink_WithoutNewWindow_WithExtraAttr()
225
    {
226
        $test = '<p>See: https://www.example.com/</p>';
227
        $attr = 'class=\'dummy\'';
228
        $want = '<p>See: <a href=\'https://www.example.com/\' class=\'dummy\'>https://www.example.com/</a></p>';
229
230
        $this->assertEquals( Text::autoUrlLink( $test, false, $attr ), $want );
231
    }
232
233
    /**
234
     * test_AutoUrlLink_WithTwoHttpLinks_WithoutNewWindow_WithExtraAttr()
@@ 238-245 (lines=8) @@
235
     *
236
     * autoUrlLink()の挙動をテストする(URL(http://~)が2つ含まれるテキストの場合、新規ウインドウモードOFF、アトリビュート有り)
237
     */
238
    public function test_AutoUrlLink_WithTwoHttpLinks_WithoutNewWindow_WithExtraAttr()
239
    {
240
        $test = '<p>See: http://www.example.com/ and http://www.example.org/</p>';
241
        $attr = 'class=\'dummy\'';
242
        $want = '<p>See: <a href=\'http://www.example.com/\' class=\'dummy\'>http://www.example.com/</a> and <a href=\'http://www.example.org/\' class=\'dummy\'>http://www.example.org/</a></p>';
243
244
        $this->assertEquals( Text::autoUrlLink( $test, false, $attr ), $want );
245
    }
246
247
    /**
248
     * test_AutoUrlLink_WithTwoHttpsLinks_WithoutNewWindow_WithExtraAttr()
@@ 252-259 (lines=8) @@
249
     *
250
     * autoUrlLink()の挙動をテストする(URL(https://~)が2つ含まれるテキストの場合、新規ウインドウモードOFF、アトリビュート有り)
251
     */
252
    public function test_AutoUrlLink_WithTwoHttpsLinks_WithoutNewWindow_WithExtraAttr()
253
    {
254
        $test = '<p>See: https://www.example.com/ and https://www.example.org/</p>';
255
        $attr = 'class=\'dummy\'';
256
        $want = '<p>See: <a href=\'https://www.example.com/\' class=\'dummy\'>https://www.example.com/</a> and <a href=\'https://www.example.org/\' class=\'dummy\'>https://www.example.org/</a></p>';
257
258
        $this->assertEquals( Text::autoUrlLink( $test, false, $attr ), $want );
259
    }
260
261
    /**
262
     * test_AutoUrlLink_WithHttpAndHttpsLinks_WithoutNewWindow_WithExtraAttr()
@@ 266-273 (lines=8) @@
263
     *
264
     * autoUrlLink()の挙動をテストする(URL(http://~とhttps://~)が2つ含まれるテキストの場合、新規ウインドウモードOFF、アトリビュート有り)
265
     */
266
    public function test_AutoUrlLink_WithHttpAndHttpsLinks_WithoutNewWindow_WithExtraAttr()
267
    {
268
        $test = '<p>See: http://www.example.com/ and https://www.example.org/</p>';
269
        $attr = 'class=\'dummy\'';
270
        $want = '<p>See: <a href=\'http://www.example.com/\' class=\'dummy\'>http://www.example.com/</a> and <a href=\'https://www.example.org/\' class=\'dummy\'>https://www.example.org/</a></p>';
271
272
        $this->assertEquals( Text::autoUrlLink( $test, false, $attr ), $want );
273
    }
274
}