File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Test/Unit/Model/Wysiwyg/Images Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ public function createDirectory($name, $path)
416
416
{
417
417
if (!preg_match (self ::DIRECTORY_NAME_REGEXP , $ name )) {
418
418
throw new \Magento \Framework \Exception \LocalizedException (
419
- __ ('Please rename the folder using only letters, numbers, underscores and dashes. ' )
419
+ __ ('Please rename the folder using only Latin letters, numbers, underscores and dashes. ' )
420
420
);
421
421
}
422
422
Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Cms \Model \Wysiwyg \Images \Storage \Collection as StorageCollection ;
9
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
+ use Magento \Framework \Exception \LocalizedException ;
10
11
11
12
/**
12
13
* @SuppressWarnings(PHPMD.LongVariable)
@@ -539,4 +540,18 @@ public function testUploadFile()
539
540
540
541
$ this ->assertEquals ($ result , $ this ->imagesStorage ->uploadFile ($ targetPath , $ type ));
541
542
}
543
+
544
+ /**
545
+ * Test create directory with invalid name
546
+ */
547
+ public function testCreateDirectoryWithInvalidName ()
548
+ {
549
+ $ name = 'папка ' ;
550
+ $ path = '/tmp/path ' ;
551
+ $ this ->expectException (LocalizedException::class);
552
+ $ this ->expectExceptionMessage (
553
+ (string )__ ('Please rename the folder using only Latin letters, numbers, underscores and dashes. ' )
554
+ );
555
+ $ this ->imagesStorage ->createDirectory ($ name , $ path );
556
+ }
542
557
}
You can’t perform that action at this time.
0 commit comments