DispatchingJsonLdDataValueFormatterTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

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