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