/** * @When /^I view (oldest|newest) products from (taxon "([^"]+)")$/ */ public function iViewSortedProductsFromTaxon($sortDirection, TaxonInterface $taxon) { $sorting = ['createdAt' => 'oldest' === $sortDirection ? 'asc' : 'desc']; $this->indexPage->open(['slug' => $taxon->getSlug(), 'sorting' => $sorting]); }