1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Sonata Project package. |
7
|
|
|
* |
8
|
|
|
* (c) Thomas Rabaix <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Sonata\DoctrinePHPCRAdminBundle\Tests\Unit\DependencyInjection; |
15
|
|
|
|
16
|
|
|
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; |
17
|
|
|
use Sonata\DoctrinePHPCRAdminBundle\DependencyInjection\SonataDoctrinePHPCRAdminExtension; |
18
|
|
|
|
19
|
|
|
class SonataDoctrinePHPCRAdminExtensionTest extends AbstractExtensionTestCase |
20
|
|
|
{ |
21
|
|
|
public function getContainerExtensions(): array |
22
|
|
|
{ |
23
|
|
|
return [ |
24
|
|
|
new SonataDoctrinePHPCRAdminExtension(), |
25
|
|
|
]; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function testDocumentTreeDefaultValues(): void |
29
|
|
|
{ |
30
|
|
|
$this->container->setParameter( |
31
|
|
|
'kernel.bundles', |
32
|
|
|
[] |
33
|
|
|
); |
34
|
|
|
$this->load(['document_tree' => []]); |
35
|
|
|
|
36
|
|
|
$this->assertContainerBuilderHasParameter( |
37
|
|
|
'sonata_admin_doctrine_phpcr.tree_block.configuration', |
38
|
|
|
[ |
39
|
|
|
'routing_defaults' => [], |
40
|
|
|
'repository_name' => null, |
41
|
|
|
'sortable_by' => 'position', |
42
|
|
|
'move' => true, |
43
|
|
|
'reorder' => true, |
44
|
|
|
] |
45
|
|
|
); |
46
|
|
|
|
47
|
|
|
$this->assertContainerBuilderHasParameter( |
48
|
|
|
'sonata_admin_doctrine_phpcr.tree_block.routing_defaults', |
49
|
|
|
[] |
50
|
|
|
); |
51
|
|
|
$this->assertContainerBuilderHasParameter( |
52
|
|
|
'sonata_admin_doctrine_phpcr.tree_block.repository_name', |
53
|
|
|
null |
54
|
|
|
); |
55
|
|
|
$this->assertContainerBuilderHasParameter( |
56
|
|
|
'sonata_admin_doctrine_phpcr.tree_block.sortable_by', |
57
|
|
|
'position' |
58
|
|
|
); |
59
|
|
|
$this->assertContainerBuilderHasParameter( |
60
|
|
|
'sonata_admin_doctrine_phpcr.tree_block.move', |
61
|
|
|
true |
62
|
|
|
); |
63
|
|
|
$this->assertContainerBuilderHasParameter( |
64
|
|
|
'sonata_admin_doctrine_phpcr.tree_block.reorder', |
65
|
|
|
true |
66
|
|
|
); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|