Sylius/tests/Functional/Doctrine/Mock/DriverMock.php
Rafikooo bd364048bb
Fix DBAL 4.x mock compatibility in tests
- Update DriverMock::connect() signature for DBAL 4.x
- Add return types to DriverConnectionMock methods
- Add return types to StatementMock methods
- Add return types to DatabasePlatformMock methods

(cherry picked from commit 1c9cd7c243)
2026-06-17 14:33:44 +02:00

44 lines
1.1 KiB
PHP

<?php
/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Tests\Functional\Doctrine\Mock;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\API\ExceptionConverter;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
class DriverMock implements Driver
{
public function connect(array $params): DriverConnection
{
return new DriverConnectionMock();
}
public function getDatabasePlatform(): AbstractPlatform
{
throw new \BadMethodCallException('Not implemented');
}
public function getSchemaManager(Connection $conn, ?AbstractPlatform $platform = null): AbstractSchemaManager
{
throw new \BadMethodCallException('Not implemented');
}
public function getExceptionConverter(): ExceptionConverter
{
throw new \BadMethodCallException('Not implemented');
}
}