CreateAliasTaskHandler example

$connection = $this->createMock(Connection::class);
        $connection
            ->expects(static::once())
            ->method('fetchAllAssociative')
            ->willThrowException(new \Exception('test'));

        $elasticsearchHelper = $this->createMock(ElasticsearchHelper::class);
        $elasticsearchHelper
            ->expects(static::once())
            ->method('logAndThrowException');

        $handler = new CreateAliasTaskHandler(
            $this->createMock(EntityRepository::class),
            $this->createMock(Client::class),
            $connection,
            $elasticsearchHelper,
            [],
            new EventDispatcher(),
            $this->createMock(AbstractKeyValueStorage::class)
        );

        $handler->run();
    }

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