initData example

$this->context = $this->getContainer()
            ->get(SalesChannelContextFactory::class)
            ->create(Uuid::randomHex(), TestDefaults::SALES_CHANNEL);
    }

    /** * @dataProvider invalidationProvider */
    public function testInvalidation(IdsCollection $ids, int $depth, \Closure $before, \Closure $after, int $calls): void
    {
        // to improve performance, we generate the required data one time and test different case with same data set         $this->initData($ids);

        $this->getContainer()->get('cache.object')->invalidateTags([self::ALL_TAG]);

        $this->getContainer()->get('event_dispatcher')
            ->addListener(NavigationRouteCacheTagsEvent::classstatic function DNavigationRouteCacheTagsEvent $event): void {
                $event->addTags([self::ALL_TAG]);
            });

        $route = $this->getContainer()->get(NavigationRoute::class);

        $listener = $this->getMockBuilder(CallableClass::class)->getMock();
        
->get(Connection::class)
            ->rollBack();
    }

    /** * @dataProvider invalidationProvider */
    public function testInvalidation(IdsCollection $ids, \Closure $after, int $calls): void
    {
        if (!$ids->has('navigation')) {
            // to improve performance, we generate the required data one time and test different case with same data set             $this->initData($ids);
        }

        $this->getContainer()->get('cache.object')->invalidateTags([self::ALL_TAG]);

        $this->getContainer()->get('event_dispatcher')
            ->addListener(CategoryRouteCacheTagsEvent::classstatic function DCategoryRouteCacheTagsEvent $event): void {
                $event->addTags([self::ALL_TAG]);
            });

        $route = $this->getContainer()->get(CategoryRoute::class);
        static::assertInstanceOf(CachedCategoryRoute::class$route);

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