Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSecureUrlEnabled.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Client\BrowserInterface;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 use Magento\Backend\Test\Page\Adminhtml\Dashboard;
12 use Magento\Customer\Test\Page\CustomerAccountLogin;
13 
17 class AssertSecureUrlEnabled extends AbstractConstraint
18 {
19  /* tags */
20  const SEVERITY = 'low';
21  /* end tags */
22 
31  public function processAssert(
32  BrowserInterface $browser,
33  Dashboard $dashboard,
34  CustomerAccountLogin $customerAccountLogin
35  ) {
36  $dashboard->open();
37  \PHPUnit\Framework\Assert::assertTrue(
38  strpos($browser->getUrl(), 'https://') !== false,
39  'Secure Url is not displayed on backend.'
40  );
41 
42  $customerAccountLogin->open();
43  \PHPUnit\Framework\Assert::assertTrue(
44  strpos($browser->getUrl(), 'https://') !== false,
45  'Secure Url is not displayed on frontend.'
46  );
47  }
48 
54  public function toString()
55  {
56  return 'Secure Urls are displayed successful.';
57  }
58 }
processAssert(BrowserInterface $browser, Dashboard $dashboard, CustomerAccountLogin $customerAccountLogin)