File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed
MediaGalleryMetadata/Model
MediaGallerySynchronization/Test/Integration/Model
dev/tests/integration/testsuite/Magento/MediaGallerySynchronizationMetadata/Model Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \Framework \Exception \LocalizedException ;
12
12
use Magento \Framework \App \Filesystem \DirectoryList ;
13
13
use Magento \Framework \Filesystem \DriverInterface ;
14
- use Magento \MediaGalleryMetadata \Model \SegmentNames ;
15
14
use Magento \MediaGalleryMetadataApi \Model \FileInterface ;
16
15
use Magento \MediaGalleryMetadataApi \Model \FileInterfaceFactory ;
17
16
use Magento \MediaGalleryMetadataApi \Model \ReadFileInterface ;
@@ -45,26 +44,19 @@ class ReadFile implements ReadFileInterface
45
44
*/
46
45
private $ fileFactory ;
47
46
48
- /**
49
- * @var SegmentNames
50
- */
51
- private $ segmentNames ;
52
-
53
47
/**
54
48
* @param FileInterfaceFactory $fileFactory
55
49
* @param SegmentInterfaceFactory $segmentFactory
56
- * @param SegmentNames $segmentNames
57
50
* @param Filesystem $filesystem
51
+ * @throws FileSystemException
58
52
*/
59
53
public function __construct (
60
54
FileInterfaceFactory $ fileFactory ,
61
55
SegmentInterfaceFactory $ segmentFactory ,
62
- SegmentNames $ segmentNames ,
63
56
Filesystem $ filesystem
64
57
) {
65
58
$ this ->fileFactory = $ fileFactory ;
66
59
$ this ->segmentFactory = $ segmentFactory ;
67
- $ this ->segmentNames = $ segmentNames ;
68
60
$ this ->filesystem = $ filesystem ;
69
61
$ this ->driver = $ this ->filesystem ->getDirectoryWrite (DirectoryList::MEDIA )->getDriver ();
70
62
}
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class ReadFile implements ReadFileInterface
50
50
* @param FileInterfaceFactory $fileFactory
51
51
* @param SegmentInterfaceFactory $segmentFactory
52
52
* @param Filesystem $filesystem
53
+ * @throws FileSystemException
53
54
*/
54
55
public function __construct (
55
56
FileInterfaceFactory $ fileFactory ,
Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ public function testExecute(
83
83
84
84
$ this ->assertEquals ($ title , pathinfo ($ loadedAsset ->getTitle (), PATHINFO_FILENAME ));
85
85
$ this ->assertEquals ($ source , $ loadedAsset ->getSource ());
86
- $ this ->driver ->deleteFile ($ modifiableFilePath );
87
86
}
88
87
89
88
/**
@@ -101,4 +100,12 @@ public function filesProvider(): array
101
100
]
102
101
];
103
102
}
103
+
104
+ /**
105
+ * @inheritdoc
106
+ */
107
+ public function tearDown (): void
108
+ {
109
+ $ this ->mediaDirectory ->getDriver ()->deleteFile ($ this ->mediaDirectory ->getAbsolutePath ());
110
+ }
104
111
}
Original file line number Diff line number Diff line change @@ -95,8 +95,6 @@ public function testExecute(
95
95
$ this ->assertEquals ($ title , pathinfo ($ loadedAssets ->getTitle (), PATHINFO_FILENAME ));
96
96
$ this ->assertEquals ($ description , $ loadedAssets ->getDescription ());
97
97
$ this ->assertEquals ($ keywords , $ loadedKeywords );
98
-
99
- $ this ->driver ->deleteFile ($ modifiableFilePath );
100
98
}
101
99
102
100
/**
@@ -148,4 +146,12 @@ function (KeywordInterface $keyword) {
148
146
$ keywords
149
147
);
150
148
}
149
+
150
+ /**
151
+ * @inheritdoc
152
+ */
153
+ public function tearDown (): void
154
+ {
155
+ $ this ->mediaDirectory ->getDriver ()->deleteFile ($ this ->mediaDirectory ->getAbsolutePath ());
156
+ }
151
157
}
You can’t perform that action at this time.
0 commit comments