本文整理匯總了PHP中Shopware\Tests\Mink\Helper::getCurrentLanguage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::getCurrentLanguage方法的具體用法?PHP Helper::getCurrentLanguage怎麽用?PHP Helper::getCurrentLanguage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shopware\Tests\Mink\Helper
的用法示例。
在下文中一共展示了Helper::getCurrentLanguage方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: changeShippingMethod
/**
* Changes the shipping method
* @param array $data
*/
public function changeShippingMethod($data = array())
{
$element = $this->getElement('CheckoutPayment');
$language = Helper::getCurrentLanguage($this);
Helper::clickNamedLink($element, 'changeButton', $language);
Helper::fillForm($this, 'shippingPaymentForm', $data);
Helper::pressNamedButton($this, 'changePaymentButton');
}
示例2: searchFor
/**
* Searches the given term in the shop
* @param string $searchTerm
*/
public function searchFor($searchTerm)
{
$data = array(array('field' => 'sSearch', 'value' => $searchTerm));
$searchForm = $this->getElement('SearchForm');
$language = Helper::getCurrentLanguage($this);
Helper::fillForm($searchForm, 'searchForm', $data);
Helper::pressNamedButton($searchForm, 'searchButton', $language);
$this->verifyResponse();
}
示例3: iClickToReadTheBlogArticleOnPosition
/**
* @Given /^I click to read the blog article on position (\d+)$/
*/
public function iClickToReadTheBlogArticleOnPosition($position)
{
/** @var Blog $page */
$page = $this->getPage('Blog');
$language = Helper::getCurrentLanguage($page);
/** @var BlogBox $blogBox */
$blogBox = $this->getMultipleElement($page, 'BlogBox', $position);
Helper::clickNamedLink($blogBox, 'readMore', $language);
}
示例4: iOrderTheArticleOnPosition
/**
* @When /^I order the article on position (?P<position>\d+)$/
*/
public function iOrderTheArticleOnPosition($position)
{
/** @var Listing $page */
$page = $this->getPage('Listing');
$language = Helper::getCurrentLanguage($page);
/** @var ArticleBox $articleBox */
$articleBox = $this->getMultipleElement($page, 'ArticleBox', $position);
Helper::clickNamedLink($articleBox, 'order', $language);
}
示例5: clickActionLink
private function clickActionLink($position, $name)
{
/** @var Note $page */
$page = $this->getPage('Note');
$language = Helper::getCurrentLanguage($page);
/** @var NotePosition $notePosition */
$notePosition = $this->getMultipleElement($page, 'NotePosition', $position);
Helper::clickNamedLink($notePosition, $name, $language);
}
示例6: myFinishedOrderShouldLookLikeThis
/**
* @Given /^my finished order should look like this:$/
*/
public function myFinishedOrderShouldLookLikeThis(TableNode $positions)
{
$orderNumber = $this->getPage('CheckoutConfirm')->getOrderNumber();
$values = $positions->getHash();
/** @var \Shopware\Tests\Mink\Page\Emotion\Account $page */
$page = $this->getPage('Account');
$language = Helper::getCurrentLanguage($page);
$page->open();
Helper::clickNamedLink($page, 'myOrdersLink', $language);
/** @var \Shopware\Tests\Mink\Element\Emotion\AccountOrder $order */
$order = $this->getMultipleElement($page, 'AccountOrder');
$page->checkOrder($order, $orderNumber, $values);
}
示例7: verifyPage
/**
* Verify if we're on an expected page. Throw an exception if not.
*/
public function verifyPage()
{
if ($this->getDriver() instanceof Selenium2Driver) {
$this->getSession()->wait(5000, '$("#sAGB").length > 0');
}
$namedSelectors = $this->getNamedSelectors();
$language = Helper::getCurrentLanguage();
try {
$assert = new WebAssert($this->getSession());
$assert->pageTextContains($namedSelectors['gtc'][$language]);
} catch (ResponseTextException $e) {
$message = ['You are not on the checkout confirmation page!', 'Current URL: ' . $this->getSession()->getCurrentUrl()];
Helper::throwException($message);
}
}
示例8: iFollowTheLinkOfTheElementOnPosition
/**
* @When /^I follow the link "(?P<linkName>[^"]*)" of the element "(?P<elementClass>[^"]*)"$/
* @When /^I follow the link "(?P<linkName>[^"]*)" of the element "(?P<elementClass>[^"]*)" on position (?P<position>\d+)$/
*/
public function iFollowTheLinkOfTheElementOnPosition($linkName, $elementClass, $position = 1)
{
/** @var HelperSelectorInterface $element */
$element = $this->getElement($elementClass);
if ($element instanceof MultipleElement) {
/** @var Homepage $page */
$page = $this->getPage('Homepage');
/** @var MultipleElement $element */
$element->setParent($page);
$element = $element->setInstance($position);
}
if (empty($linkName)) {
$element->click();
return;
}
$language = Helper::getCurrentLanguage($this->getPage('Homepage'));
$selectors = $element->getNamedSelectors();
$element->clickLink($selectors[$linkName][$language]);
}
示例9: searchAddress
/**
* @param AddressBox $addresses
* @param string $name
* @throws \Exception
*/
protected function searchAddress(AddressBox $addresses, $name)
{
/** @var AddressBox $address */
foreach ($addresses as $address) {
if (strpos($address->getProperty('title'), $name) === false) {
continue;
}
$language = Helper::getCurrentLanguage($this);
Helper::pressNamedButton($address, 'chooseButton', $language);
return;
}
$messages = array('The address "' . $name . '" is not available. Available are:');
/** @var AddressBox $address */
foreach ($addresses as $address) {
$messages[] = $address->getProperty('title');
}
Helper::throwException($messages);
}
示例10: proceedToOrderConfirmationWithLogin
/**
* Proceeds to the confirmation page with login
* @param string $eMail
* @param string $password
*/
public function proceedToOrderConfirmationWithLogin($eMail, $password)
{
if ($this->verifyPage()) {
$locatorArray = $this->getNamedSelectors();
$parent = Helper::getContentBlock($this);
$language = Helper::getCurrentLanguage();
$link = $parent->findLink($locatorArray['checkout'][$language]);
if ($this->getDriver() instanceof Selenium2Driver) {
$this->getSession()->visit($link->getAttribute('href'));
} else {
$link->click();
}
}
$this->getPage('Account')->login($eMail, $password);
$this->getPage('CheckoutConfirm')->verifyPage();
}
示例11: proceedToOrderConfirmationWithRegistration
/**
* Proceeds to the confirmation page with registration
* @param array $data
*/
public function proceedToOrderConfirmationWithRegistration(array $data)
{
$language = Helper::getCurrentLanguage($this);
if ($this->verifyPage($language)) {
Helper::clickNamedLink($this, 'checkout', $language);
}
$this->getPage('Account')->register($data);
}
示例12: changeShippingAddress
/**
* @param array $data
*/
public function changeShippingAddress($data = array())
{
$element = $this->getElement('CheckoutShipping');
$language = Helper::getCurrentLanguage($this);
Helper::clickNamedLink($element, 'changeButton', $language);
$account = $this->getPage('Account');
Helper::fillForm($account, 'shippingForm', $data);
Helper::pressNamedButton($account, 'changeShippingButton', $language);
}