validProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace PPP\Wikidata\ValueFormatters\JsonLd;
4
5
use DataValues\StringValue;
6
use ValueFormatters\FormatterOptions;
7
8
/**
9
 * @covers PPP\Wikidata\ValueFormatters\JsonLd\DispatchingJsonLdDataValueFormatter
10
 *
11
 * @licence AGPLv3+
12
 * @author Thomas Pellissier Tanon
13
 */
14
class DispatchingJsonLdDataValueFormatterTest extends JsonLdFormatterTestBase {
15
16
	/**
17
	 * @see JsonLdFormatterTestBase::validProvider
18
	 */
19
	public function validProvider() {
20
		$formatterMock = $this->getMock('PPP\Wikidata\ValueFormatters\JsonLd\JsonLdDataValueFormatter');
21
		$formatterMock->expects($this->any())
22
			->method('format')
23
			->with($this->equalTo(new StringValue('foo')))
24
			->will($this->returnValue((object) array('@value' => 'foo')));
25
26
		return array(
27
			array(
28
				new StringValue('foo'),
29
				(object) array('@value' => 'foo'),
30
				null,
31
				$formatterMock
32
			),
33
		);
34
	}
35
36
	/**
37
	 * @see JsonLdFormatterTestBase::getInstance
38
	 */
39
	protected function getInstance(FormatterOptions $options = null) {
40
		return null;
41
	}
42
}
43