-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetonoEditorJSExtensionTest.php
54 lines (46 loc) · 1.99 KB
/
SetonoEditorJSExtensionTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
declare(strict_types=1);
namespace Setono\EditorJSBundle\Tests\DependencyInjection;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
use Setono\EditorJS\Parser\Parser;
use Setono\EditorJS\Parser\ParserInterface;
use Setono\EditorJS\Renderer\Renderer;
use Setono\EditorJS\Renderer\RendererInterface;
use Setono\EditorJSBundle\BlockRenderer\TwigBlockRenderer;
use Setono\EditorJSBundle\DependencyInjection\SetonoEditorJSExtension;
use Setono\EditorJSBundle\Twig\Extension;
use Setono\EditorJSBundle\Twig\Runtime;
/**
* @covers \Setono\EditorJSBundle\DependencyInjection\SetonoEditorJSExtension
*/
final class SetonoEditorJSExtensionTest extends AbstractExtensionTestCase
{
protected function getContainerExtensions(): array
{
return [
new SetonoEditorJSExtension(),
];
}
/**
* @test
*/
public function it_loads_services(): void
{
$this->load();
$services = [
['id' => 'setono_editorjs.block_renderer.twig', 'class' => TwigBlockRenderer::class, 'tag' => 'setono_editorjs.block_renderer', 'tagAttributes' => ['priority' => '-100']],
['id' => ParserInterface::class, 'class' => Parser::class],
['id' => 'setono_editorjs.parser', 'class' => Parser::class],
['id' => RendererInterface::class, 'class' => Renderer::class],
['id' => 'setono_editorjs.renderer', 'class' => Renderer::class],
['id' => 'setono_editorjs.twig.extension', 'class' => Extension::class, 'tag' => 'twig.extension'],
['id' => 'setono_editorjs.twig.runtime', 'class' => Runtime::class, 'tag' => 'twig.runtime'],
];
foreach ($services as $service) {
if (isset($service['tag'])) {
$this->assertContainerBuilderHasServiceDefinitionWithTag($service['id'], $service['tag'], $service['tagAttributes'] ?? []);
}
$this->assertContainerBuilderHasService($service['id'], $service['class']);
}
}
}