Completed
Push — merge-sm ( 44b830...c70fa4 )
by Jeroen De
10:03 queued 07:12
created

testGivenNull_getFileUrlReturnsNull()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Maps\Test;
4
5
use MapsMapper;
6
7
/**
8
 * @covers MapsMapper
9
 *
10
 * @since 3.6
11
 *
12
 * @group Maps
13
 *
14
 * @licence GNU GPL v2+
15
 * @author Peter Grassberger < [email protected] >
16
 */
17
class MapsMapperTest extends \PHPUnit_Framework_TestCase {
18
19
	public function setUp() {
20
		if ( !defined( 'MEDIAWIKI' ) ) {
21
			$this->markTestSkipped( 'MediaWiki is not available' );
22
		}
23
	}
24
25
    public function imageUrlProvider() {
26
        return [
27
            ['markerImage.png', 'markerImage.png'],
28
            ['/w/images/c/ce/Green_marker.png', '/w/images/c/ce/Green_marker.png'],
29
            ['//semantic-mediawiki.org/w/images/c/ce/Green_marker.png', '//semantic-mediawiki.org/w/images/c/ce/Green_marker.png'],
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, MapsMapper::getFileUrl($file) );
0 ignored issues
show
Deprecated Code introduced by
The method MapsMapper::getFileUrl() has been deprecated.

This method has been deprecated.

Loading history...
41
    }
42
43
    /**
44
     * Tests MapsMapperTest::getFileUrl()
45
     */
46
    public function testGivenNull_getFileUrlReturnsNull() {
47
        $this->assertNull( MapsMapper::getFileUrl(null));
0 ignored issues
show
Deprecated Code introduced by
The method MapsMapper::getFileUrl() has been deprecated.

This method has been deprecated.

Loading history...
48
    }
49
50
    // TODO test with existing imagePage
51
}
52