Passed
Push — main ( 6731d6...4efee0 )
by Dan Michael O.
11:38
created

RecordTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 25
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testNamespacedXmlToString() 0 4 1
A testMake() 0 5 1
A testXmlToString() 0 4 1
A testToString() 0 4 1
1
<?php namespace Scriptotek\Sru;
2
3
class RecordTest extends TestCase
4
{
5
	public function testMake() {
6
		$record = Record::make(29, 'Hello world');
7
8
		$this->assertInstanceOf('Scriptotek\Sru\Record', $record);
9
		$this->assertEquals(29, $record->position);
10
	}
11
12
	public function testToString() {
13
		$record = Record::make(29, 'Hello world');
14
15
        $this->assertEquals('Hello world', (string) $record);
16
	}
17
18
	public function testXmlToString() {
19
		$record = Record::make(29, '<hello>world</hello>');
20
21
        $this->assertEquals('<hello>world</hello>', (string) $record);
22
	}
23
24
	public function testNamespacedXmlToString() {
25
		$record = Record::make(29, '<c:test xmlns:c="http://www.loc.gov/zing/cql/xcql/">Test</c:test>');
26
27
        $this->assertEquals('<c:test xmlns:c="http://www.loc.gov/zing/cql/xcql/">Test</c:test>', (string) $record);
28
	}
29
}
30