Completed
Push — MediaWikiFileUrlFinderTest ( d58bee...394f02 )
by Jeroen De
08:48
created

MapsMapperTest   A

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
namespace Maps\Tests\Integration;
4
5
use Maps\MapsFunctions;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * @covers MapsFunctions
10
 *
11
 * @licence GNU GPL v2+
12
 * @author Peter Grassberger < [email protected] >
13
 */
14
class MapsMapperTest extends TestCase {
15
16
	public function setUp() {
17
		if ( !defined( 'MEDIAWIKI' ) ) {
18
			$this->markTestSkipped( 'MediaWiki is not available' );
19
		}
20
	}
21
22
	public function imageUrlProvider() {
23
		return [
24
			[ 'markerImage.png', 'markerImage.png' ],
25
			[ '/w/images/c/ce/Green_marker.png', '/w/images/c/ce/Green_marker.png' ],
26
			[
27
				'//semantic-mediawiki.org/w/images/c/ce/Green_marker.png',
28
				'//semantic-mediawiki.org/w/images/c/ce/Green_marker.png'
29
			],
30
			[ 'Cat2.jpg', 'Cat2.jpg' ],
31
		];
32
	}
33
34
	/**
35
	 * Tests MapsMapperTest::getFileUrl()
36
	 *
37
	 * @dataProvider imageUrlProvider
38
	 */
39
	public function testGetFileUrl( $file, $expected ) {
40
		$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...
41
	}
42
}
43