@@ -101,13 +101,13 @@ test(function () {
101101 $ cases = [
102102 'r ' => ['ABC ' , 'ABC ' ],
103103 'r+ ' => ['ABC ' , 'ABC ' ],
104- 'w ' => ['' , '' ],
104+ 'w ' => ['' , PHP_VERSION_ID < 70400 ? '' : false ],
105105 'w+ ' => ['' , '' ],
106- 'a ' => ['ABC ' , '' ],
106+ 'a ' => ['ABC ' , PHP_VERSION_ID < 70400 ? '' : false ],
107107 'a+ ' => ['ABC ' , 'ABC ' ],
108- 'x ' => ['' , '' ],
108+ 'x ' => ['' , PHP_VERSION_ID < 70400 ? '' : false ],
109109 'x+ ' => ['' , '' ],
110- 'c ' => ['ABC ' , '' ],
110+ 'c ' => ['ABC ' , PHP_VERSION_ID < 70400 ? '' : false ],
111111 'c+ ' => ['ABC ' , 'ABC ' ],
112112 ];
113113
@@ -129,13 +129,13 @@ test(function () {
129129 $ cases = [
130130 'r ' => ['ABC ' , 'ABC ' ],
131131 'r+ ' => ['_BC ' , '_BC ' ],
132- 'w ' => ['_ ' , '' ],
132+ 'w ' => ['_ ' , PHP_VERSION_ID < 70400 ? '' : false ],
133133 'w+ ' => ['_ ' , '_ ' ],
134- 'a ' => ['ABC_ ' , '' ],
134+ 'a ' => ['ABC_ ' , PHP_VERSION_ID < 70400 ? '' : false ],
135135 'a+ ' => ['ABC_ ' , 'ABC_ ' ],
136- 'x ' => ['_ ' , '' ],
136+ 'x ' => ['_ ' , PHP_VERSION_ID < 70400 ? '' : false ],
137137 'x+ ' => ['_ ' , '_ ' ],
138- 'c ' => ['_BC ' , '' ],
138+ 'c ' => ['_BC ' , PHP_VERSION_ID < 70400 ? '' : false ],
139139 'c+ ' => ['_BC ' , '_BC ' ],
140140 ];
141141
@@ -237,20 +237,20 @@ test(function () {
237237 Assert::same (ftell ($ handleReal ), ftell ($ handleMock ));
238238 Assert::same (file_get_contents ($ pathReal ), file_get_contents ($ pathMock ));
239239
240- Assert::same (fwrite ($ handleReal , 'World ' ), fwrite ($ handleMock , 'World ' ));
240+ Assert::same (@ fwrite ($ handleReal , 'World ' ), fwrite ($ handleMock , 'World ' )); // @ - triggers E_NOTICE since PHP 7.4
241241 Assert::same (ftell ($ handleReal ), ftell ($ handleMock ));
242242 Assert::same (file_get_contents ($ pathReal ), file_get_contents ($ pathMock ));
243243
244244 Assert::same (ftruncate ($ handleReal , 2 ), ftruncate ($ handleMock , 2 ));
245245 Assert::same (ftell ($ handleReal ), ftell ($ handleMock ));
246246 Assert::same (file_get_contents ($ pathReal ), file_get_contents ($ pathMock ));
247247
248- Assert::same (fwrite ($ handleReal , 'World ' ), fwrite ($ handleMock , 'World ' ));
248+ Assert::same (@ fwrite ($ handleReal , 'World ' ), fwrite ($ handleMock , 'World ' )); // @ - triggers E_NOTICE since PHP 7.4
249249 Assert::same (ftell ($ handleReal ), ftell ($ handleMock ));
250250 Assert::same (file_get_contents ($ pathReal ), file_get_contents ($ pathMock ));
251251
252252 Assert::same (fseek ($ handleReal , 2 ), fseek ($ handleMock , 2 ));
253- Assert::same (fread ($ handleReal , 7 ), fread ($ handleMock , 7 ));
253+ Assert::same (@ fread ($ handleReal , 7 ), fread ($ handleMock , 7 )); // @ - triggers E_NOTICE since PHP 7.4
254254 Assert::same (fclose ($ handleReal ), fclose ($ handleMock ));
255255 }
256256
0 commit comments