Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertAgreementTextPresent.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Install\Test\Page\Install;
10 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertAgreementTextPresent extends AbstractConstraint
17 {
21  const DEFAULT_LICENSE_AGREEMENT_TEXT = 'Open Software License ("OSL") v. 3.0';
22 
26  const LICENSE_AGREEMENT_TEXT = 'END USER LICENSE AGREEMENT';
27 
34  public function processAssert(Install $installPage)
35  {
36  try {
37  \PHPUnit\Framework\Assert::assertContains(
38  self::LICENSE_AGREEMENT_TEXT,
39  $installPage->getLicenseBlock()->getLicense(),
40  'License agreement text is absent.'
41  );
42  } catch (\Exception $e) {
43  \PHPUnit\Framework\Assert::assertContains(
44  self::DEFAULT_LICENSE_AGREEMENT_TEXT,
45  $installPage->getLicenseBlock()->getLicense(),
46  'License agreement text is absent.'
47  );
48  }
49  }
50 
56  public function toString()
57  {
58  return "License agreement text is present on Terms & Agreement page.";
59  }
60 }