]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/DAV/PartialUpdate/FileMock.php
Merge branch 'master' of git://github.com/friendica/friendica-addons
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / DAV / PartialUpdate / FileMock.php
1 <?php
2
3 class Sabre_DAV_PartialUpdate_FileMock implements Sabre_DAV_PartialUpdate_IFile {
4
5     protected $data = '';
6
7     function put($str) {
8
9         if (is_resource($str)) {
10             $str = stream_get_contents($str);
11         }
12         $this->data = $str;
13
14     }
15
16     function putRange($str,$start) {
17
18         if (is_resource($str)) {
19             $str = stream_get_contents($str);
20         }
21         $this->data = substr($this->data, 0, $start) . $str . substr($this->data, $start + strlen($str));
22
23
24
25     }
26
27     function get() {
28
29         return $this->data;
30
31     }
32
33     function getContentType() {
34
35         return 'text/plain';
36
37     }
38
39     function getSize() {
40
41         return strlen($this->data);
42
43     }
44
45     function getETag() {
46
47         return '"' . $this->data . '"';
48
49     }
50
51     function delete() {
52
53         throw new Sabre_DAV_Exception_MethodNotAllowed();
54
55     }
56
57     function setName($name) {
58
59         throw new Sabre_DAV_Exception_MethodNotAllowed();
60
61     }
62
63     function getName() {
64
65         return 'partial';
66
67     }
68
69     function getLastModified() {
70
71         return null;
72
73     }
74
75
76 }