public function usableInSave() { $out = new MemoryOutputStream(); // Create DOM and save it to stream $dom = new \DOMDocument(); $dom->appendChild($dom->createElement('root'))->appendChild($dom->createElement('child', 'übercoder')); $dom->save(Streams::writeableUri($out)); // Check file contents $this->assertEquals('<?xml version="1.0"?>' . "\n" . '<root><child>übercoder</child></root>', trim($out->getBytes())); }
public function statNonExistingWriteableUri() { $uri = Streams::writeableUri(new MemoryOutputStream()); fclose(fopen($uri, 'w')); $this->assertFalse(@stat($uri)); }