Completed
Push — master ( d0b786...f128d5 )
by Thomas
07:24
created

JsonLdFormatterTestBase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testValidFormat() 0 12 2
1
<?php
2
3
namespace PPP\Wikidata\ValueFormatters\JsonLd;
4
5
use ValueFormatters\FormatterOptions;
6
use ValueFormatters\Test\ValueFormatterTestBase;
7
use ValueFormatters\ValueFormatter;
8
9
/**
10
 * @license GPL-2.0+
11
 * @author Thomas Pellissier Tanon
12
 */
13
abstract class JsonLdFormatterTestBase extends ValueFormatterTestBase {
14
15
	/**
16
	 * @see JsonLdFormatterTestBase::testValidFormat
17
	 *
18
	 * @dataProvider validProvider
19
	 */
20
	public function testValidFormat(
21
		$value,
22
		$expected,
23
		FormatterOptions $options = null,
24
		ValueFormatter $formatter = null
25
	) {
26
		if ( $formatter === null ) {
27
			$formatter = $this->getInstance( $options );
28
		}
29
30
		$this->assertEquals( $expected, $formatter->format( $value ) );
31
	}
32
33
}
34