public function canOverwriteNonExistingFileWithModeX() { $vfsFile = vfsStream::url('foo/overwrite.txt'); $fp = fopen($vfsFile, 'xb'); fwrite($fp, 'test'); fclose($fp); $this->assertEquals('test', file_get_contents($vfsFile)); }