Code Duplication    Length = 13-15 lines in 3 locations

tests/model/DBHTMLTextTest.php 1 location

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

tests/model/DBTextTest.php 2 locations

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