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
);
static::
assertArrayHasKey('data',
$content);
static::
assertSame([ 'address/city',
'address/company',
'address/country',