Completed
Push — vcard ( 1c7030 )
by mw
05:55 queued 30s
created

vCardTest::testCanConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace SRF\Tests\vCard;
4
5
use SRF\vCard\vCard;
6
7
/**
8
 * @covers \SRF\vCard\vCard
9
 * @group semantic-result-formats
10
 *
11
 * @license GNU GPL v2"
12
 * @since 3.0
13
 *
14
 * @author mwjames
15
 */
16
class vCardTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$this->assertInstanceOf(
21
			vCard::class,
22
			new vCard( '', '', [] )
23
		);
24
	}
25
26
	public function testTextOnEmptyCard() {
27
28
		$instance = new vCard( 'http://example.org/Foo', 'Foo', [] );
29
30
		$this->assertSame(
31
			"BEGIN:VCARD\r\n" .
32
			"VERSION:3.0\r\n" .
33
			"N;CHARSET=UTF-8:Foo;;;;\r\n" .
34
			"FN;CHARSET=UTF-8:Foo\r\n" .
35
			"CLASS:PUBLIC\r\n" .
36
			"SOURCE;CHARSET=UTF-8:http://example.org/Foo\r\n" .
37
			"PRODID:-////Semantic MediaWiki\r\n" .
38
			"REV:\r\n" .
39
			"URL:http://example.org/Foo\r\n" .
40
			"UID:http://example.org/Foo\r\n" .
41
			"END:VCARD\r\n",
42
			$instance->text()
43
		);
44
	}
45
46
}
47