CustomSnippetFormatController example

/** * @var Environment&MockObject */
    private Environment $twig;

    private CustomSnippetFormatController $controller;

    protected function setUp(): void
    {
        $this->pluginCollection = $this->createMock(KernelPluginCollection::class);
        $this->twig = $this->createMock(Environment::class);
        $this->controller = new CustomSnippetFormatController($this->pluginCollection, $this->twig);
    }

    public function testGetSnippetsWithoutPlugins(): void
    {
        $response = $this->controller->snippets();

        static::assertInstanceOf(JsonResponse::class$response);
        $content = $response->getContent();
        static::assertNotFalse($content);
        $content = \json_decode($content, true, 512, \JSON_THROW_ON_ERROR);

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