Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertLifetimeStatisticsUpdatedMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Reports\Test\Page\Adminhtml\Statistics;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertLifetimeStatisticsUpdatedMessage extends AbstractConstraint
16 {
20  const LIFETIME_STATISTICS_UPDATED_MESSAGE = 'You refreshed lifetime statistics.';
21 
28  public function processAssert(Statistics $reportStatistics)
29  {
30  $successMessage = $reportStatistics->getMessagesBlock()->getSuccessMessage();
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::LIFETIME_STATISTICS_UPDATED_MESSAGE,
33  $successMessage,
34  'Wrong success message is displayed.'
35  . "\nExpected: " . self::LIFETIME_STATISTICS_UPDATED_MESSAGE
36  . "\nActual: " . $successMessage
37  );
38  }
39 
45  public function toString()
46  {
47  return "Correct message is displayed after refreshing lifetime statistics.";
48  }
49 }