Merge branch '4.3' into 4.4
* 4.3: [FrameworkBundle] [SecurityBundle] Rename internal WebTestCase to avoid confusion ignore not existing translator service [FrameworkBundle] [SecurityBundle] Rename internal WebTestCase to avoid confusion revert private properties handling [HttpFoundation] Fix URLs [VarDumper] finish PHP 7.4 support and add tests [VarDumper] Use \ReflectionReference for determining if a key is a reference (php >= 7.4) Ignore missing translation dependency in FrameworkBundle [Security/Http] Don't mark AbstractAuthenticationListener as internal Remove dead tests fixtures Remove more dead tests fixtures [Mime] Add missing changelog entry for BC-break [Messenger] fix transport_name option not passing validation Remove dead tests fixtures [Debug][ExceptionHandler] Add tests for custom handlers
This commit is contained in:
commit
a688787449
@ -1243,7 +1243,7 @@ class FrameworkExtension extends Extension
|
||||
|
||||
if (interface_exists(TranslatorInterface::class) && class_exists(LegacyTranslatorProxy::class)) {
|
||||
$calls = $validatorBuilder->getMethodCalls();
|
||||
$calls[1] = ['setTranslator', [new Definition(LegacyTranslatorProxy::class, [new Reference('translator')])]];
|
||||
$calls[1] = ['setTranslator', [new Definition(LegacyTranslatorProxy::class, [new Reference('translator', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)])]];
|
||||
$validatorBuilder->setMethodCalls($calls);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
<argument type="service" id="validator.validator_factory" />
|
||||
</call>
|
||||
<call method="setTranslator">
|
||||
<argument type="service" id="translator" />
|
||||
<argument type="service" id="translator" on-invalid="ignore" />
|
||||
</call>
|
||||
<call method="setTranslationDomain">
|
||||
<argument>%validator.translation_domain%</argument>
|
||||
|
@ -913,9 +913,9 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertEquals([new Reference('validator.validator_factory')], $calls[0][1]);
|
||||
$this->assertSame('setTranslator', $calls[1][0]);
|
||||
if (interface_exists(TranslatorInterface::class) && class_exists(LegacyTranslatorProxy::class)) {
|
||||
$this->assertEquals([new Definition(LegacyTranslatorProxy::class, [new Reference('translator')])], $calls[1][1]);
|
||||
$this->assertEquals([new Definition(LegacyTranslatorProxy::class, [new Reference('translator', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)])], $calls[1][1]);
|
||||
} else {
|
||||
$this->assertEquals([new Reference('translator')], $calls[1][1]);
|
||||
$this->assertEquals([new Reference('translator', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)], $calls[1][1]);
|
||||
}
|
||||
$this->assertSame('setTranslationDomain', $calls[2][0]);
|
||||
$this->assertSame(['%validator.translation_domain%'], $calls[2][1]);
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TestBundle\Fabpot\FooBundle\Controller;
|
||||
|
||||
/**
|
||||
* DefaultController.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class DefaultController
|
||||
{
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TestBundle\Fabpot\FooBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
/**
|
||||
* Bundle.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class FabpotFooBundle extends Bundle
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return 'SensioFooBundle';
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class WebTestCase extends BaseWebTestCase
|
||||
abstract class AbstractWebTestCase extends BaseWebTestCase
|
||||
{
|
||||
public static function assertRedirect($response, $location)
|
||||
{
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
class AnnotatedControllerTest extends WebTestCase
|
||||
class AnnotatedControllerTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getRoutes
|
||||
|
@ -19,7 +19,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
|
||||
use Symfony\Component\Templating\EngineInterface as ComponentEngineInterface;
|
||||
|
||||
class AutowiringTypesTest extends WebTestCase
|
||||
class AutowiringTypesTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testAnnotationReaderAutowiring()
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class CachePoolClearCommandTest extends WebTestCase
|
||||
class CachePoolClearCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ use Symfony\Component\Cache\Adapter\RedisAdapter;
|
||||
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
|
||||
use Symfony\Component\Cache\Exception\InvalidArgumentException;
|
||||
|
||||
class CachePoolsTest extends WebTestCase
|
||||
class CachePoolsTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testCachePools()
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class ConfigDebugCommandTest extends WebTestCase
|
||||
class ConfigDebugCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
private $application;
|
||||
|
||||
|
@ -19,7 +19,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class ConfigDumpReferenceCommandTest extends WebTestCase
|
||||
class ConfigDumpReferenceCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
private $application;
|
||||
|
||||
|
@ -18,7 +18,7 @@ use Symfony\Component\Console\Tester\ApplicationTester;
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class ContainerDebugCommandTest extends WebTestCase
|
||||
class ContainerDebugCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testDumpContainerIfNotExists()
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
/**
|
||||
* Checks that the container compiles correctly when all the bundle features are enabled.
|
||||
*/
|
||||
class ContainerDumpTest extends WebTestCase
|
||||
class ContainerDumpTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testContainerCompilationInDebug()
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ use Symfony\Component\Console\Tester\ApplicationTester;
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class DebugAutowiringCommandTest extends WebTestCase
|
||||
class DebugAutowiringCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testBasicFunctionality()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
class FragmentTest extends WebTestCase
|
||||
class FragmentTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConfigs
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
class ProfilerTest extends WebTestCase
|
||||
class ProfilerTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConfigs
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
use Symfony\Component\PropertyInfo\Type;
|
||||
|
||||
class PropertyInfoTest extends WebTestCase
|
||||
class PropertyInfoTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testPhpDocPriority()
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class RouterDebugCommandTest extends WebTestCase
|
||||
class RouterDebugCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
private $application;
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
/**
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class SerializerTest extends WebTestCase
|
||||
class SerializerTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testDeserializeArrayOfObject()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
class SessionTest extends WebTestCase
|
||||
class SessionTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* Tests session attributes persist.
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
class SubRequestsTest extends WebTestCase
|
||||
class SubRequestsTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testStateAfterSubRequest()
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestServic
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestServiceContainer\UnusedPrivateService;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
class TestServiceContainerTest extends WebTestCase
|
||||
class TestServiceContainerTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testThatPrivateServicesAreUnavailableIfTestConfigIsDisabled()
|
||||
{
|
||||
|
@ -12,10 +12,10 @@
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Functional\AbstractWebTestCase;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class KernelBrowserTest extends WebTestCase
|
||||
class KernelBrowserTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testRebootKernelBetweenRequests()
|
||||
{
|
||||
|
@ -148,10 +148,3 @@ class AddSecurityVotersPassTest extends TestCase
|
||||
$compilerPass->process($container);
|
||||
}
|
||||
}
|
||||
|
||||
class VoterWithoutInterface
|
||||
{
|
||||
public function vote()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class WebTestCase extends BaseWebTestCase
|
||||
abstract class AbstractWebTestCase extends BaseWebTestCase
|
||||
{
|
||||
public static function assertRedirect($response, $location)
|
||||
{
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class AuthenticationCommencingTest extends WebTestCase
|
||||
class AuthenticationCommencingTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testAuthenticationIsCommencingIfAccessDeniedExceptionIsWrapped()
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
|
||||
use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
|
||||
|
||||
class AutowiringTypesTest extends WebTestCase
|
||||
class AutowiringTypesTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testAccessDecisionManagerAutowiring()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class CsrfFormLoginTest extends WebTestCase
|
||||
class CsrfFormLoginTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConfigs
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security\EntryPointStub;
|
||||
|
||||
class FirewallEntryPointTest extends WebTestCase
|
||||
class FirewallEntryPointTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testItUsesTheConfiguredEntryPointWhenUsingUnknownCredentials()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class FormLoginTest extends WebTestCase
|
||||
class FormLoginTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConfigs
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
|
||||
class JsonLoginLdapTest extends WebTestCase
|
||||
class JsonLoginLdapTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testKernelBoot()
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
/**
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class JsonLoginTest extends WebTestCase
|
||||
class JsonLoginTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testDefaultJsonLoginSuccess()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class LocalizedRoutesAsPathTest extends WebTestCase
|
||||
class LocalizedRoutesAsPathTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getLocales
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class LogoutTest extends WebTestCase
|
||||
class LogoutTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testSessionLessRememberMeLogout()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class MissingUserProviderTest extends WebTestCase
|
||||
class MissingUserProviderTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
|
||||
class SecurityRoutingIntegrationTest extends WebTestCase
|
||||
class SecurityRoutingIntegrationTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConfigs
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Security\Core\User\User;
|
||||
|
||||
class SecurityTest extends WebTestCase
|
||||
class SecurityTest extends AbstractWebTestCase
|
||||
{
|
||||
public function testServiceIsFunctional()
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Security\Http\Firewall\SwitchUserListener;
|
||||
|
||||
class SwitchUserTest extends WebTestCase
|
||||
class SwitchUserTest extends AbstractWebTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getTestParameters
|
||||
|
@ -27,7 +27,7 @@ use Symfony\Component\Security\Core\Encoder\SodiumPasswordEncoder;
|
||||
*
|
||||
* @author Sarah Khalil <mkhalil.sarah@gmail.com>
|
||||
*/
|
||||
class UserPasswordEncoderCommandTest extends WebTestCase
|
||||
class UserPasswordEncoderCommandTest extends AbstractWebTestCase
|
||||
{
|
||||
/** @var CommandTester */
|
||||
private $passwordEncoderCommandTester;
|
||||
|
@ -94,11 +94,3 @@ class SecurityUserValueResolverTest extends TestCase
|
||||
$this->assertSame([null], $argumentResolver->getArguments(Request::create('/'), function (UserInterface $user = null) {}));
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DummyUser implements UserInterface
|
||||
{
|
||||
}
|
||||
|
||||
abstract class DummySubUser extends DummyUser
|
||||
{
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ content="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgndGVzdDMnKTwvc2NyaXB0Pg"
|
||||
|
||||
ob_start();
|
||||
$handler->sendPhpResponse(new MethodNotAllowedHttpException(['POST']));
|
||||
$response = ob_get_clean();
|
||||
ob_get_clean();
|
||||
|
||||
$expectedHeaders = [
|
||||
['HTTP/1.0 405', true, null],
|
||||
@ -114,35 +114,65 @@ content="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgndGVzdDMnKTwvc2NyaXB0Pg"
|
||||
|
||||
public function testHandle()
|
||||
{
|
||||
$exception = new \Exception('foo');
|
||||
$handler = new ExceptionHandler(true);
|
||||
ob_start();
|
||||
|
||||
$handler = $this->getMockBuilder('Symfony\Component\Debug\ExceptionHandler')->setMethods(['sendPhpResponse'])->getMock();
|
||||
$handler
|
||||
->expects($this->exactly(2))
|
||||
->method('sendPhpResponse');
|
||||
$handler->handle(new \Exception('foo'));
|
||||
|
||||
$handler->handle($exception);
|
||||
$this->assertThatTheExceptionWasOutput(ob_get_clean(), \Exception::class, 'Exception', 'foo');
|
||||
}
|
||||
|
||||
$handler->setHandler(function ($e) use ($exception) {
|
||||
$this->assertSame($exception, $e);
|
||||
public function testHandleWithACustomHandlerThatOutputsSomething()
|
||||
{
|
||||
$handler = new ExceptionHandler(true);
|
||||
ob_start();
|
||||
$handler->setHandler(function () {
|
||||
echo 'ccc';
|
||||
});
|
||||
|
||||
$handler->handle($exception);
|
||||
$handler->handle(new \Exception());
|
||||
ob_end_flush(); // Necessary because of this PHP bug : https://bugs.php.net/bug.php?id=76563
|
||||
$this->assertSame('ccc', ob_get_clean());
|
||||
}
|
||||
|
||||
public function testHandleWithACustomHandlerThatOutputsNothing()
|
||||
{
|
||||
$handler = new ExceptionHandler(true);
|
||||
$handler->setHandler(function () {});
|
||||
|
||||
$handler->handle(new \Exception('ccc'));
|
||||
|
||||
$this->assertThatTheExceptionWasOutput(ob_get_clean(), \Exception::class, 'Exception', 'ccc');
|
||||
}
|
||||
|
||||
public function testHandleWithACustomHandlerThatFails()
|
||||
{
|
||||
$handler = new ExceptionHandler(true);
|
||||
$handler->setHandler(function () {
|
||||
throw new \RuntimeException();
|
||||
});
|
||||
|
||||
$handler->handle(new \Exception('ccc'));
|
||||
|
||||
$this->assertThatTheExceptionWasOutput(ob_get_clean(), \Exception::class, 'Exception', 'ccc');
|
||||
}
|
||||
|
||||
public function testHandleOutOfMemoryException()
|
||||
{
|
||||
$exception = new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__);
|
||||
|
||||
$handler = $this->getMockBuilder('Symfony\Component\Debug\ExceptionHandler')->setMethods(['sendPhpResponse'])->getMock();
|
||||
$handler
|
||||
->expects($this->once())
|
||||
->method('sendPhpResponse');
|
||||
|
||||
$handler->setHandler(function ($e) {
|
||||
$handler = new ExceptionHandler(true);
|
||||
ob_start();
|
||||
$handler->setHandler(function () {
|
||||
$this->fail('OutOfMemoryException should bypass the handler');
|
||||
});
|
||||
|
||||
$handler->handle($exception);
|
||||
$handler->handle(new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__));
|
||||
|
||||
$this->assertThatTheExceptionWasOutput(ob_get_clean(), OutOfMemoryException::class, 'OutOfMemoryException', 'foo');
|
||||
}
|
||||
|
||||
private function assertThatTheExceptionWasOutput($content, $expectedClass, $expectedTitle, $expectedMessage)
|
||||
{
|
||||
$this->assertContains(sprintf('<span class="exception_title"><abbr title="%s">%s</abbr></span>', $expectedClass, $expectedTitle), $content);
|
||||
$this->assertContains(sprintf('<p class="break-long-words trace-message">%s</p>', $expectedMessage), $content);
|
||||
}
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Debug\Tests;
|
||||
|
||||
use Symfony\Component\Debug\ExceptionHandler;
|
||||
|
||||
class MockExceptionHandler extends ExceptionHandler
|
||||
{
|
||||
public $e;
|
||||
|
||||
public function handle(\Exception $e)
|
||||
{
|
||||
$this->e = $e;
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\Component1\Dir3;
|
||||
|
||||
class Service3
|
||||
{
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub;
|
||||
|
||||
abstract class NoLoadAbstractBar
|
||||
{
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub;
|
||||
|
||||
interface NoLoadBarInterface
|
||||
{
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub;
|
||||
|
||||
trait NoLoadBarTrait
|
||||
{
|
||||
}
|
@ -118,20 +118,6 @@ class CannotBeAutowired
|
||||
}
|
||||
}
|
||||
|
||||
class CannotBeAutowiredForwardOrder
|
||||
{
|
||||
public function __construct(CollisionA $a, CollisionInterface $b, CollisionB $c)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class CannotBeAutowiredReverseOrder
|
||||
{
|
||||
public function __construct(CollisionA $a, CollisionB $c, CollisionInterface $b)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class Lille
|
||||
{
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
use Symfony\Component\Form\Command\DebugCommand;
|
||||
use Symfony\Component\Form\DependencyInjection\FormPass;
|
||||
@ -418,14 +417,6 @@ class FormPassTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
class FormPassTest_Type1 extends AbstractType
|
||||
{
|
||||
}
|
||||
|
||||
class FormPassTest_Type2 extends AbstractType
|
||||
{
|
||||
}
|
||||
|
||||
class Type1TypeExtension extends AbstractTypeExtension
|
||||
{
|
||||
public static function getExtendedTypes(): iterable
|
||||
|
@ -17,7 +17,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
||||
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
||||
*
|
||||
* @see https://packagist.org/packages/mongodb/mongodb
|
||||
* @see http://php.net/manual/en/set.mongodb.php
|
||||
* @see https://php.net/mongodb
|
||||
*/
|
||||
class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ class NativeFileSessionHandler extends \SessionHandler
|
||||
* Default null will leave setting as defined by PHP.
|
||||
* '/path', 'N;/path', or 'N;octal-mode;/path
|
||||
*
|
||||
* @see http://php.net/session.configuration.php#ini.session.save-path for further details.
|
||||
* @see https://php.net/manual/session.configuration.php#ini.session.save-path for further details.
|
||||
*
|
||||
* @throws \InvalidArgumentException On invalid $savePath
|
||||
* @throws \RuntimeException When failing to create the save directory
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionAbsentBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ExtensionAbsentBundle extends Bundle
|
||||
{
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionLoadedBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Extension\Extension;
|
||||
|
||||
class ExtensionLoadedExtension extends Extension
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionLoadedBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ExtensionLoadedBundle extends Bundle
|
||||
{
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
/**
|
||||
* This command has a required parameter on the constructor and will be ignored by the default Bundle implementation.
|
||||
*
|
||||
* @see Bundle::registerCommands()
|
||||
*/
|
||||
class BarCommand extends Command
|
||||
{
|
||||
public function __construct($example, $name = 'bar')
|
||||
{
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
class FooCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('foo');
|
||||
}
|
||||
}
|
@ -687,14 +687,6 @@ class DummyReceiver implements ReceiverInterface
|
||||
}
|
||||
}
|
||||
|
||||
class InvalidReceiver
|
||||
{
|
||||
}
|
||||
|
||||
class InvalidSender
|
||||
{
|
||||
}
|
||||
|
||||
class UndefinedMessageHandler
|
||||
{
|
||||
public function __invoke(UndefinedMessage $message)
|
||||
|
@ -22,6 +22,8 @@ class AmqpTransportFactory implements TransportFactoryInterface
|
||||
{
|
||||
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
|
||||
{
|
||||
unset($options['transport_name']);
|
||||
|
||||
return new AmqpTransport(Connection::fromDsn($dsn, $options), $serializer);
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ class DoctrineTransportFactory implements TransportFactoryInterface
|
||||
|
||||
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
|
||||
{
|
||||
unset($options['transport_name']);
|
||||
$configuration = Connection::buildConfiguration($dsn, $options);
|
||||
|
||||
try {
|
||||
|
@ -23,6 +23,8 @@ class RedisTransportFactory implements TransportFactoryInterface
|
||||
{
|
||||
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
|
||||
{
|
||||
unset($options['transport_name']);
|
||||
|
||||
return new RedisTransport(Connection::fromDsn($dsn, $options), $serializer);
|
||||
}
|
||||
|
||||
|
12
src/Symfony/Component/Mime/CHANGELOG.md
Normal file
12
src/Symfony/Component/Mime/CHANGELOG.md
Normal file
@ -0,0 +1,12 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.3.3
|
||||
-----
|
||||
|
||||
* [BC BREAK] Renamed method `Headers::getAll()` to `Headers::all()`.
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
||||
* Introduced the component as experimental
|
@ -43,28 +43,6 @@ class PropertyAccessorCollectionTest_Car
|
||||
}
|
||||
}
|
||||
|
||||
class PropertyAccessorCollectionTest_CarOnlyAdder
|
||||
{
|
||||
public function addAxis($axis)
|
||||
{
|
||||
}
|
||||
|
||||
public function getAxes()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class PropertyAccessorCollectionTest_CarOnlyRemover
|
||||
{
|
||||
public function removeAxis($axis)
|
||||
{
|
||||
}
|
||||
|
||||
public function getAxes()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class PropertyAccessorCollectionTest_CarNoAdderAndRemover
|
||||
{
|
||||
public function getAxes()
|
||||
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
|
||||
|
||||
class Php71DummyParent
|
||||
{
|
||||
public $string;
|
||||
|
||||
public function __construct(string $string)
|
||||
{
|
||||
$this->string = $string;
|
||||
}
|
||||
}
|
||||
|
||||
class Php71DummyChild extends Php71DummyParent
|
||||
{
|
||||
public function __construct(string $string)
|
||||
{
|
||||
parent::__construct($string);
|
||||
}
|
||||
}
|
||||
|
||||
class Php71DummyChild2 extends Php71DummyParent
|
||||
{
|
||||
}
|
||||
|
||||
class Php71DummyChild3 extends Php71DummyParent
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('hello');
|
||||
}
|
||||
}
|
@ -48,8 +48,6 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
||||
*
|
||||
* @internal since Symfony 4.3
|
||||
*/
|
||||
abstract class AbstractAuthenticationListener implements ListenerInterface
|
||||
{
|
||||
|
@ -89,11 +89,3 @@ class UserValueResolverTest extends TestCase
|
||||
$this->assertSame([null], $argumentResolver->getArguments(Request::create('/'), function (UserInterface $user = null) {}));
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DummyUser implements UserInterface
|
||||
{
|
||||
}
|
||||
|
||||
abstract class DummySubUser extends DummyUser
|
||||
{
|
||||
}
|
||||
|
@ -687,43 +687,6 @@ class GetConstructorArgsWithDefaultValueDummy
|
||||
}
|
||||
}
|
||||
|
||||
class GetCamelizedDummy
|
||||
{
|
||||
private $kevinDunglas;
|
||||
private $fooBar;
|
||||
private $bar_foo;
|
||||
|
||||
public function __construct($kevinDunglas = null)
|
||||
{
|
||||
$this->kevinDunglas = $kevinDunglas;
|
||||
}
|
||||
|
||||
public function getKevinDunglas()
|
||||
{
|
||||
return $this->kevinDunglas;
|
||||
}
|
||||
|
||||
public function setFooBar($fooBar)
|
||||
{
|
||||
$this->fooBar = $fooBar;
|
||||
}
|
||||
|
||||
public function getFooBar()
|
||||
{
|
||||
return $this->fooBar;
|
||||
}
|
||||
|
||||
public function setBar_foo($bar_foo)
|
||||
{
|
||||
$this->bar_foo = $bar_foo;
|
||||
}
|
||||
|
||||
public function getBar_foo()
|
||||
{
|
||||
return $this->bar_foo;
|
||||
}
|
||||
}
|
||||
|
||||
class ObjectConstructorArgsWithPrivateMutatorDummy
|
||||
{
|
||||
private $foo;
|
||||
|
@ -461,18 +461,6 @@ class PropertyConstructorDummy
|
||||
}
|
||||
}
|
||||
|
||||
class PropertyCamelizedDummy
|
||||
{
|
||||
private $kevinDunglas;
|
||||
public $fooBar;
|
||||
public $bar_foo;
|
||||
|
||||
public function __construct($kevinDunglas = null)
|
||||
{
|
||||
$this->kevinDunglas = $kevinDunglas;
|
||||
}
|
||||
}
|
||||
|
||||
class StaticPropertyDummy
|
||||
{
|
||||
private static $property = 'value';
|
||||
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
class ConstraintAValidator extends ConstraintValidator
|
||||
{
|
||||
public static $passedContext;
|
||||
|
||||
public function initialize(ExecutionContextInterface $context)
|
||||
{
|
||||
parent::initialize($context);
|
||||
|
||||
self::$passedContext = $context;
|
||||
}
|
||||
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
if ('VALID' != $value) {
|
||||
$this->context->addViolation('message', ['param' => 'value']);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
|
||||
class FakeClassMetadata extends ClassMetadata
|
||||
{
|
||||
public function addCustomPropertyMetadata($propertyName, $metadata)
|
||||
{
|
||||
if (!isset($this->members[$propertyName])) {
|
||||
$this->members[$propertyName] = [];
|
||||
}
|
||||
|
||||
$this->members[$propertyName][] = $metadata;
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Validator\Tests\Fixtures;
|
||||
|
||||
class InvalidConstraintValidator
|
||||
{
|
||||
}
|
@ -62,8 +62,8 @@ class Caster
|
||||
foreach ($a as $k => $v) {
|
||||
if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) {
|
||||
if (!isset($publicProperties[$class])) {
|
||||
foreach (get_class_vars($class) as $prop => $v) {
|
||||
$publicProperties[$class][$prop] = true;
|
||||
foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) {
|
||||
$publicProperties[$class][$prop->name] = true;
|
||||
}
|
||||
}
|
||||
if (!isset($publicProperties[$class][$k])) {
|
||||
|
@ -80,8 +80,15 @@ class VarCloner extends AbstractCloner
|
||||
}
|
||||
foreach ($vals as $k => $v) {
|
||||
// $v is the original value or a stub object in case of hard references
|
||||
|
||||
if (\PHP_VERSION_ID >= 70400) {
|
||||
$zvalIsRef = null !== \ReflectionReference::fromArrayElement($vals, $k);
|
||||
} else {
|
||||
$refs[$k] = $cookie;
|
||||
if ($zvalIsRef = $vals[$k] === $cookie) {
|
||||
$zvalIsRef = $vals[$k] === $cookie;
|
||||
}
|
||||
|
||||
if ($zvalIsRef) {
|
||||
$vals[$k] = &$stub; // Break hard references to make $queue completely
|
||||
unset($stub); // independent from the original structure
|
||||
if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) {
|
||||
|
@ -13,6 +13,7 @@ namespace Symfony\Component\VarDumper\Tests\Cloner;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Tests\Fixtures\Php74;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
@ -433,6 +434,73 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
||||
[useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
)
|
||||
|
||||
EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.4
|
||||
*/
|
||||
public function testPhp74()
|
||||
{
|
||||
$data = new Php74();
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$clone = $cloner->cloneVar($data);
|
||||
|
||||
$expected = <<<'EOTXT'
|
||||
Symfony\Component\VarDumper\Cloner\Data Object
|
||||
(
|
||||
[data:Symfony\Component\VarDumper\Cloner\Data:private] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => 4
|
||||
[class] => Symfony\Component\VarDumper\Tests\Fixtures\Php74
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
[handle] => %i
|
||||
[refCount] => 0
|
||||
[position] => 1
|
||||
[attr] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[p1] => 123
|
||||
[p2] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
[handle] => %i
|
||||
[refCount] => 0
|
||||
[position] => 0
|
||||
[attr] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[position:Symfony\Component\VarDumper\Cloner\Data:private] => 0
|
||||
[key:Symfony\Component\VarDumper\Cloner\Data:private] => 0
|
||||
[maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20
|
||||
[maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
[useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
)
|
||||
|
||||
EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
14
src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php
Normal file
14
src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\VarDumper\Tests\Fixtures;
|
||||
|
||||
class Php74
|
||||
{
|
||||
public $p1 = 123;
|
||||
public \stdClass $p2;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->p2 = new \stdClass();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user