Exemplo n.º 1
0
 /**
  * Verify if we're on an expected page. Throw an exception if not.
  * @throws \Exception
  */
 public function verifyPage()
 {
     if (Helper::hasNamedLinks($this, ['rssFeed', 'atomFeed']) == true) {
         return;
     }
     $message = ['You are not on blog page!', 'Current URL: ' . $this->getSession()->getCurrentUrl()];
     Helper::throwException($message);
 }
Exemplo n.º 2
0
 /**
  * Verify if we're on an expected page. Throw an exception if not.
  */
 public function verifyPage()
 {
     $result = Helper::hasNamedLinks($this, ['compareLink', 'rememberLink', 'commentLink', 'inquiryLink']);
     if ($result === true) {
         return;
     }
     $message = ['You are not on a detail page:'];
     foreach ($result as $key => $value) {
         $message[] = "- Link '{$key}' ('{$value}') not found!";
     }
     $message[] = 'Current URL: ' . $this->getSession()->getCurrentUrl();
     Helper::throwException($message);
 }
Exemplo n.º 3
0
 /**
  * Helper function to check weather we are on the account dashboard
  * @return bool
  */
 protected function verifyPageDashboard()
 {
     return Helper::hasNamedLinks($this, ['myAccountLink', 'myOrdersLink', 'myEsdDownloadsLink', 'changeBillingLink', 'changeShippingLink', 'changePaymentLink', 'noteLink', 'logoutLink']) === true ?: false;
 }