@@ -120,9 +120,9 @@ public function testCodeRollback()
120
120
$ this ->setupCodeBackupRollback ();
121
121
$ this ->file ->expects ($ this ->once ())
122
122
->method ('isExists ' )
123
- ->with ($ this ->path . '/backups/RollbackFile_A .tgz ' )
123
+ ->with ($ this ->path . '/backups/12345_filesystem_code .tgz ' )
124
124
->willReturn (true );
125
- $ this ->model ->codeRollback ('RollbackFile_A .tgz ' );
125
+ $ this ->model ->codeRollback ('12345_filesystem_code .tgz ' );
126
126
}
127
127
128
128
/**
@@ -134,7 +134,7 @@ public function testCodeRollbackWithInvalidFilePath()
134
134
$ this ->file ->expects ($ this ->once ())
135
135
->method ('isExists ' )
136
136
->willReturn (false );
137
- $ this ->model ->codeRollback ('RollbackFile_A .tgz ' );
137
+ $ this ->model ->codeRollback ('12345_filesystem_code .tgz ' );
138
138
}
139
139
140
140
/**
@@ -143,24 +143,9 @@ public function testCodeRollbackWithInvalidFilePath()
143
143
*/
144
144
public function testCodeRollbackWithInvalidFileType ()
145
145
{
146
- $ this ->file ->expects ($ this ->once ())
147
- ->method ('isExists ' )
148
- ->willReturn (true );
149
146
$ this ->model ->codeRollback ('RollbackFile_A.txt ' );
150
147
}
151
148
152
- /**
153
- * @expectedException \Magento\Framework\Exception\LocalizedException
154
- * @expectedExceptionMessage Invalid rollback file.
155
- */
156
- public function testCodeRollbackWithInvalidFileFormat ()
157
- {
158
- $ this ->file ->expects ($ this ->once ())
159
- ->method ('isExists ' )
160
- ->willReturn (true );
161
- $ this ->model ->codeRollback ('RollbackFile.gz ' );
162
- }
163
-
164
149
public function testMediaBackup ()
165
150
{
166
151
$ this ->setupCodeBackupRollback ();
@@ -177,9 +162,9 @@ public function testMediaRollback()
177
162
$ this ->setupCodeBackupRollback ();
178
163
$ this ->file ->expects ($ this ->once ())
179
164
->method ('isExists ' )
180
- ->with ($ this ->path . '/backups/RollbackFile_A .tgz ' )
165
+ ->with ($ this ->path . '/backups/12345_filesystem_media .tgz ' )
181
166
->willReturn (true );
182
- $ this ->model ->codeRollback ('RollbackFile_A .tgz ' , Factory::TYPE_MEDIA );
167
+ $ this ->model ->codeRollback ('12345_filesystem_media .tgz ' , Factory::TYPE_MEDIA );
183
168
}
184
169
185
170
public function testDbBackup ()
@@ -197,9 +182,9 @@ public function testDbRollback()
197
182
$ this ->database ->expects ($ this ->once ())->method ('rollback ' );
198
183
$ this ->file ->expects ($ this ->once ())
199
184
->method ('isExists ' )
200
- ->with ($ this ->path . '/backups/RollbackFile_A .gz ' )
185
+ ->with ($ this ->path . '/backups/12345_db .gz ' )
201
186
->willReturn (true );
202
- $ this ->model ->dbRollback ('RollbackFile_A .gz ' );
187
+ $ this ->model ->dbRollback ('12345_db .gz ' );
203
188
}
204
189
205
190
private function setupCodeBackupRollback ()
@@ -217,7 +202,7 @@ private function setupCodeBackupRollback()
217
202
->willReturn ('RollbackFile_A.tgz ' );
218
203
$ this ->filesystem ->expects ($ this ->once ())
219
204
->method ('getBackupPath ' )
220
- ->willReturn ('pathToFile/RollbackFile_A .tgz ' );
205
+ ->willReturn ('pathToFile/12345_filesystem_code .tgz ' );
221
206
$ this ->log ->expects ($ this ->once ())
222
207
->method ('logSuccess ' );
223
208
}
@@ -235,7 +220,7 @@ private function setupDbBackupRollback()
235
220
->willReturn ('RollbackFile_A.gz ' );
236
221
$ this ->database ->expects ($ this ->once ())
237
222
->method ('getBackupPath ' )
238
- ->willReturn ('pathToFile/RollbackFile_A.gz ' );
223
+ ->willReturn ('pathToFile/12345_db.tgz ' );
239
224
$ this ->log ->expects ($ this ->once ())
240
225
->method ('logSuccess ' );
241
226
}
0 commit comments