Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method name in exception #10989

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/Doctrine/Tests/Mocks/ConnectionMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,18 @@ public function delete($table, array $criteria, array $types = [])
*/
public function fetchColumn($statement, array $params = [], $colunm = 0, array $types = [])
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

public function query(?string $sql = null): Result
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

/**
Expand Down
17 changes: 14 additions & 3 deletions tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Platforms\AbstractPlatform;

use function sprintf;

/**
* Mock class for DatabasePlatform.
*/
class DatabasePlatformMock extends AbstractPlatform
{
public function prefersIdentityColumns(): bool
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

public function supportsIdentityColumns(): bool
Expand All @@ -25,7 +30,10 @@ public function supportsIdentityColumns(): bool

public function prefersSequences(): bool
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

public function supportsSequences(): bool
Expand Down Expand Up @@ -94,7 +102,10 @@ public function getClobTypeDeclarationSQL(array $field)

public function getName(): string
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

/**
Expand Down
7 changes: 6 additions & 1 deletion tests/Doctrine/Tests/Mocks/DriverMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Exception;

use function sprintf;

/**
* Mock class for Driver.
*/
Expand Down Expand Up @@ -70,7 +72,10 @@ public function setSchemaManager(AbstractSchemaManager $sm): void
*/
public function getName()
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

/**
Expand Down
6 changes: 5 additions & 1 deletion tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Doctrine\Tests\OrmFunctionalTestCase;

use function debug_backtrace;
use function sprintf;

use const PHP_INT_MAX;

Expand Down Expand Up @@ -347,7 +348,10 @@ public function query($sql = null): Result
/** {@inheritDoc} */
public function executeUpdate($query, array $params = [], array $types = []): int
{
throw new BadMethodCallException('Call to deprecated method.');
throw new BadMethodCallException(sprintf(
'Call to deprecated method %s().',
__METHOD__
));
}

/** {@inheritDoc} */
Expand Down