Skip to content

Commit 9e31562

Browse files
Merge branch '2.3' into 2.5
* 2.3: [2.3] Remove useless tests skips [2.3] Cleanup deprecations Conflicts: src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Bundle/TwigBundle/composer.json src/Symfony/Component/Debug/Tests/MockExceptionHandler.php src/Symfony/Component/Debug/composer.json src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php src/Symfony/Component/HttpKernel/composer.json src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php src/Symfony/Component/Security/composer.json
2 parents be317fa + 16085b7 commit 9e31562

File tree

6 files changed

+30
-21
lines changed

6 files changed

+30
-21
lines changed

ButtonBuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ public function setByReference($byReference)
386386
* @param bool $virtual
387387
*
388388
* @throws BadMethodCallException
389+
*
390+
* @deprecated since version 2.3, to be removed in 3.0. Use
391+
* {@link setInheritData()} instead.
389392
*/
390393
public function setVirtual($virtual)
391394
{
@@ -588,6 +591,9 @@ public function getByReference()
588591
* Unsupported method.
589592
*
590593
* @return bool Always returns false.
594+
*
595+
* @deprecated since version 2.3, to be removed in 3.0. Use
596+
* {@link getInheritData()} instead.
591597
*/
592598
public function getVirtual()
593599
{

Test/DeprecationErrorHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use Symfony\Component\Form\FormEvent;
1515

16+
/**
17+
* @deprecated since version 2.3, to be removed in 3.0.
18+
*/
1619
class DeprecationErrorHandler
1720
{
1821
public static function handle($errorNumber, $message, $file, $line, $context)

Tests/AbstractLayoutTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ protected function assertWidgetMatchesXpath(FormView $view, array $vars, $xpath)
101101

102102
abstract protected function renderForm(FormView $view, array $vars = array());
103103

104-
abstract protected function renderEnctype(FormView $view);
104+
protected function renderEnctype(FormView $view)
105+
{
106+
$this->markTestSkipped(sprintf('Legacy %s::renderEnctype() is not implemented.', get_class($this)));
107+
}
105108

106109
abstract protected function renderLabel(FormView $view, $label = null, array $vars = array());
107110

@@ -119,17 +122,21 @@ abstract protected function renderEnd(FormView $view, array $vars = array());
119122

120123
abstract protected function setTheme(FormView $view, array $themes);
121124

122-
public function testEnctype()
125+
public function testLegacyEnctype()
123126
{
127+
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
128+
124129
$form = $this->factory->createNamedBuilder('name', 'form')
125130
->add('file', 'file')
126131
->getForm();
127132

128133
$this->assertEquals('enctype="multipart/form-data"', $this->renderEnctype($form->createView()));
129134
}
130135

131-
public function testNoEnctype()
136+
public function testLegacyNoEnctype()
132137
{
138+
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
139+
133140
$form = $this->factory->createNamedBuilder('name', 'form')
134141
->add('text', 'text')
135142
->getForm();

Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php renamed to Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
use Symfony\Component\Form\Form;
1616
use Symfony\Component\Form\FormConfigBuilder;
1717
use Symfony\Component\Form\FormEvent;
18-
use Symfony\Component\Form\Test\DeprecationErrorHandler;
1918
use Symfony\Component\HttpFoundation\Request;
2019
use Symfony\Component\HttpFoundation\File\UploadedFile;
2120

2221
/**
2322
* @author Bernhard Schussek <[email protected]>
2423
*/
25-
class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
24+
class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
2625
{
2726
private $values;
2827

@@ -37,6 +36,8 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
3736

3837
protected function setUp()
3938
{
39+
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
40+
4041
$path = tempnam(sys_get_temp_dir(), 'sf2');
4142
touch($path);
4243

@@ -98,7 +99,7 @@ public function testSubmitRequest($method)
9899
$event = new FormEvent($form, $request);
99100

100101
$listener = new BindRequestListener();
101-
DeprecationErrorHandler::preBind($listener, $event);
102+
$listener->preBind($event);
102103

103104
$this->assertEquals(array(
104105
'name' => 'Bernhard',
@@ -121,7 +122,7 @@ public function testSubmitRequestWithEmptyName($method)
121122
$event = new FormEvent($form, $request);
122123

123124
$listener = new BindRequestListener();
124-
DeprecationErrorHandler::preBind($listener, $event);
125+
$listener->preBind($event);
125126

126127
$this->assertEquals(array(
127128
'name' => 'Bernhard',
@@ -146,7 +147,7 @@ public function testSubmitEmptyRequestToCompoundForm($method)
146147
$event = new FormEvent($form, $request);
147148

148149
$listener = new BindRequestListener();
149-
DeprecationErrorHandler::preBind($listener, $event);
150+
$listener->preBind($event);
150151

151152
// Default to empty array
152153
$this->assertEquals(array(), $event->getData());
@@ -168,7 +169,7 @@ public function testSubmitEmptyRequestToSimpleForm($method)
168169
$event = new FormEvent($form, $request);
169170

170171
$listener = new BindRequestListener();
171-
DeprecationErrorHandler::preBind($listener, $event);
172+
$listener->preBind($event);
172173

173174
// Default to null
174175
$this->assertNull($event->getData());
@@ -187,7 +188,7 @@ public function testSubmitGetRequest()
187188
$event = new FormEvent($form, $request);
188189

189190
$listener = new BindRequestListener();
190-
DeprecationErrorHandler::preBind($listener, $event);
191+
$listener->preBind($event);
191192

192193
$this->assertEquals(array(
193194
'name' => 'Bernhard',
@@ -207,7 +208,7 @@ public function testSubmitGetRequestWithEmptyName()
207208
$event = new FormEvent($form, $request);
208209

209210
$listener = new BindRequestListener();
210-
DeprecationErrorHandler::preBind($listener, $event);
211+
$listener->preBind($event);
211212

212213
$this->assertEquals(array(
213214
'name' => 'Bernhard',
@@ -229,7 +230,7 @@ public function testSubmitEmptyGetRequestToCompoundForm()
229230
$event = new FormEvent($form, $request);
230231

231232
$listener = new BindRequestListener();
232-
DeprecationErrorHandler::preBind($listener, $event);
233+
$listener->preBind($event);
233234

234235
$this->assertEquals(array(), $event->getData());
235236
}
@@ -247,7 +248,7 @@ public function testSubmitEmptyGetRequestToSimpleForm()
247248
$event = new FormEvent($form, $request);
248249

249250
$listener = new BindRequestListener();
250-
DeprecationErrorHandler::preBind($listener, $event);
251+
$listener->preBind($event);
251252

252253
$this->assertNull($event->getData());
253254
}

Tests/Extension/Validator/ValidatorTypeGuesserTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ class ValidatorTypeGuesserTest extends \PHPUnit_Framework_TestCase
5050

5151
protected function setUp()
5252
{
53-
if (!class_exists('Symfony\Component\Validator\Constraint')) {
54-
$this->markTestSkipped('The "Validator" component is not available');
55-
}
56-
5753
$this->metadata = new ClassMetadata(self::TEST_CLASS);
5854
$this->metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface');
5955
$this->metadataFactory->expects($this->any())

Tests/ResolvedFormTypeTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ protected function setUp()
5757

5858
public function testGetOptionsResolver()
5959
{
60-
if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) {
61-
$this->markTestSkipped('This test requires PHPUnit 3.7.');
62-
}
63-
6460
$test = $this;
6561
$i = 0;
6662

0 commit comments

Comments
 (0)