/** * @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"); }
/** * @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); }