MapsMapperTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 2
A imageUrlProvider() 0 11 1
A testGetFileUrl() 0 3 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\Tests\Integration;
6
7
use Maps\MapsFunctions;
8
use PHPUnit\Framework\TestCase;
9
10
/**
11
 * @covers MapsFunctions
12
 *
13
 * @licence GNU GPL v2+
14
 * @author Peter Grassberger < [email protected] >
15
 */
16
class MapsMapperTest extends TestCase {
17
18
	public function setUp(): void {
19
		if ( !defined( 'MEDIAWIKI' ) ) {
20
			$this->markTestSkipped( 'MediaWiki is not available' );
21
		}
22
	}
23
24
	public function imageUrlProvider() {
25
		return [
26
			[ 'markerImage.png', 'markerImage.png' ],
27
			[ '/w/images/c/ce/Green_marker.png', '/w/images/c/ce/Green_marker.png' ],
28
			[
29
				'//semantic-mediawiki.org/w/images/c/ce/Green_marker.png',
30
				'//semantic-mediawiki.org/w/images/c/ce/Green_marker.png'
31
			],
32
			[ 'Cat2.jpg', 'Cat2.jpg' ],
33
		];
34
	}
35
36
	/**
37
	 * Tests MapsMapperTest::getFileUrl()
38
	 *
39
	 * @dataProvider imageUrlProvider
40
	 */
41
	public function testGetFileUrl( $file, $expected ) {
42
		$this->assertSame( $expected, MapsFunctions::getFileUrl( $file ) );
0 ignored issues
show
Deprecated Code introduced by
The method Maps\MapsFunctions::getFileUrl() has been deprecated.

This method has been deprecated.

Loading history...
43
	}
44
}
45