RevisionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testDataIsRetained() 0 15 1
A testGivenStringId_getterReturnsInteger() 0 4 1
1
<?php
2
3
namespace Tests\Queryr\DumpReader;
4
5
use Queryr\DumpReader\Revision;
6
7
/**
8
 * @covers Queryr\DumpReader\Revision
9
 *
10
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class RevisionTest extends \PHPUnit_Framework_TestCase {
14
15
	public function testDataIsRetained() {
16
		$id = 42;
17
		$model = 'cats';
18
		$format = 'spam';
19
		$text = 'foo';
20
		$timeStamp = 'bar';
21
22
		$page = new Revision( $id, $model, $format, $text, $timeStamp );
23
24
		$this->assertSame( $id, $page->getId() );
25
		$this->assertSame( $model, $page->getModel() );
26
		$this->assertSame( $format, $page->getFormat() );
27
		$this->assertSame( $text, $page->getText() );
28
		$this->assertSame( $timeStamp, $page->getTimeStamp() );
29
	}
30
31
	public function testGivenStringId_getterReturnsInteger() {
32
		$page = new Revision( '42', '', '', '', '' );
33
		$this->assertSame( 42, $page->getId() );
34
	}
35
36
}