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

RecordTest::testMake()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
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