LineItemGroupUnitPriceNetPackager example


            $this->fakeTakeAllRuleMatcher,
            new LineItemQuantitySplitter($quantityPriceCalculator),
            new ProductLineItemProvider()
        );

        $this->unitTestBuilder = new LineItemGroupBuilder(
            new LineItemGroupServiceRegistry(
                [
                    new LineItemGroupCountPackager(),
                    new LineItemGroupUnitPriceGrossPackager(),
                    new LineItemGroupUnitPriceNetPackager(),
                ],
                [
                    new LineItemGroupPriceAscSorter(),
                    new LineItemGroupPriceDescSorter(),
                ]
            ),
            new AnyRuleMatcher(new AnyRuleLineItemMatcher()),
            new LineItemQuantitySplitter($quantityPriceCalculator),
            new ProductLineItemProvider()
        );
    }

    

    use LineItemTestFixtureBehaviour;

    private LineItemGroupPackagerInterface $packager;

    private MockObject&SalesChannelContext $context;

    protected function setUp(): void
    {
        parent::setUp();

        $this->packager = new LineItemGroupUnitPriceNetPackager();

        $this->context = $this->getMockBuilder(SalesChannelContext::class)->disableOriginalConstructor()->getMock();
    }

    /** * This test verifies that our key identifier is not touched without recognizing it. * Please keep in mind, if you change the identifier, there might still * be old keys in the SetGroup entities in the database of shops, that * try to execute a packager that does not exist anymore with this key. * * @group lineitemgroup */
#[Package('checkout')] class LineItemGroupServiceRegistryTest extends TestCase
{
    /** * This test verifies that our packagers are * correctly registered in our registry. */
    public function testPackagersAreRegistered(): void
    {
        $packagers = [
            new LineItemGroupCountPackager(),
            new LineItemGroupUnitPriceNetPackager(),
        ];
        $sorters = [];

        $registry = new LineItemGroupServiceRegistry($packagers$sorters);

        $generator = iterator_to_array($registry->getPackagers());
        static::assertCount(2, $generator);
    }

    /** * This test verifies that our sorters are * correctly registered in our registry. */
Home | Imprint | This part of the site doesn't use cookies.