PriceDefinitionFieldSerializer example


class PriceDefinitionFieldSerializerTest extends TestCase
{
    private MockObject&RuleConditionRegistry $ruleConditionRegistry;

    private PriceDefinitionFieldSerializer $fieldSerializer;

    protected function setUp(): void
    {
        $definitionInstanceRegistry = $this->createMock(DefinitionInstanceRegistry::class);
        $this->ruleConditionRegistry = $this->createMock(RuleConditionRegistry::class);
        $this->fieldSerializer = new PriceDefinitionFieldSerializer(
            $definitionInstanceRegistry,
            Validation::createValidator(),
            $this->ruleConditionRegistry
        );
    }

    public function testEncodeConstraintViolation(): void
    {
        static::expectException(WriteConstraintViolationException::class);

        $rule = new LineItemListPriceRule();
        
Home | Imprint | This part of the site doesn't use cookies.