Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSuccessfulReadinessCheck.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Install\Test\Page\Install;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertSuccessfulReadinessCheck extends AbstractConstraint
16 {
20  const PHP_VERSION_MESSAGE = 'Your PHP version is correct';
21 
25  const PHP_EXTENSIONS_REGEXP = '/You meet (\d+) out of \1 PHP extensions requirements\./';
26 
30  const FILE_PERMISSION_REGEXP = '/You meet (\d+) out of \1 writable file permission requirements\./';
31 
38  public function processAssert(Install $installPage)
39  {
40  \PHPUnit\Framework\Assert::assertContains(
41  self::PHP_VERSION_MESSAGE,
42  $installPage->getReadinessBlock()->getPhpVersionCheck(),
43  'PHP version is incorrect.'
44  );
45  \PHPUnit\Framework\Assert::assertRegExp(
46  self::PHP_EXTENSIONS_REGEXP,
47  $installPage->getReadinessBlock()->getPhpExtensionsCheck(),
48  'PHP extensions missed.'
49  );
50  \PHPUnit\Framework\Assert::assertRegExp(
51  self::FILE_PERMISSION_REGEXP,
52  $installPage->getReadinessBlock()->getFilePermissionCheck(),
53  'File permissions does not meet requirements.'
54  );
55  }
56 
62  public function toString()
63  {
64  return "PHP Version, PHP Extensions and File Permission are ok.";
65  }
66 }