getSalesChannelJsonFixtures example

/** * @dataProvider complexStructsProvider */
    public function testEncodeComplexStructs(string $definitionClass, SerializationFixture $fixture): void
    {
        /** @var EntityDefinition $definition */
        $definition = $this->getContainer()->get($definitionClass);
        $encoder = $this->getContainer()->get(JsonEntityEncoder::class);
        $actual = $encoder->encode(new Criteria()$definition$fixture->getInput(), SerializationFixture::SALES_CHANNEL_API_BASE_URL, SerializationFixture::API_VERSION);

        $this->assertValues($fixture->getSalesChannelJsonFixtures()$actual);
    }

    /** * Not possible with dataprovider * as we have to manipulate the container, but the dataprovider run before all tests */
    public function testEncodeStructWithExtension(): void
    {
        $this->registerDefinition(ExtendableDefinition::class, ExtendedDefinition::class);
        $extendableDefinition = new ExtendableDefinition();
        $extendableDefinition->addExtension(new AssociationExtension());
        
Home | Imprint | This part of the site doesn't use cookies.