Completed
Pull Request — master (#67)
by no
04:32 queued 02:44
created

StringFormatterTest::getFormatterClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace ValueFormatters\Test;
4
5
use DataValues\StringValue;
6
use ValueFormatters\FormatterOptions;
7
use ValueFormatters\StringFormatter;
8
9
/**
10
 * @covers ValueFormatters\StringFormatter
11
 *
12
 * @group ValueFormatters
13
 * @group DataValueExtensions
14
 *
15
 * @license GPL-2.0+
16
 * @author Katie Filbert < [email protected] >
17
 */
18
class StringFormatterTest extends ValueFormatterTestBase {
19
20
	/**
21
	 * @see ValueFormatterTestBase::getInstance
22
	 *
23
	 * @param FormatterOptions|null $options
24
	 *
25
	 * @return StringFormatter
26
	 */
27
	protected function getInstance( FormatterOptions $options = null ) {
28
		return new StringFormatter( $options );
29
	}
30
31
	/**
32
	 * @see ValueFormatterTestBase::validProvider
33
	 */
34
	public function validProvider() {
35
		$strings = [
36
			'ice cream',
37
			'cake',
38
			'',
39
			' a ',
40
			'  ',
41
		];
42
43
		$argLists = [];
44
45
		foreach ( $strings as $string ) {
46
			$argLists[] = [ new StringValue( $string ), $string ];
47
		}
48
49
		return $argLists;
50
	}
51
52
}
53