Code Duplication    Length = 9-17 lines in 3 locations

tests/php/ORM/DBTextTest.php 1 location

@@ 17-26 (lines=10) @@
14
    /**
15
     * Test {@link Text->LimitCharacters()}
16
     */
17
    public function providerLimitCharacters()
18
    {
19
        // Plain text values always encoded safely
20
        // HTML stored in non-html fields is treated literally.
21
        return [
22
            ['The little brown fox jumped over the lazy cow.', 'The little brown fox...'],
23
            ['<p>Short & Sweet</p>', '&lt;p&gt;Short &amp; Sweet&lt;/p&gt;'],
24
            ['This text contains &amp; in it', 'This text contains &amp;...'],
25
        ];
26
    }
27
28
    /**
29
     * Test {@link Text->LimitCharacters()}

tests/php/ORM/DBHTMLTextTest.php 2 locations

@@ 37-45 (lines=9) @@
34
    /**
35
     * Test {@link Text->LimitCharacters()}
36
     */
37
    public function providerLimitCharacters()
38
    {
39
        // HTML characters are stripped safely
40
        return [
41
            ['The little brown fox jumped over the lazy cow.', 'The little brown fox...'],
42
            ['<p>Short &amp; Sweet</p>', 'Short &amp; Sweet'],
43
            ['This text contains &amp; in it', 'This text contains &amp;...'],
44
        ];
45
    }
46
47
    /**
48
     * Test {@link DBHTMLText->LimitCharacters()}
@@ 243-259 (lines=17) @@
240
        $this->assertEquals(['a'], $field->getWhitelist());
241
    }
242
243
    public function providerToPlain()
244
    {
245
        return [
246
            [
247
                '<p><img />Lots of <strong>HTML <i>nested</i></strong> tags',
248
                'Lots of HTML nested tags',
249
            ],
250
            [
251
                '<p>Multi</p><p>Paragraph<br>Also has multilines.</p>',
252
                "Multi\n\nParagraph\nAlso has multilines.",
253
            ],
254
            [
255
                '<p>Collapses</p><p></p><p>Excessive<br/><br /><br>Newlines</p>',
256
                "Collapses\n\nExcessive\n\nNewlines",
257
            ]
258
        ];
259
    }
260
261
    /**
262
     * @dataProvider providerToPlain