本文整理匯總了PHP中Shopware\Tests\Mink\Helper::findAllOfElements方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::findAllOfElements方法的具體用法?PHP Helper::findAllOfElements怎麽用?PHP Helper::findAllOfElements使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shopware\Tests\Mink\Helper
的用法示例。
在下文中一共展示了Helper::findAllOfElements方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resetFilters
/**
* @inheritdoc
*/
protected function resetFilters()
{
$elements = Helper::findAllOfElements($this, ['filterActiveProperties'], false);
$activeProperties = array_reverse($elements['filterActiveProperties']);
/** @var NodeElement $property */
foreach ($activeProperties as $property) {
$property->click();
}
}
示例2: getMapping
/**
* Returns the banner mapping
* @return array[]
*/
public function getMapping()
{
$elements = Helper::findAllOfElements($this, ['mapping']);
$mapping = [];
foreach ($elements['mapping'] as $link) {
$mapping[] = ['mapping' => $link->getAttribute('href')];
}
return $mapping;
}
示例3: resetFilters
/**
* @throws \Behat\Mink\Exception\ElementException
* @throws \Exception
*/
protected function resetFilters()
{
$elements = Helper::findAllOfElements($this, ['filterFilterProperties']);
/** @var NodeElement $property */
foreach ($elements['filterFilterProperties'] as $property) {
if ($property->isChecked()) {
$property->uncheck();
}
}
$this->pressShowResults();
}
示例4: 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;
}
示例5: getArticles
/**
* Returns all blog articles of the element
* @param string[] $properties
* @return array[]
*/
public function getArticles(array $properties)
{
$elements = Helper::findAllOfElements($this, ['article']);
$articles = [];
/** @var NodeElement $article */
foreach ($elements['article'] as $article) {
$articleProperties = [];
foreach ($properties as $property) {
$method = 'get' . ucfirst($property) . 'Property';
$articleProperties[$property] = $this->{$method}($article);
}
$articles[] = $articleProperties;
}
return $articles;
}
示例6: getSlides
/**
* Returns the slides
* @param string[] $properties
* @return array[]
*/
public function getSlides(array $properties)
{
$elements = Helper::findAllOfElements($this, ['slide']);
$slides = [];
/** @var NodeElement $slide */
foreach ($elements['slide'] as $slide) {
$slideProperties = [];
foreach ($properties as $property) {
$method = 'get' . ucfirst($property) . 'Property';
$slideProperties[$property] = $this->{$method}($slide);
}
$slides[] = $slideProperties;
}
return $slides;
}
示例7: checkAggregation
/**
* Checks the aggregation
* @param $aggregation
* @throws \Exception
*/
public function checkAggregation($aggregation)
{
$elements = Helper::findAllOfElements($this, ['aggregationLabels', 'aggregationValues']);
$lang = Helper::getCurrentLanguage();
$check = [];
foreach ($aggregation as $property) {
$key = $this->getAggregationPosition($elements['aggregationLabels'], $property['label'], $lang);
$check[$property['label']] = Helper::floatArray([$property['value'], $elements['aggregationValues'][$key]->getText()]);
unset($elements['aggregationLabels'][$key]);
unset($elements['aggregationValues'][$key]);
}
$result = Helper::checkArray($check);
if ($result !== true) {
$message = sprintf('The value of "%s" is "%s"! (should be "%s")', $result, $check[$result][1], $check[$result][0]);
Helper::throwException($message);
}
}
示例8: getAddressProperty
/**
* Returns the address elements
* @return Element[]
*/
public function getAddressProperty()
{
$elements = Helper::findAllOfElements($this, ['addressData']);
return $elements['addressData'];
}
示例9: checkEsdArticles
/**
* Helper method checks the ESD articles
* @param string $date
* @param array $articles
* @throws \Exception
*/
private function checkEsdArticles($date, array $articles)
{
$esd = array();
foreach ($articles as $key => $article) {
if (empty($article['esd'])) {
continue;
}
$esd[] = $article['product'];
}
if (empty($esd)) {
return;
}
$language = Helper::getCurrentLanguage($this);
Helper::clickNamedLink($this, 'myEsdDownloads', $language);
$locators = array('esdDownloads');
$elements = Helper::findAllOfElements($this, $locators);
$locator = Helper::getRequiredSelector($this, 'esdDownloadName');
$downloads = array();
/** @var NodeElement $esdDownload */
foreach ($elements['esdDownloads'] as $esdDownload) {
if (strpos($esdDownload->getText(), $date) !== false) {
$downloads[] = $this->find('css', $locator)->getText();
}
}
foreach ($esd as $givenEsd) {
foreach ($downloads as $download) {
if ($givenEsd === $download) {
break;
}
if ($download === end($downloads)) {
$message = sprintf('ESD-Article "%s" not found in account!', $givenEsd);
Helper::throwException($message);
}
}
}
}
示例10: getStarsProperty
/**
* @return float
*/
public function getStarsProperty()
{
$elements = Helper::findAllOfElements($this, ['stars', 'half-star'], false);
return 2 * (count($elements['stars']) + 0.5 * count($elements['half-star']));
}