예제 #1
0
파일: setTest.php 프로젝트: cepharum/txf
    public function testXmlConversionReverseConsistency()
    {
        $data = base64_encode(serialize(_A('1', 5, 'test', null, false)));
        $kak_tebja_sawut = "Как тебя зовут?";
        $source = <<<EOT
<?xml version="1.0" encoding="utf-8"?>
<root>
 <messages>
  <message>
   <en>Hello World!</en>
   <de>Hallo Welt!</de>
  </message>
  <message>
   <en>What's your name?</en>
   <de>Wie heißt du?</de>
   <ru>{$kak_tebja_sawut}</ru>
  </message>
  <message/>
 </messages>
 <data>=?8bit?B?{$data}?=</data>
</root>
EOT;
        $this->assertEquals($source, trim(set::fromXml($source)->toXml()->saveXML()));
    }
예제 #2
0
파일: typed_set.php 프로젝트: cepharum/txf
 /**
  * Creates new set from provided XML document.
  *
  * @param string|\SimpleXMLElement $xml xml
  * @return set set representing data found in XML
  */
 public static function fromXml($xml)
 {
     return static::wrap(parent::fromXml($xml));
 }