本文整理汇总了PHP中Shopware\Tests\Mink\Helper::getPageInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::getPageInfo方法的具体用法?PHP Helper::getPageInfo怎么用?PHP Helper::getPageInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopware\Tests\Mink\Helper
的用法示例。
在下文中一共展示了Helper::getPageInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verifyPage
/**
* Verify if we're on an expected page. Throw an exception if not.
* @throws \Exception
*/
public function verifyPage()
{
$info = Helper::getPageInfo($this->getSession(), ['controller']);
if ($info['controller'] === 'note') {
return;
}
$message = ['You are not on the note!', 'Current URL: ' . $this->getSession()->getCurrentUrl()];
Helper::throwException($message);
}
示例2: verifyPage
/**
* @param string $language
* @return bool
* @throws \Exception
*/
public function verifyPage($language = '')
{
$info = Helper::getPageInfo($this->getSession(), ['controller', 'action']);
if ($info['controller'] === 'checkout' && $info['action'] === 'cart') {
return Helper::hasNamedLink($this, 'checkout', $language);
}
$message = ['You are not on the cart!', 'Current URL: ' . $this->getSession()->getCurrentUrl()];
Helper::throwException($message);
return false;
}
示例3: iSubscribeToTheNewsletterWith
/**
* @When /^I subscribe to the newsletter with "(?P<email>[^"]*)"$/
* @When /^I subscribe to the newsletter with "(?P<email>[^"]*)" :$/
*/
public function iSubscribeToTheNewsletterWith($email, TableNode $additionalData = null)
{
$pageInfo = Helper::getPageInfo($this->getSession(), ['controller']);
$pageName = ucfirst($pageInfo['controller']);
$data = [['field' => 'newsletter', 'value' => $email]];
if ($pageName === 'Index') {
$pageName = 'Homepage';
} elseif ($pageName === 'Newsletter' && $additionalData) {
$data = array_merge($data, $additionalData->getHash());
}
/** @var Homepage|\Shopware\Tests\Mink\Page\Emotion\Newsletter $page */
$page = $this->getPage($pageName);
$page->subscribeNewsletter($data);
}
示例4: theCurrentPaymentMethodShouldBe
/**
* @Then /^the current payment method should be "([^"]*)"$/
*/
public function theCurrentPaymentMethodShouldBe($paymentMethod)
{
$pageInfo = Helper::getPageInfo($this->getSession(), array('controller'));
$pageName = ucfirst($pageInfo['controller']) === 'Checkout' ? 'CheckoutConfirm' : 'Account';
$this->getPage($pageName)->checkPaymentMethod($paymentMethod);
}