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

AddressTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A testText() 0 19 1
1
<?php
2
3
namespace SRF\Tests\vCard;
4
5
use SRF\vCard\Address;
6
7
/**
8
 * @covers \SRF\vCard\Address
9
 * @group semantic-result-formats
10
 *
11
 * @license GNU GPL v2+
12
 * @since 3.0
13
 *
14
 * @author mwjames
15
 */
16
class AddressTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$this->assertInstanceOf(
21
			Address::class,
22
			new Address( '', [] )
23
		);
24
	}
25
26
	public function testText() {
27
28
		$adr = [
29
			'pobox'    => '',
30
			'ext'      => '',
31
			'street'   => '2 Example Avenue',
32
			'locality' => 'Anytown',
33
			'region'   => 'Foo',
34
			'code'     => '01111',
35
			'country'  => 'Bar'
36
		];
37
38
		$instance = new Address( '', $adr );
39
40
		$this->assertSame(
41
			"ADR;TYPE=WORK;CHARSET=UTF-8:;;2 Example Avenue;Anytown;Foo;01111;Bar\r\n",
42
			$instance->text()
43
		);
44
	}
45
46
}
47