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