Skip to content

Commit 92b973b

Browse files
committed
B2B-1754: Automate MC-38938
- Fixing MFTF generation errors
1 parent 26e5e71 commit 92b973b

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,20 @@ public function assertPathDoesNotExist($path, $message = ''): void
192192
$this->assertFalse($this->driver->isExists($path), "Failed asserting $path does not exist. " . $message);
193193
}
194194

195+
/**
196+
* Assert a file does not exist on the remote storage system
197+
*
198+
* @param string $filePath
199+
* @param string $message
200+
* @return void
201+
*
202+
* @throws \Magento\Framework\Exception\FileSystemException
203+
*/
204+
public function assertFileDoesNotExist($filePath, $message = ''): void
205+
{
206+
$this->assertFalse($this->driver->isExists($filePath), $message);
207+
}
208+
195209
/**
196210
* Assert a file on the remote storage system has no contents
197211
*
@@ -263,22 +277,7 @@ public function assertGlobbedFileContainsString($path, $pattern, $text, $fileInd
263277
*
264278
* @throws \Magento\Framework\Exception\FileSystemException
265279
*/
266-
public function assertFileDoesNotContainString($filePath, $text, $message = ""): void
267-
{
268-
$this->assertStringNotContainsString($text, $this->driver->fileGetContents($filePath), $message);
269-
}
270-
271-
/**
272-
* Assert a file on the remote storage system does not contain a given string
273-
*
274-
* @param string $filePath
275-
* @param string $text
276-
* @param string $message
277-
* @return void
278-
*
279-
* @throws \Magento\Framework\Exception\FileSystemException
280-
*/
281-
public function assertFileDoesNotContain($filePath, $text, $message = ''): void
280+
public function assertFileDoesNotContainString($filePath, $text, $message = ''): void
282281
{
283282
$this->assertStringNotContainsString($text, $this->driver->fileGetContents($filePath), "Failed asserting $filePath does not contain $text. " . $message);
284283
}

app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,21 @@ public function assertPathDoesNotExist($path, $message = ''): void
180180
$this->assertFalse($this->driver->isExists($realPath), "Failed asserting $path does not exist. " . $message);
181181
}
182182

183+
/**
184+
* Assert a file does not exist
185+
*
186+
* @param string $filePath
187+
* @param string $message
188+
* @return void
189+
*
190+
* @throws \Magento\Framework\Exception\FileSystemException
191+
*/
192+
public function assertFileDoesNotExist($filePath, $message = ''): void
193+
{
194+
$realPath = $this->expandPath($filePath);
195+
$this->assertFalse($this->driver->isExists($realPath), $message);
196+
}
197+
183198
/**
184199
* Assert a file has no contents
185200
*

0 commit comments

Comments
 (0)