Merge branch '4.4' into 5.0

* 4.4:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
This commit is contained in:
Christian Flothmann 2020-06-29 16:24:36 +02:00
commit 5a91e51154
2 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Messenger\Tests\Transport\Doctrine;
use Doctrine\DBAL\Driver\PDO\Exception;
use Doctrine\DBAL\Driver\PDOException;
use Doctrine\DBAL\Exception\DeadlockException;
use PHPUnit\Framework\TestCase;
@ -75,7 +76,7 @@ class DoctrineReceiverTest extends TestCase
{
$serializer = $this->createSerializer();
$connection = $this->createMock(Connection::class);
$driverException = new PDOException(new \PDOException('Deadlock', 40001));
$driverException = class_exists(Exception::class) ? Exception::new(new \PDOException('Deadlock', 40001)) : new PDOException(new \PDOException('Deadlock', 40001));
$connection->method('get')->willThrowException(new DeadlockException('Deadlock', $driverException));
$receiver = new DoctrineReceiver($connection, $serializer);
$this->assertSame([], $receiver->get());

View File

@ -81,6 +81,10 @@ abstract class AbstractMimeTypeGuesserTest extends TestCase
public function testGuessWithDuplicatedFileType()
{
if (!$this->getGuesser()->isGuesserSupported()) {
$this->markTestSkipped('Guesser is not supported');
}
$this->assertEquals('application/vnd.openxmlformats-officedocument.wordprocessingml.document', $this->getGuesser()->guessMimeType(__DIR__.'/Fixtures/test.docx'));
}