1111
1212use OC \Files \ObjectStore \ObjectStoreStorage ;
1313use OC \Files \ObjectStore \S3 ;
14- use OCP \Files \IMimeTypeLoader ;
1514use OCP \IConfig ;
1615use OCP \Server ;
1716use Test \Traits \EncryptionTrait ;
@@ -140,7 +139,7 @@ protected function tearDown(): void {
140139 private function cleanupTestFiles (): void {
141140 // Clean up any test files that match our patterns
142141 $ patterns = ['test-size-* ' , 'test-roundtrip-* ' , 'test-integrity-* ' ,
143- 'test-partial-read* ' , 'test-seek* ' , 'test-multipart* ' , 'test.txt ' ];
142+ 'test-partial-read* ' , 'test-seek* ' , 'test-multipart* ' , 'test.txt ' ];
144143
145144 foreach ($ patterns as $ pattern ) {
146145 try {
@@ -206,7 +205,7 @@ public function testSizeConsistencyAcrossSources(int $originalSize): void {
206205 $ bytesWritten = $ this ->view ->file_put_contents ($ testFile , $ data );
207206
208207 $ this ->assertEquals ($ originalSize , $ bytesWritten ,
209- " file_put_contents should return original size written " );
208+ ' file_put_contents should return original size written ' );
210209
211210 // 2. Get database size (from filecache via userFolder)
212211 $ node = $ this ->userFolder ->get ($ testFile );
@@ -235,15 +234,15 @@ public function testSizeConsistencyAcrossSources(int $originalSize): void {
235234 if ($ originalSize === 0 ) {
236235 // Zero-byte files still get encryption header in S3
237236 $ this ->assertGreaterThan (0 , $ s3Size ,
238- " S3 should have encryption header even for empty files " );
237+ ' S3 should have encryption header even for empty files ' );
239238 } else {
240239 $ this ->assertGreaterThan ($ originalSize , $ s3Size ,
241240 "S3 size should be larger than original due to encryption overhead (original: $ originalSize, s3: $ s3Size) " );
242241 }
243242
244243 // Verify content integrity - critical!
245244 $ this ->assertEquals ($ data , $ content ,
246- " Content should be identical after encrypt/decrypt cycle - corruption detected! " );
245+ ' Content should be identical after encrypt/decrypt cycle - corruption detected! ' );
247246
248247 // Validate encryption overhead is reasonable
249248 // Binary signed format: Header (8192 bytes) + data blocks
@@ -254,9 +253,9 @@ public function testSizeConsistencyAcrossSources(int $originalSize): void {
254253 if ($ originalSize === 0 ) {
255254 // Zero-byte files still get encryption header
256255 $ this ->assertGreaterThan (0 , $ s3Size ,
257- " Even empty files should have encryption header in S3 " );
256+ ' Even empty files should have encryption header in S3 ' );
258257 $ this ->assertLessThanOrEqual (8192 , $ s3Size ,
259- " Empty file should only have header block " );
258+ ' Empty file should only have header block ' );
260259 } else {
261260 $ overheadPercent = (($ s3Size - $ originalSize ) / $ originalSize ) * 100 ;
262261
@@ -300,7 +299,7 @@ public function testEncryptedFileRoundTrip(int $size): void {
300299 $ this ->assertEquals ($ size , strlen ($ readData ));
301300
302301 // Verify content
303- $ this ->assertEquals ($ data , $ readData , " Content mismatch after round trip " );
302+ $ this ->assertEquals ($ data , $ readData , ' Content mismatch after round trip ' );
304303
305304 // Clean up
306305 $ this ->view ->unlink ($ testFile );
@@ -331,8 +330,8 @@ public function testEncryptedFileIntegrity(int $size): void {
331330 fclose ($ handle );
332331
333332 // Verify
334- $ this ->assertEquals ($ size , strlen ($ readData ), " Size mismatch in streaming read " );
335- $ this ->assertEquals ($ data , $ readData , " Content mismatch in streaming read " );
333+ $ this ->assertEquals ($ size , strlen ($ readData ), ' Size mismatch in streaming read ' );
334+ $ this ->assertEquals ($ data , $ readData , ' Content mismatch in streaming read ' );
336335
337336 // Clean up
338337 $ this ->view ->unlink ($ testFile );
@@ -430,12 +429,12 @@ public function testEncryptedMultipartUpload(): void {
430429 $ node = $ this ->userFolder ->get ($ testFile );
431430 $ dbSize = $ node ->getSize ();
432431 $ this ->assertEquals ($ size , $ dbSize ,
433- " Database should have unencrypted size even for multipart upload " );
432+ ' Database should have unencrypted size even for multipart upload ' );
434433
435434 // Verify content
436435 $ readData = $ this ->view ->file_get_contents ($ testFile );
437436 $ this ->assertEquals ($ data , $ readData ,
438- " Content mismatch for multipart encrypted upload " );
437+ ' Content mismatch for multipart encrypted upload ' );
439438
440439 // Clean up
441440 $ this ->view ->unlink ($ testFile );
@@ -486,7 +485,7 @@ public function testEncryptedFileMimeType(): void {
486485
487486 // Should detect as text/plain
488487 $ this ->assertEquals ('text/plain ' , $ mimeType ,
489- " MIME type detection should work on encrypted files " );
488+ ' MIME type detection should work on encrypted files ' );
490489
491490 // Clean up
492491 $ this ->view ->unlink ($ testFile );
0 commit comments