/**
  * {@inheritdoc}
  */
 public function generateSorting(SortingInterface $sorting, QueryBuilder $query, ShopContextInterface $context)
 {
     /** @var RuleVo[] $rules */
     $rules = $sorting->getRules();
     foreach ($rules as $rule) {
         $this->gateway->addRule($rule, $query);
     }
 }
 /**
  * triggers: Memory allocation error: 1038 Out of sort memory, consider increasing server sort buffer size.
  *
  * so no ->execute()
  */
 public function testIntegrationAll()
 {
     $qb = $this->getQueryBuilder();
     $qb->select('*');
     /** @var AbstractSortDefinition $definition */
     foreach ($this->definitionCollection as $definition) {
         $rule = new RuleVo(1);
         $rule->setOrder(0);
         $rule->setDescending(true);
         $rule->setDefinitionUid($definition->getUniqueIdentifier());
         $this->queryExtensionGateway->addRule($rule, $qb);
         $this->assertContains($definition->getFieldName(), $qb->getSQL());
         $this->assertContains($definition->getTableName(), $qb->getSql());
     }
 }