marshalToStream() публичный Метод

public marshalToStream ( object $mappedObject, string $streamUri ) : boolean | integer
$mappedObject object
$streamUri string
Результат boolean | integer
Пример #1
0
 /**
  * @test
  */
 public function itShouldMarshalToFilenameStream()
 {
     $simple = new SimpleWithField();
     $xml = $this->marshaller->marshalToStream($simple, "file://" . realpath(__DIR__) . "/../Workspace/Foo.xml");
     $this->assertTrue(strlen($xml) > 0);
     $this->assertXmlStringEqualsXmlFile(realpath(__DIR__) . "/../Workspace/Foo.xml", '<?xml version="1.0" encoding="UTF-8"?><simple-with-field/>');
     @unlink(realpath(__DIR__) . "/../Workspace/Foo.xml");
 }
Пример #2
0
 /**
  * @test
  */
 public function itShouldMarshalToFilenameStream()
 {
     $workspace = realpath(__DIR__ . "/../Workspace");
     if (!is_writable($workspace)) {
         $this->markTestSkipped(sprintf("Cannot write xml to workspace at '%s'", $workspace));
     }
     $path = $workspace . '/Foo.xml';
     $simple = new SimpleWithField();
     $xml = $this->marshaller->marshalToStream($simple, "file://" . $path);
     $this->assertTrue(strlen($xml) > 0);
     $this->assertXmlStringEqualsXmlFile($path, '<?xml version="1.0" encoding="UTF-8"?><simple-with-field/>');
     @unlink($path);
 }