Code Duplication    Length = 13-15 lines in 3 locations

tests/php/ORM/DBTextTest.php 2 locations

@@ 129-141 (lines=13) @@
126
127
    /**
128
     */
129
    public function providerLimitSentences()
130
    {
131
        return [
132
            ['', 2, ''],
133
            ['First sentence.', 2, 'First sentence.'],
134
            ['First sentence. Second sentence.', 2, 'First sentence. Second sentence.'],
135
136
            // HTML stored in non-html fields is treated literally.
137
            // If storing HTML you should use DBHTMLText instead
138
            ['<p>First sentence.</p>', 2, '&lt;p&gt;First sentence.&lt;/p&gt;'],
139
            ['<p>First sentence. Second sentence. Third sentence</p>', 2, '&lt;p&gt;First sentence. Second sentence.'],
140
        ];
141
    }
142
143
    /**
144
     * Test {@link DBText->LimitSentences()}
@@ 158-172 (lines=15) @@
155
        $this->assertEquals($expectedValue, $result);
156
    }
157
158
    public function providerFirstSentence()
159
    {
160
        return [
161
            ['', ''],
162
            ['First sentence.', 'First sentence.'],
163
            ['First sentence. Second sentence', 'First sentence.'],
164
            ['First sentence? Second sentence', 'First sentence?'],
165
            ['First sentence! Second sentence', 'First sentence!'],
166
167
            // HTML stored in non-html fields is treated literally.
168
            // If storing HTML you should use DBHTMLText instead
169
            ['<br />First sentence.', '&lt;br /&gt;First sentence.'],
170
            ['<p>First sentence. Second sentence. Third sentence</p>', '&lt;p&gt;First sentence.'],
171
        ];
172
    }
173
174
    /**
175
     * @dataProvider providerFirstSentence

tests/php/ORM/DBHTMLTextTest.php 1 location

@@ 191-205 (lines=15) @@
188
189
190
191
    public function providerFirstSentence()
192
    {
193
        return [
194
            // Same behaviour as DBTextTest
195
            ['', ''],
196
            ['First sentence.', 'First sentence.'],
197
            ['First sentence. Second sentence', 'First sentence.'],
198
            ['First sentence? Second sentence', 'First sentence?'],
199
            ['First sentence! Second sentence', 'First sentence!'],
200
201
            // DBHTHLText strips HTML first
202
            ['<br />First sentence.', 'First sentence.'],
203
            ['<p>First sentence. Second sentence. Third sentence</p>', 'First sentence.'],
204
        ];
205
    }
206
207
    /**
208
     * @dataProvider providerFirstSentence