Skip to content

Commit e431712

Browse files
committed
MTA-1594: Re-factor Functional tests which are not end-to-end
- Added in assert incoming total count of records
1 parent 1f60991 commit e431712

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertMassProductUpdateSuccessMessage.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ class AssertMassProductUpdateSuccessMessage extends AbstractConstraint
1717
/**
1818
* Text value to be checked.
1919
*/
20-
const SUCCESS_MESSAGE = 'A total of 1 record(s) were updated.';
20+
const SUCCESS_MESSAGE = 'A total of %s record(s) were updated.';
2121

2222
/**
2323
* Assert that after mass update successful message appears.
2424
*
2525
* @param CatalogProductIndex $productGrid
26+
* @param array $products
2627
* @return void
2728
*/
28-
public function processAssert(CatalogProductIndex $productGrid)
29+
public function processAssert(CatalogProductIndex $productGrid, $products = [])
2930
{
31+
$countProducts = count($products) ? count($products) : 1;
32+
$expectedMessage = sprintf(self::SUCCESS_MESSAGE, $countProducts);
3033
$actualMessage = $productGrid->getMessagesBlock()->getSuccessMessages();
3134
\PHPUnit_Framework_Assert::assertEquals(
32-
self::SUCCESS_MESSAGE,
35+
$expectedMessage,
3336
$actualMessage,
3437
'Wrong success message is displayed.'
3538
);

0 commit comments

Comments
 (0)