MediawikiArticleImageTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetUrl() 0 4 1
A testGetWidth() 0 4 1
A testGetHeight() 0 4 1
A testGetTitle() 0 4 1
1
<?php
2
3
namespace PPP\Wikidata;
4
5
use PPP\Wikidata\Wikipedia\MediawikiArticleImage;
6
7
/**
8
 * @covers PPP\Wikidata\Wikipedia\MediawikiArticleImage
9
 *
10
 * @licence MIT
11
 * @author Thomas Pellissier Tanon
12
 */
13
class MediawikiArticleImageTest extends \PHPUnit_Framework_TestCase {
14
15
	public function testGetUrl() {
16
		$articleImage = new MediawikiArticleImage('http://test.org', 1, 1, 'foo');
17
		$this->assertEquals('http://test.org', $articleImage->getUrl());
18
	}
19
20
	public function testGetWidth() {
21
		$articleImage = new MediawikiArticleImage('http://test.org', 1, 1, 'foo');
22
		$this->assertEquals(1, $articleImage->getWidth());
23
	}
24
25
	public function testGetHeight() {
26
		$articleImage = new MediawikiArticleImage('http://test.org', 1, 1, 'foo');
27
		$this->assertEquals(1, $articleImage->getHeight());
28
	}
29
30
	public function testGetTitle() {
31
		$articleImage = new MediawikiArticleImage('http://test.org', 1, 1, 'foo');
32
		$this->assertEquals('foo', $articleImage->getTitle());
33
	}
34
}
35