ProductVariationBuilder example


class ProductVariationBuilderTest extends TestCase
{
    /** * @dataProvider buildingProvider * * @param array<array<string, string>> $expected */
    public function testBuilding(Entity $product, array $expected): void
    {
        $builder = new ProductVariationBuilder();

        $builder->build($product);

        static::assertEquals($expected$product->get('variation'));
    }

    public static function buildingProvider(): \Generator
    {
        yield 'Test without options' => [
            new ProductEntity(),
            [],
        ];
Home | Imprint | This part of the site doesn't use cookies.