Merge branch '5.0'
* 5.0: [PhpUnitBridge] fix bad test [4.4] CS fixes [3.4] CS fixes Disable phpunit verbosity Queue name is a required parameter [FrameworkBundle] display actual target for error in AssetsInstallCommand Remove patches for Doctrine bugs and deprecations [Mime] fix bad method call on "EmailAddressContains" [DI][EventDispatcher] added contract for implementation
This commit is contained in:
commit
f8616f8eae
5
.github/workflows/tests.yml
vendored
5
.github/workflows/tests.yml
vendored
@ -132,9 +132,8 @@ jobs:
|
|||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: ./phpunit --verbose --group integration
|
run: ./phpunit --group integration
|
||||||
env:
|
env:
|
||||||
SYMFONY_DEPRECATIONS_HELPER: 'max[indirect]=7'
|
|
||||||
REDIS_HOST: localhost
|
REDIS_HOST: localhost
|
||||||
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
|
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
|
||||||
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
|
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
|
||||||
@ -150,6 +149,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
[ -d .phpunit ] && mv .phpunit .phpunit.bak
|
[ -d .phpunit ] && mv .phpunit .phpunit.bak
|
||||||
wget -q https://github.com/symfony/binary-utils/releases/download/v0.1/vulcain_0.1.3_Linux_x86_64.tar.gz -O - | tar xz && mv vulcain /usr/local/bin
|
wget -q https://github.com/symfony/binary-utils/releases/download/v0.1/vulcain_0.1.3_Linux_x86_64.tar.gz -O - | tar xz && mv vulcain /usr/local/bin
|
||||||
docker run --rm -e COMPOSER_ROOT_VERSION -e SYMFONY_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v /usr/local/bin/vulcain:/usr/local/bin/vulcain -w /app php:7.4-alpine ./phpunit --verbose src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
|
docker run --rm -e COMPOSER_ROOT_VERSION -e SYMFONY_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v /usr/local/bin/vulcain:/usr/local/bin/vulcain -w /app php:7.4-alpine ./phpunit src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
|
||||||
sudo rm -rf .phpunit
|
sudo rm -rf .phpunit
|
||||||
[ -d .phpunit.bak ] && mv .phpunit.bak .phpunit
|
[ -d .phpunit.bak ] && mv .phpunit.bak .phpunit
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
"doctrine/cache": "~1.6",
|
"doctrine/cache": "~1.6",
|
||||||
"doctrine/collections": "~1.0",
|
"doctrine/collections": "~1.0",
|
||||||
"doctrine/data-fixtures": "1.0.*",
|
"doctrine/data-fixtures": "1.0.*",
|
||||||
"doctrine/dbal": "~2.4,<=2.10.2",
|
"doctrine/dbal": "~2.4",
|
||||||
"doctrine/orm": "~2.4,>=2.4.5",
|
"doctrine/orm": "~2.4,>=2.4.5",
|
||||||
"doctrine/reflection": "~1.0",
|
"doctrine/reflection": "~1.0",
|
||||||
"doctrine/doctrine-bundle": "^2.0",
|
"doctrine/doctrine-bundle": "^2.0",
|
||||||
|
10
phpunit
10
phpunit
@ -21,14 +21,4 @@ if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
|
|||||||
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
|
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
|
||||||
}
|
}
|
||||||
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
|
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
|
||||||
|
|
||||||
if (!getenv('SYMFONY_DEPRECATIONS_HELPER')) {
|
|
||||||
foreach ($_SERVER['argv'] as $v) {
|
|
||||||
if (false !== strpos($v, 'Bridge/Doctrine')) {
|
|
||||||
putenv('SYMFONY_DEPRECATIONS_HELPER=max[indirect]=7');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
|
require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
|
||||||
|
@ -25,7 +25,7 @@ class DoctrineTransactionMiddlewareTest extends MiddlewareTestCase
|
|||||||
private $entityManager;
|
private $entityManager;
|
||||||
private $middleware;
|
private $middleware;
|
||||||
|
|
||||||
public function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
$this->connection = $this->createMock(Connection::class);
|
$this->connection = $this->createMock(Connection::class);
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
"doctrine/cache": "~1.6",
|
"doctrine/cache": "~1.6",
|
||||||
"doctrine/collections": "~1.0",
|
"doctrine/collections": "~1.0",
|
||||||
"doctrine/data-fixtures": "1.0.*",
|
"doctrine/data-fixtures": "1.0.*",
|
||||||
"doctrine/dbal": "~2.4,<=2.10.2",
|
"doctrine/dbal": "~2.4",
|
||||||
"doctrine/orm": "^2.6.3",
|
"doctrine/orm": "^2.6.3",
|
||||||
"doctrine/reflection": "~1.0"
|
"doctrine/reflection": "~1.0"
|
||||||
},
|
},
|
||||||
|
@ -22,6 +22,7 @@ class DeprecationTest extends TestCase
|
|||||||
use SetUpTearDownTrait;
|
use SetUpTearDownTrait;
|
||||||
|
|
||||||
private static $vendorDir;
|
private static $vendorDir;
|
||||||
|
private static $prefixDirsPsr4;
|
||||||
|
|
||||||
private static function getVendorDir()
|
private static function getVendorDir()
|
||||||
{
|
{
|
||||||
@ -151,22 +152,6 @@ class DeprecationTest extends TestCase
|
|||||||
|
|
||||||
public function providerGetTypeDetectsSelf()
|
public function providerGetTypeDetectsSelf()
|
||||||
{
|
{
|
||||||
foreach (get_declared_classes() as $class) {
|
|
||||||
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
|
||||||
$r = new \ReflectionClass($class);
|
|
||||||
$v = \dirname(\dirname($r->getFileName()));
|
|
||||||
if (file_exists($v.'/composer/installed.json')) {
|
|
||||||
$loader = require $v.'/autoload.php';
|
|
||||||
$reflection = new \ReflectionClass($loader);
|
|
||||||
$prop = $reflection->getProperty('prefixDirsPsr4');
|
|
||||||
$prop->setAccessible(true);
|
|
||||||
$currentValue = $prop->getValue($loader);
|
|
||||||
$currentValue['Symfony\\Bridge\\PhpUnit\\'] = [realpath(__DIR__.'/../..')];
|
|
||||||
$prop->setValue($loader, $currentValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'not_from_vendors_file' => [Deprecation::TYPE_SELF, '', 'MyClass1', __FILE__],
|
'not_from_vendors_file' => [Deprecation::TYPE_SELF, '', 'MyClass1', __FILE__],
|
||||||
'nonexistent_file' => [Deprecation::TYPE_UNDETERMINED, '', 'MyClass1', 'dummy_vendor_path'],
|
'nonexistent_file' => [Deprecation::TYPE_UNDETERMINED, '', 'MyClass1', 'dummy_vendor_path'],
|
||||||
@ -276,8 +261,32 @@ class DeprecationTest extends TestCase
|
|||||||
rmdir($dir);
|
rmdir($dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function doSetupBeforeClass()
|
||||||
|
{
|
||||||
|
foreach (get_declared_classes() as $class) {
|
||||||
|
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
||||||
|
$r = new \ReflectionClass($class);
|
||||||
|
$v = \dirname(\dirname($r->getFileName()));
|
||||||
|
if (file_exists($v.'/composer/installed.json')) {
|
||||||
|
$loader = require $v.'/autoload.php';
|
||||||
|
$reflection = new \ReflectionClass($loader);
|
||||||
|
$prop = $reflection->getProperty('prefixDirsPsr4');
|
||||||
|
$prop->setAccessible(true);
|
||||||
|
$currentValue = $prop->getValue($loader);
|
||||||
|
self::$prefixDirsPsr4[] = [$prop, $loader, $currentValue];
|
||||||
|
$currentValue['Symfony\\Bridge\\PhpUnit\\'] = [realpath(__DIR__.'/../..')];
|
||||||
|
$prop->setValue($loader, $currentValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static function doTearDownAfterClass()
|
private static function doTearDownAfterClass()
|
||||||
{
|
{
|
||||||
|
foreach (self::$prefixDirsPsr4 as [$prop, $loader, $prefixDirsPsr4]) {
|
||||||
|
$prop->setValue($loader, $prefixDirsPsr4);
|
||||||
|
}
|
||||||
|
|
||||||
self::removeDir(self::getVendorDir().'/myfakevendor');
|
self::removeDir(self::getVendorDir().'/myfakevendor');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ EOT
|
|||||||
$targetArg = $kernel->getProjectDir().'/'.$targetArg;
|
$targetArg = $kernel->getProjectDir().'/'.$targetArg;
|
||||||
|
|
||||||
if (!is_dir($targetArg)) {
|
if (!is_dir($targetArg)) {
|
||||||
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
|
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $targetArg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class ExprBuilderTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* @dataProvider castToArrayValues
|
* @dataProvider castToArrayValues
|
||||||
*/
|
*/
|
||||||
public function testcastToArrayExpression($configValue, $expectedValue)
|
public function testCastToArrayExpression($configValue, $expectedValue)
|
||||||
{
|
{
|
||||||
$test = $this->getTestBuilder()
|
$test = $this->getTestBuilder()
|
||||||
->castToArray()
|
->castToArray()
|
||||||
|
@ -60,7 +60,7 @@ class TerminalTest extends TestCase
|
|||||||
$this->assertSame(60, $terminal->getHeight());
|
$this->assertSame(60, $terminal->getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_zero_values()
|
public function testZeroValues()
|
||||||
{
|
{
|
||||||
putenv('COLUMNS=0');
|
putenv('COLUMNS=0');
|
||||||
putenv('LINES=0');
|
putenv('LINES=0');
|
||||||
|
@ -40,6 +40,9 @@ interface EventSubscriberInterface
|
|||||||
* * ['eventName' => ['methodName', $priority]]
|
* * ['eventName' => ['methodName', $priority]]
|
||||||
* * ['eventName' => [['methodName1', $priority], ['methodName2']]]
|
* * ['eventName' => [['methodName1', $priority], ['methodName2']]]
|
||||||
*
|
*
|
||||||
|
* The code must not depend on runtime state as it will only be called at compile time.
|
||||||
|
* All logic depending on runtime state must be put into the individual methods handling the events.
|
||||||
|
*
|
||||||
* @return array The event names to listen to
|
* @return array The event names to listen to
|
||||||
*/
|
*/
|
||||||
public static function getSubscribedEvents();
|
public static function getSubscribedEvents();
|
||||||
|
@ -48,7 +48,7 @@ class SemaphoreStoreTest extends AbstractStoreTest
|
|||||||
private function getOpenedSemaphores()
|
private function getOpenedSemaphores()
|
||||||
{
|
{
|
||||||
if ('Darwin' === PHP_OS) {
|
if ('Darwin' === PHP_OS) {
|
||||||
$lines = explode(PHP_EOL, trim(`ipcs -s`));
|
$lines = explode(PHP_EOL, trim(shell_exec('ipcs -s')));
|
||||||
if (-1 === $start = array_search('Semaphores:', $lines)) {
|
if (-1 === $start = array_search('Semaphores:', $lines)) {
|
||||||
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(PHP_EOL, $lines));
|
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(PHP_EOL, $lines));
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ class SemaphoreStoreTest extends AbstractStoreTest
|
|||||||
return \count(\array_slice($lines, ++$start));
|
return \count(\array_slice($lines, ++$start));
|
||||||
}
|
}
|
||||||
|
|
||||||
$lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`));
|
$lines = explode(PHP_EOL, trim(shell_exec('LC_ALL=C ipcs -su')));
|
||||||
if ('------ Semaphore Status --------' !== $lines[0]) {
|
if ('------ Semaphore Status --------' !== $lines[0]) {
|
||||||
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(PHP_EOL, $lines));
|
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(PHP_EOL, $lines));
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace Symfony\Component\Mailer\Bridge\Mailchimp\Transport;
|
namespace Symfony\Component\Mailer\Bridge\Mailchimp\Transport;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\Mailer\Envelope;
|
|
||||||
use Symfony\Component\Mailer\Exception\HttpTransportException;
|
use Symfony\Component\Mailer\Exception\HttpTransportException;
|
||||||
use Symfony\Component\Mailer\SentMessage;
|
use Symfony\Component\Mailer\SentMessage;
|
||||||
use Symfony\Component\Mailer\Transport\AbstractHttpTransport;
|
use Symfony\Component\Mailer\Transport\AbstractHttpTransport;
|
||||||
|
@ -412,7 +412,7 @@ class Connection
|
|||||||
// If we get a 404 for the queue, it means we need to set up the exchange & queue.
|
// If we get a 404 for the queue, it means we need to set up the exchange & queue.
|
||||||
$this->setupExchangeAndQueues();
|
$this->setupExchangeAndQueues();
|
||||||
|
|
||||||
return $this->get();
|
return $this->get($queueName);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $e;
|
throw $e;
|
||||||
|
@ -48,7 +48,7 @@ final class EmailAddressContains extends Constraint
|
|||||||
|
|
||||||
$header = $message->getHeaders()->get($this->headerName);
|
$header = $message->getHeaders()->get($this->headerName);
|
||||||
if ($header instanceof MailboxHeader) {
|
if ($header instanceof MailboxHeader) {
|
||||||
return $this->expectedValue === $header->Address()->getAddress();
|
return $this->expectedValue === $header->getAddress()->getAddress();
|
||||||
} elseif ($header instanceof MailboxListHeader) {
|
} elseif ($header instanceof MailboxListHeader) {
|
||||||
foreach ($header->getAddresses() as $address) {
|
foreach ($header->getAddresses() as $address) {
|
||||||
if ($this->expectedValue === $address->getAddress()) {
|
if ($this->expectedValue === $address->getAddress()) {
|
||||||
|
@ -26,7 +26,6 @@ class UsernamePasswordToken extends AbstractToken
|
|||||||
/**
|
/**
|
||||||
* @param string|\Stringable|UserInterface $user The username (like a nickname, email address, etc.) or a UserInterface instance
|
* @param string|\Stringable|UserInterface $user The username (like a nickname, email address, etc.) or a UserInterface instance
|
||||||
* @param mixed $credentials
|
* @param mixed $credentials
|
||||||
* @param string $providerKey
|
|
||||||
* @param string[] $roles
|
* @param string[] $roles
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
|
@ -61,7 +61,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
|||||||
*/
|
*/
|
||||||
public function decide(TokenInterface $token, array $attributes, $object = null/*, bool $allowMultipleAttributes = false*/)
|
public function decide(TokenInterface $token, array $attributes, $object = null/*, bool $allowMultipleAttributes = false*/)
|
||||||
{
|
{
|
||||||
$allowMultipleAttributes = 3 < func_num_args() && func_get_arg(3);
|
$allowMultipleAttributes = 3 < \func_num_args() && func_get_arg(3);
|
||||||
|
|
||||||
// Special case for AccessListener, do not remove the right side of the condition before 6.0
|
// Special case for AccessListener, do not remove the right side of the condition before 6.0
|
||||||
if (\count($attributes) > 1 && !$allowMultipleAttributes) {
|
if (\count($attributes) > 1 && !$allowMultipleAttributes) {
|
||||||
|
Reference in New Issue
Block a user