Skip to content

Commit c82ced1

Browse files
author
Hwashiang Yu
committed
MC-31652: File system directory write update
- Updated writeTest docblocks
1 parent b3b80e6 commit c82ced1

File tree

1 file changed

+68
-0
lines changed
  • dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory

1 file changed

+68
-0
lines changed

dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/WriteTest.php

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function testInstance()
4343
* @param string $basePath
4444
* @param int $permissions
4545
* @param string $path
46+
* @throws FileSystemException
47+
* @throws ValidatorException
4648
*/
4749
public function testCreate($basePath, $permissions, $path)
4850
{
@@ -66,6 +68,11 @@ public function createProvider()
6668
];
6769
}
6870

71+
/**
72+
* Test for create outside
73+
*
74+
* @throws FileSystemException
75+
*/
6976
public function testCreateOutside()
7077
{
7178
$exceptions = 0;
@@ -93,6 +100,8 @@ public function testCreateOutside()
93100
*
94101
* @dataProvider deleteProvider
95102
* @param string $path
103+
* @throws FileSystemException
104+
* @throws ValidatorException
96105
*/
97106
public function testDelete($path)
98107
{
@@ -113,6 +122,11 @@ public function deleteProvider()
113122
return [['subdir'], ['subdir/subsubdir']];
114123
}
115124

125+
/**
126+
* Test for delete outside
127+
*
128+
* @throws FileSystemException
129+
*/
116130
public function testDeleteOutside()
117131
{
118132
$exceptions = 0;
@@ -143,6 +157,8 @@ public function testDeleteOutside()
143157
* @param int $permissions
144158
* @param string $name
145159
* @param string $newName
160+
* @throws FileSystemException
161+
* @throws ValidatorException
146162
*/
147163
public function testRename($basePath, $permissions, $name, $newName)
148164
{
@@ -166,6 +182,11 @@ public function renameProvider()
166182
return [['newDir1', 0777, 'first_name.txt', 'second_name.txt']];
167183
}
168184

185+
/**
186+
* Test for rename outside
187+
*
188+
* @throws FileSystemException
189+
*/
169190
public function testRenameOutside()
170191
{
171192
$exceptions = 0;
@@ -200,6 +221,8 @@ public function testRenameOutside()
200221
* @param int $permission
201222
* @param string $name
202223
* @param string $newName
224+
* @throws FileSystemException
225+
* @throws ValidatorException
203226
*/
204227
public function testRenameTargetDir($firstDir, $secondDir, $permission, $name, $newName)
205228
{
@@ -259,6 +282,11 @@ public function copyProvider()
259282
];
260283
}
261284

285+
/**
286+
* Test for copy outside
287+
*
288+
* @throws FileSystemException|ValidatorException
289+
*/
262290
public function testCopyOutside()
263291
{
264292
$exceptions = 0;
@@ -333,6 +361,8 @@ public function copyTargetDirProvider()
333361

334362
/**
335363
* Test for changePermissions method
364+
*
365+
* @throws FileSystemException|ValidatorException
336366
*/
337367
public function testChangePermissions()
338368
{
@@ -341,6 +371,11 @@ public function testChangePermissions()
341371
$this->assertTrue($directory->changePermissions('test_directory', 0644));
342372
}
343373

374+
/**
375+
* Test for changePermissions outside
376+
*
377+
* @throws FileSystemException
378+
*/
344379
public function testChangePermissionsOutside()
345380
{
346381
$exceptions = 0;
@@ -365,6 +400,8 @@ public function testChangePermissionsOutside()
365400

366401
/**
367402
* Test for changePermissionsRecursively method
403+
*
404+
* @throws FileSystemException|ValidatorException
368405
*/
369406
public function testChangePermissionsRecursively()
370407
{
@@ -376,6 +413,11 @@ public function testChangePermissionsRecursively()
376413
$this->assertTrue($directory->changePermissionsRecursively('test_directory', 0777, 0644));
377414
}
378415

416+
/**
417+
* Test for changePermissionsRecursively outside
418+
*
419+
* @throws FileSystemException
420+
*/
379421
public function testChangePermissionsRecursivelyOutside()
380422
{
381423
$exceptions = 0;
@@ -430,6 +472,11 @@ public function touchProvider()
430472
];
431473
}
432474

475+
/**
476+
* Test for touch outside
477+
*
478+
* @throws FileSystemException
479+
*/
433480
public function testTouchOutside()
434481
{
435482
$exceptions = 0;
@@ -454,6 +501,8 @@ public function testTouchOutside()
454501

455502
/**
456503
* Test isWritable method
504+
*
505+
* @throws FileSystemException|ValidatorException
457506
*/
458507
public function testIsWritable()
459508
{
@@ -463,6 +512,11 @@ public function testIsWritable()
463512
$this->assertTrue($directory->isWritable('bar'));
464513
}
465514

515+
/**
516+
* Test isWritable method outside
517+
*
518+
* @throws FileSystemException
519+
*/
466520
public function testIsWritableOutside()
467521
{
468522
$exceptions = 0;
@@ -517,6 +571,11 @@ public function openFileProvider()
517571
];
518572
}
519573

574+
/**
575+
* Test for openFile outside
576+
*
577+
* @throws FileSystemException
578+
*/
520579
public function testOpenFileOutside()
521580
{
522581
$exceptions = 0;
@@ -587,6 +646,11 @@ public function writeFileProvider()
587646
return [['file1', '123', '456'], ['folder1/file1', '123', '456']];
588647
}
589648

649+
/**
650+
* Test for writeFile outside
651+
*
652+
* @throws FileSystemException
653+
*/
590654
public function testWriteFileOutside()
591655
{
592656
$exceptions = 0;
@@ -610,6 +674,8 @@ public function testWriteFileOutside()
610674
}
611675

612676
/**
677+
* Test for invalidDeletePath
678+
*
613679
* @throws ValidatorException
614680
*/
615681
public function testInvalidDeletePath()
@@ -623,6 +689,8 @@ public function testInvalidDeletePath()
623689

624690
/**
625691
* Tear down
692+
*
693+
* @throws ValidatorException|FileSystemException
626694
*/
627695
protected function tearDown(): void
628696
{

0 commit comments

Comments
 (0)