Completed
Push — master ( 4bfc28...46a6ac )
by Jeroen De
22s queued 10s
created

TemplatedPopupTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testNamedParameters() 0 15 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\Tests\Unit\SemanticMW;
6
7
use DataValues\Geo\Values\LatLongValue;
8
use Maps\SemanticMW\TemplatedPopup;
9
use PHPUnit\Framework\TestCase;
10
11
class TemplatedPopupTest extends TestCase {
12
13
	public function testNamedParameters() {
14
		$popup = new TemplatedPopup( 'MyTemplate', '' );
15
16
		$this->assertSame(
17
			'{{MyTemplate|title=MyTitle|latitude=4|longitude=2|userparam=|Has text=foo|foo|Has more=bar|bar}}',
18
			$popup->getWikiText(
19
				'MyTitle',
20
				new LatLongValue( 4, 2 ),
21
				[
22
					'Has text' => 'foo',
23
					'Has more' => 'bar'
24
				]
25
			)
26
		);
27
	}
28
29
}
30