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

StringFormatterTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 0
cbo 3
dl 0
loc 35
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 3 1
A validProvider() 0 17 2
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