Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 83a1931

Browse files
committed
extension factory test for seo
1 parent ca7715a commit 83a1931

File tree

3 files changed

+98
-31
lines changed

3 files changed

+98
-31
lines changed

tests/Unit/DependencyInjection/CmfSonataAdminExtensionTest.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -45,37 +45,6 @@ public function testThatBundlesAreConfigured()
4545
$this->load([]);
4646
}
4747

48-
public function testSeoBundle()
49-
{
50-
$this->container->setParameter(
51-
'kernel.bundles',
52-
array(
53-
'CmfSeoBundle' => true,
54-
'CmfRoutingBundle' => true,
55-
'SonataDoctrinePHPCRAdminBundle' => true,
56-
'DoctrinePHPCRBundle' => true,
57-
'BurgovKeyValueFormBundle' => true,
58-
)
59-
);
60-
61-
$this->load([
62-
'bundles' => [
63-
'seo' => [
64-
'enabled' => true,
65-
'extensions' => [
66-
'metadata' => [
67-
'form_group' => 'seo_group',
68-
'form_tab' => 'seo_tab',
69-
],
70-
],
71-
],
72-
],
73-
]);
74-
75-
$this->assertContainerBuilderHasParameter('cmf_sonata_phpcr_admin_integration.seo.extension.metadata.form_group', 'seo_group');
76-
$this->assertContainerBuilderHasParameter('cmf_sonata_phpcr_admin_integration.seo.extension.metadata.form_tab', 'seo_tab');
77-
}
78-
7948
public function testBlockBundle()
8049
{
8150
$this->container->setParameter(
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony CMF package.
5+
*
6+
* (c) 2011-2017 Symfony CMF
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 Symfony\Cmf\Bundle\SonataPhpcrAdminIntegrationBundle\Tests\Unit\DependencyInjection\Factory;
13+
14+
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
15+
use Symfony\Cmf\Bundle\SonataPhpcrAdminIntegrationBundle\DependencyInjection\CmfSonataPhpcrAdminIntegrationExtension;
16+
17+
/**
18+
* @author Maximilian Berghoff <[email protected]>
19+
*/
20+
abstract class AbstractFactoryTest extends AbstractExtensionTestCase
21+
{
22+
/**
23+
* {@inheritdoc}
24+
*/
25+
protected function getContainerExtensions()
26+
{
27+
return [new CmfSonataPhpcrAdminIntegrationExtension()];
28+
}
29+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony CMF package.
5+
*
6+
* (c) 2011-2017 Symfony CMF
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 Symfony\Cmf\Bundle\SonataPhpcrAdminIntegrationBundle\Tests\Unit\DependencyInjection\Factory;
13+
14+
/**
15+
* @author Maximilian Berghoff <[email protected]>
16+
*/
17+
class SeoAdminFactoryTest extends AbstractFactoryTest
18+
{
19+
20+
public function testParametersBundle()
21+
{
22+
$this->container->setParameter(
23+
'kernel.bundles',
24+
[
25+
'CmfSeoBundle' => true,
26+
'CmfRoutingBundle' => true,
27+
'SonataDoctrinePHPCRAdminBundle' => true,
28+
'DoctrinePHPCRBundle' => true,
29+
'BurgovKeyValueFormBundle' => true,
30+
]
31+
);
32+
33+
$this->load([
34+
'bundles' => [
35+
'seo' => [
36+
'enabled' => true,
37+
'form_group' => 'seo_group',
38+
'form_tab' => 'seo_tab'
39+
],
40+
],
41+
]);
42+
43+
$this->assertContainerBuilderHasParameter('cmf_sonata_phpcr_admin_integration.seo.form_group', 'seo_group');
44+
$this->assertContainerBuilderHasParameter('cmf_sonata_phpcr_admin_integration.seo.form_tab', 'seo_tab');
45+
}
46+
47+
public function testAdminServicesBundle()
48+
{
49+
$this->container->setParameter(
50+
'kernel.bundles',
51+
[
52+
'CmfSeoBundle' => true,
53+
'CmfRoutingBundle' => true,
54+
'SonataDoctrinePHPCRAdminBundle' => true,
55+
'DoctrinePHPCRBundle' => true,
56+
'BurgovKeyValueFormBundle' => true,
57+
]
58+
);
59+
60+
$this->load([
61+
'bundles' => [
62+
'seo' => true,
63+
],
64+
]);
65+
66+
$this->assertContainerBuilderHasService('cmf_sonata_phpcr_admin_integration.seo.extension.metadata');
67+
$this->assertContainerBuilderHasService('cmf_sonata_phpcr_admin_integration.seo.extension.metadata');
68+
}
69+
}

0 commit comments

Comments
 (0)