Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing a few Symfony 2.1 BC Breaks

FormType to use FormBuilderInterface
Deprecated methods and events
Using config to retrieve dispatcher in tests for override
Removing extra event attachment, fixes #18
  • Loading branch information...
commit bc9b5f0a7d7ffdb6c12022c76ca16decf7c96456 1 parent bfde734
@rdohms authored
View
2  phpunit.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<phpunit bootstrap="vendor/.composer/autoload.php" colors="true" verbose="true">
+<phpunit bootstrap="vendor/autoload.php" colors="true" verbose="true">
<testsuites>
<testsuite name="DMS Suite">
View
3  src/DMS/Bundle/FilterBundle/Form/EventListener/DelegatingFilterListener.php
@@ -34,7 +34,6 @@ static public function getSubscribedEvents()
{
return array(
FormEvents::POST_BIND => array("onPostBind", 1024),
- FormEvents::BIND_NORM_DATA => array("onPostBind", 1024),
);
}
@@ -49,7 +48,7 @@ public function onPostBind($event)
if ( ! $form->isRoot()) return;
- $clientData = $event->getForm()->getClientData();
+ $clientData = $event->getForm()->getData();
if ( ! is_object($clientData)) return;
View
4 src/DMS/Bundle/FilterBundle/Tests/Form/EventListener/DelegatingFilterListenerTest.php
@@ -127,7 +127,7 @@ public function testFilterIgnoresNoObject()
->will($this->returnValue(true));
$form->expects($this->once())
- ->method('getClientData')
+ ->method('getData')
->will($this->returnValue(array(1,2,3)));
$this->delegate->expects($this->never())
@@ -146,7 +146,7 @@ public function testFilterOnPostBind()
->will($this->returnValue(true));
$form->expects($this->once())
- ->method('getClientData')
+ ->method('getData')
->will($this->returnValue($entity));
$this->delegate->expects($this->once())
View
6 src/DMS/Bundle/FilterBundle/Tests/Form/Type/FormTypeFilterExtensionTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Symfony\Component\Form\Tests\Extension\Validator\Type;
+namespace DMS\Bundle\FilterBundle\Tests\Form\Type;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormEvents;
@@ -47,7 +47,7 @@ public function testFilterSubscriberDefined()
/** @var $form \Symfony\Component\Form\Form */
$form = $this->factory->create('form');
- $dispatcher = $this->readAttribute($form, 'dispatcher');
+ $dispatcher = $form->getConfig()->getEventDispatcher();
$listeners = $dispatcher->getListeners(FormEvents::POST_BIND);
@@ -69,7 +69,7 @@ public function testFilterSubscriberDisabled()
/** @var $form \Symfony\Component\Form\Form */
$form = $this->factory->create('form');
- $dispatcher = $this->readAttribute($form, 'dispatcher');
+ $dispatcher = $form->getConfig()->getEventDispatcher();
$listeners = $dispatcher->getListeners(FormEvents::POST_BIND);
}
View
4 src/DMS/Bundle/LauncherBundle/Form/RegistrationForm.php
@@ -3,11 +3,11 @@
namespace DMS\Bundle\LauncherBundle\Form;
use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\FormBuilder;
+use Symfony\Component\Form\FormBuilderInterface;
class RegistrationForm extends AbstractType
{
- public function buildForm(FormBuilder $builder, array $options)
+ public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', null, array(
Please sign in to comment.
Something went wrong with that request. Please try again.