Skip to content

Commit 1006f54

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: [2.6] cleanup deprecated uses [2.5] cleanup deprecated uses Conflicts: src/Symfony/Component/Form/composer.json src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php
2 parents dbc38d1 + d9c620a commit 1006f54

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

Tests/DataCollector/LoggerDataCollectorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\HttpKernel\Tests\DataCollector;
1313

14-
use Symfony\Component\Debug\ErrorHandler;
1514
use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
1615

1716
class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase

Tests/EventListener/ProfilerListenerTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpKernel\Tests\EventListener;
1313

14+
use Symfony\Component\HttpFoundation\RequestStack;
1415
use Symfony\Component\HttpKernel\EventListener\ProfilerListener;
1516
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
1617
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -23,11 +24,11 @@ class ProfilerListenerTest extends \PHPUnit_Framework_TestCase
2324
{
2425
/**
2526
* Test to ensure BC without RequestStack
26-
*
27-
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
2827
*/
29-
public function testEventsWithoutRequestStack()
28+
public function testLegacyEventsWithoutRequestStack()
3029
{
30+
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
31+
3132
$profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile')
3233
->disableOriginalConstructor()
3334
->getMock();
@@ -86,15 +87,16 @@ public function testKernelTerminate()
8687
->disableOriginalConstructor()
8788
->getMock();
8889

90+
$requestStack = new RequestStack();
91+
$requestStack->push($masterRequest);
92+
8993
$onlyException = true;
90-
$listener = new ProfilerListener($profiler, null, $onlyException);
94+
$listener = new ProfilerListener($profiler, null, $onlyException, false, $requestStack);
9195

9296
// master request
93-
$listener->onKernelRequest(new GetResponseEvent($kernel, $masterRequest, Kernel::MASTER_REQUEST));
9497
$listener->onKernelResponse(new FilterResponseEvent($kernel, $masterRequest, Kernel::MASTER_REQUEST, $response));
9598

9699
// sub request
97-
$listener->onKernelRequest(new GetResponseEvent($kernel, $subRequest, Kernel::SUB_REQUEST));
98100
$listener->onKernelException(new GetResponseForExceptionEvent($kernel, $subRequest, Kernel::SUB_REQUEST, new HttpException(404)));
99101
$listener->onKernelResponse(new FilterResponseEvent($kernel, $subRequest, Kernel::SUB_REQUEST, $response));
100102

Tests/EventListener/EsiListenerTest.php renamed to Tests/EventListener/SurrogateListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Symfony\Component\HttpFoundation\Request;
2121
use Symfony\Component\EventDispatcher\EventDispatcher;
2222

23-
class EsiListenerTest extends \PHPUnit_Framework_TestCase
23+
class SurrogateListenerTest extends \PHPUnit_Framework_TestCase
2424
{
2525
public function testFilterDoesNothingForSubRequests()
2626
{

Tests/KernelTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,21 +274,21 @@ public function doStuff()
274274
$this->assertEquals($expected, $output);
275275
}
276276

277-
public function testIsClassInActiveBundleFalse()
277+
public function testLegacyIsClassInActiveBundleFalse()
278278
{
279279
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
280280

281281
$this->assertFalse($kernel->isClassInActiveBundle('Not\In\Active\Bundle'));
282282
}
283283

284-
public function testIsClassInActiveBundleFalseNoNamespace()
284+
public function testLegacyIsClassInActiveBundleFalseNoNamespace()
285285
{
286286
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
287287

288288
$this->assertFalse($kernel->isClassInActiveBundle('NotNamespacedClass'));
289289
}
290290

291-
public function testIsClassInActiveBundleTrue()
291+
public function testLegacyIsClassInActiveBundleTrue()
292292
{
293293
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
294294

@@ -297,6 +297,8 @@ public function testIsClassInActiveBundleTrue()
297297

298298
protected function getKernelMockForIsClassInActiveBundleTest()
299299
{
300+
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
301+
300302
$bundle = new FooBarBundle();
301303

302304
$kernel = $this->getKernel(array('getBundles'));

0 commit comments

Comments
 (0)