TaxProviderResponse example

static::assertEquals(new CalculatedTax(5.0, 5.0, 5.0)$response->getDeliveryTaxes()[$this->ids->get('delivery-2')]->getAt(0));
        static::assertEquals(new CalculatedTax(6.0, 6.0, 6.0)$response->getDeliveryTaxes()[$this->ids->get('delivery-2')]->getAt(1));

        static::assertNotNull($response->getCartPriceTaxes());
        static::assertCount(2, $response->getCartPriceTaxes());
        static::assertEquals(new CalculatedTax(7.0, 7.0, 7.0)$response->getCartPriceTaxes()->getAt(0));
        static::assertEquals(new CalculatedTax(8.0, 8.0, 8.0)$response->getCartPriceTaxes()->getAt(1));
    }

    public function testSetters(): void
    {
        $response = new TaxProviderResponse();

        $response->setLineItemTaxes([
            $this->ids->get('line-item-1') => new CalculatedTaxCollection([
                new CalculatedTax(1.0, 1.0, 1.0),
            ]),
            $this->ids->get('line-item-2') => new CalculatedTaxCollection([
                new CalculatedTax(2.0, 2.0, 2.0),
                new CalculatedTax(3.0, 3.0, 3.0),
            ]),
        ]);

        
Home | Imprint | This part of the site doesn't use cookies.