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

JsonLdFormatterTestBase::testValidFormat()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 2
eloc 8
nc 2
nop 4
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