Doctrine\Tests\OXM\Marshaller\MarshallerTest::itShouldMarshalToFilenameStream PHP Method

itShouldMarshalToFilenameStream() public method

    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);
    }