Пример #1
0
 public function marshallComplexProvider()
 {
     $samples = self::samplesDir();
     $returnValue = array();
     $returnValue[] = array(new Point(10, 20), json_encode(array('base' => array('point' => array(10, 20)))));
     $returnValue[] = array(new Pair('A', 'B'), json_encode(array('base' => array('pair' => array('A', 'B')))));
     $returnValue[] = array(new DirectedPair('a', 'b'), json_encode(array('base' => array('directedPair' => array('a', 'b')))));
     $returnValue[] = array(new Duration('P3DT4H'), json_encode(array('base' => array('duration' => 'P3DT4H'))));
     $file = new FileSystemFile($samples . 'datatypes/file/text-plain_text_data.txt');
     $returnValue[] = array($file, json_encode(array('base' => array('file' => array('mime' => $file->getMimeType(), 'data' => base64_encode($file->getData()), 'name' => 'text.txt')))));
     $file = new FileSystemFile($samples . 'datatypes/file/image-png_noname_data.png');
     $returnValue[] = array($file, json_encode(array('base' => array('file' => array('mime' => $file->getMimeType(), 'data' => base64_encode($file->getData()))))));
     return $returnValue;
 }