Skip to content

Commit 977931a

Browse files
committed
Merge pull request #121 from uwej711/move_termsformtype_to_core
moved TermsFormType to CoreBundle
2 parents d94ce6b + aa21958 commit 977931a

File tree

6 files changed

+11
-99
lines changed

6 files changed

+11
-99
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Changelog
22
=========
33

4+
* **2013-07-17**: [FormType] Moved TermsFormType to CoreBundle and renamed it to CheckboxUrlLableFormType
45
* **2013-05-28**: [Bundle] Only include Doctrine PHPCR compiler pass if PHPCR-ODM is present
56
* **2013-05-25**: [Bundle] Drop symfony_ from symfony_cmf prefix
67
* **2013-05-24**: [Document] ContentRepository now requires ManagerRegistry in the constructor and provides `setManagerName()` in the same way as RouteProvider

DependencyInjection/CmfRoutingExtension.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ public function load(array $configs, ContainerBuilder $container)
4444

4545
$this->setupFormTypes($config, $container, $loader);
4646

47-
// if there is twig, register our form type with twig
48-
if ($container->hasParameter('twig.form.resources')) {
49-
$resources = $container->getParameter('twig.form.resources');
50-
$container->setParameter('twig.form.resources', array_merge($resources, array('CmfRoutingBundle:Form:terms_form_type.html.twig')));
51-
}
52-
5347
if ($config['use_sonata_admin']) {
5448
$this->loadSonataAdmin($config, $loader, $container);
5549
}

Form/Type/TermsFormType.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

Resources/config/form_type.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@
55

66
<parameters>
77
<parameter key="cmf_routing.route_type_type_class">Symfony\Cmf\Bundle\RoutingBundle\Form\Type\RouteTypeType</parameter>
8-
<parameter key="cmf_routing.terms_form_type_class">Symfony\Cmf\Bundle\RoutingBundle\Form\Type\TermsFormType</parameter>
98
</parameters>
109

1110
<services>
12-
13-
<service id="cmf_routing.terms_form_type" class="%cmf_routing.terms_form_type_class%">
14-
<tag name="form.type" alias="cmf_routing_terms_form_type" />
15-
<argument type="service" id="router" />
16-
</service>
17-
1811
<service id="cmf_routing.route_type_form_type" class="%cmf_routing.route_type_type_class%">
1912
<tag name="form.type" alias="cmf_routing_route_type" />
2013
</service>

Resources/views/Form/terms_form_type.html.twig

Lines changed: 0 additions & 8 deletions
This file was deleted.

Tests/Functional/Admin/RouteAdminTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212

1313
class RouteAdminTest extends BaseTestCase
1414
{
15-
/**
16-
* @var RouteAdmin
15+
/**
16+
* @var RouteAdmin
1717
*/
1818
private static $routeAdmin;
19-
20-
/**
21-
* @var \PHPUnit_Framework_MockObject_MockObject
19+
20+
/**
21+
* @var \PHPUnit_Framework_MockObject_MockObject
2222
*/
2323
private $errorElement;
2424

2525
public static function setupBeforeClass(array $options = array(), $routebase = null)
2626
{
2727
parent::setUpBeforeClass($options, $routebase);
28-
self::$routeAdmin = self::$kernel->getContainer()->get('cmf_routing.route_admin');
28+
self::$routeAdmin = self::$kernel->getContainer()->get('cmf_routing.route_admin');
2929
}
30-
30+
3131
protected function setUp()
3232
{
3333
$this->errorElement = $this->getMockBuilder('Sonata\AdminBundle\Validator\ErrorElement')
@@ -54,10 +54,10 @@ public function testControllerPathViolation()
5454
->will($this->returnSelf());
5555
$this->errorElement->expects($this->once())
5656
->method('end');
57-
57+
5858
self::$routeAdmin->validate($this->errorElement, $route);
5959
}
60-
60+
6161
public function testTemplateViolation()
6262
{
6363
$route = new Route('/', array('_template' => 'NotExistingBundle:Foo:bar.html.twig'));
@@ -77,7 +77,7 @@ public function testTemplateViolation()
7777

7878
public function testCorrectTemplate()
7979
{
80-
$route = new Route('/', array('_template' => 'CmfRoutingBundle:Form:terms_form_type.html.twig'));
80+
$route = new Route('/', array('_template' => 'TwigBundle::layout.html.twig'));
8181
self::$routeAdmin->validate($this->errorElement, $route);
8282
}
8383
}

0 commit comments

Comments
 (0)