예제 #1
0
 function testSerialize()
 {
     $arr = array('ABC, Inc.', 'North American Division', 'Marketing;Sales');
     $elem = new Compound('ORG');
     $elem->setParts($arr);
     $this->assertEquals("ORG:ABC\\, Inc.;North American Division;Marketing\\;Sales\r\n", $elem->serialize());
 }
예제 #2
0
 function testSetParts()
 {
     $arr = array('ABC, Inc.', 'North American Division', 'Marketing;Sales');
     $elem = new Compound('ORG');
     $elem->setParts($arr);
     $this->assertEquals('ABC\\, Inc.;North American Division;Marketing\\;Sales', $elem->value);
     $this->assertEquals(3, count($elem->getParts()));
     $parts = $elem->getParts();
     $this->assertEquals('Marketing;Sales', $parts[2]);
 }