@@ -63,21 +63,21 @@ public function testEtagChange() {
6363 $ this ->assertNotEquals ($ etag1 , $ etag2 );
6464 }
6565
66-
66+
6767 public function testInvalidArgumentsEmptyArray () {
6868 $ this ->expectException (\InvalidArgumentException::class);
6969
7070 new \OC \Files \Storage \Local ([]);
7171 }
7272
73-
73+
7474 public function testInvalidArgumentsNoArray () {
7575 $ this ->expectException (\InvalidArgumentException::class);
7676
7777 new \OC \Files \Storage \Local (null );
7878 }
7979
80-
80+
8181 public function testDisallowSymlinksOutsideDatadir () {
8282 $ this ->expectException (\OCP \Files \ForbiddenException::class);
8383
@@ -108,4 +108,35 @@ public function testDisallowSymlinksInsideDatadir() {
108108 $ storage ->file_put_contents ('sym/foo ' , 'bar ' );
109109 $ this ->addToAssertionCount (1 );
110110 }
111+
112+ public function testWriteUmaskFilePutContents () {
113+ $ oldMask = umask (0333 );
114+ $ this ->instance ->file_put_contents ('test.txt ' , 'sad ' );
115+ umask ($ oldMask );
116+ $ this ->assertTrue ($ this ->instance ->isUpdatable ('test.txt ' ));
117+ }
118+
119+ public function testWriteUmaskMkdir () {
120+ $ oldMask = umask (0333 );
121+ $ this ->instance ->mkdir ('test.txt ' );
122+ umask ($ oldMask );
123+ $ this ->assertTrue ($ this ->instance ->isUpdatable ('test.txt ' ));
124+ }
125+
126+ public function testWriteUmaskFopen () {
127+ $ oldMask = umask (0333 );
128+ $ handle = $ this ->instance ->fopen ('test.txt ' , 'w ' );
129+ fwrite ($ handle , 'foo ' );
130+ fclose ($ handle );
131+ umask ($ oldMask );
132+ $ this ->assertTrue ($ this ->instance ->isUpdatable ('test.txt ' ));
133+ }
134+
135+ public function testWriteUmaskCopy () {
136+ $ this ->instance ->file_put_contents ('source.txt ' , 'sad ' );
137+ $ oldMask = umask (0333 );
138+ $ this ->instance ->copy ('source.txt ' , 'test.txt ' );
139+ umask ($ oldMask );
140+ $ this ->assertTrue ($ this ->instance ->isUpdatable ('test.txt ' ));
141+ }
111142}
0 commit comments