本文整理匯總了PHP中Shopware\Tests\Mink\Helper::getRequiredSelectors方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::getRequiredSelectors方法的具體用法?PHP Helper::getRequiredSelectors怎麽用?PHP Helper::getRequiredSelectors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shopware\Tests\Mink\Helper
的用法示例。
在下文中一共展示了Helper::getRequiredSelectors方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getNameProperty
/**
* Returns the name
* @param NodeElement $slide
* @return string
*/
public function getNameProperty(NodeElement $slide)
{
$selectors = Helper::getRequiredSelectors($this, ['slideImage', 'slideLink', 'slideName']);
$nameElement = $slide->find('css', $selectors['slideName']);
$names = ['imageAlt' => $slide->find('css', $selectors['slideImage'])->getAttribute('alt'), 'linkTitle' => $slide->find('css', $selectors['slideLink'])->getAttribute('title'), 'name' => $nameElement->getText(), 'nameTitle' => $nameElement->getAttribute('title')];
return Helper::getUnique($names);
}
示例2: getPositions
/**
* Returns the order positions
* @param string[] $locators
* @return array[]
*/
public function getPositions($locators = ['product', 'currentPrice', 'quantity', 'price', 'sum'])
{
$selectors = Helper::getRequiredSelectors($this, $locators);
$elements = Helper::findAllOfElements($this, ['positions']);
$positions = [];
/** @var NodeElement $position */
foreach ($elements['positions'] as $position) {
$positions[] = $this->getOrderPositionData($position, $selectors);
}
return $positions;
}
示例3: getLinkProperty
/**
* Returns the link to the blog article
* @param NodeElement $article
* @return string
*/
public function getLinkProperty(NodeElement $article)
{
$selectors = Helper::getRequiredSelectors($this, ['articleTitle', 'articleLink']);
$links = ['titleLink' => $article->find('css', $selectors['articleTitle'])->getAttribute('href'), 'link' => $article->find('css', $selectors['articleLink'])->getAttribute('href')];
return Helper::getUnique($links);
}