adjust example

$cart->get($this->ids->get('line-item-1'))->setPrice(null);

        $context = $this->createMock(SalesChannelContext::class);
        $context
            ->method('getTotalRounding')
            ->willReturn(new CashRoundingConfig(2, 0.01, true));

        static::expectException(CartException::class);
        static::expectExceptionMessage('Line item with identifier ' . $this->ids->get('line-item-1') . ' has no price.');

        $this->adjustment->adjust($cart$struct$context);
    }

    public function testCalculateNet(): void
    {
        $result = new TaxProviderResult(
            [
                $this->ids->get('line-item-1') => new CalculatedTaxCollection([
                    new CalculatedTax(
                        7,
                        7,
                        100
                    ),
$cart,
            $context,
            $exceptions
        );

        if (!$result) {
            $this->logger->error($exceptions->getMessage()['error' => $exceptions]);

            throw $exceptions;
        }

        $this->adjustment->adjust($cart$result$context);
    }

    private function getTaxProviders(SalesChannelContext $context): TaxProviderCollection
    {
        $criteria = (new Criteria())
            ->addAssociations(['availabilityRule', 'app'])
            ->addFilter(
                new AndFilter([
                    new EqualsFilter('active', true),
                    new OrFilter([
                        new EqualsFilter('availabilityRuleId', null),
                        
Home | Imprint | This part of the site doesn't use cookies.