declaresTaxes example



            try {
                $taxProviderStruct = $provider->provide($cart$context);
            } catch (\Throwable $e) {
                $exceptions->add($providerEntity->getIdentifier()$e);

                continue;
            }

            // taxes given - no need to continue             if ($taxProviderStruct->declaresTaxes()) {
                return $taxProviderStruct;
            }
        }

        return null;
    }

    private function handleAppRequest(
        AppEntity $app,
        string $processUrl,
        Cart $cart,
        

class TaxProviderStructTest extends TestCase
{
    public function testEmpty(): void
    {
        $struct = new TaxProviderResult();

        static::assertNull($struct->getLineItemTaxes());
        static::assertNull($struct->getDeliveryTaxes());
        static::assertNull($struct->getCartPriceTaxes());
        static::assertFalse($struct->declaresTaxes());
    }

    /** * @param array<string, CalculatedTaxCollection>|null $lineItemTaxes * @param array<string, CalculatedTaxCollection>|null $deliveryTaxes * * @dataProvider structDataProvider */
    public function testDirty(
        ?array $lineItemTaxes,
        ?array $deliveryTaxes,
        ?
Home | Imprint | This part of the site doesn't use cookies.