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

Minor CS improvement - use ::class for TestCase::expectException input #4346

Merged
merged 1 commit into from
Oct 15, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\DbalTestCase;
use Doctrine\Tests\Types\CommentedType;
use InvalidArgumentException;

use function get_class;
use function implode;
Expand Down Expand Up @@ -84,7 +85,7 @@ public static function getReturnsForeignKeyReferentialActionSQL(): iterable

public function testGetInvalidForeignKeyReferentialActionSQL(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->platform->getForeignKeyReferentialActionSQL('unknown');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Schema\Index;
use UnexpectedValueException;

class SQLAnywhere16PlatformTest extends SQLAnywhere12PlatformTest
{
Expand Down Expand Up @@ -64,7 +65,7 @@ public function testGeneratesCreateIndexWithAdvancedPlatformOptionsSQL(): void

public function testThrowsExceptionOnInvalidWithNullsNotDistinctIndexOptions(): void
{
$this->expectException('UnexpectedValueException');
$this->expectException(UnexpectedValueException::class);

$this->platform->getCreateIndexSQL(
new Index(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Doctrine\DBAL\Sharding\PoolingShardConnection;
use Doctrine\DBAL\Sharding\ShardChoser\MultiTenantShardChoser;
use Doctrine\DBAL\Sharding\ShardingException;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use stdClass;

Expand Down Expand Up @@ -50,7 +51,7 @@ public function testConnect(): void

public function testNoGlobalServerException(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Connection Parameters require 'global' and 'shards' configurations.");

DriverManager::getConnection([
Expand All @@ -66,7 +67,7 @@ public function testNoGlobalServerException(): void

public function testNoShardsServersException(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Connection Parameters require 'global' and 'shards' configurations.");

DriverManager::getConnection([
Expand All @@ -79,7 +80,7 @@ public function testNoShardsServersException(): void

public function testNoShardsChoserException(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Missing Shard Choser configuration 'shardChoser'");

DriverManager::getConnection([
Expand All @@ -95,7 +96,7 @@ public function testNoShardsChoserException(): void

public function testShardChoserWrongInstance(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
"The 'shardChoser' configuration is not a valid instance of Doctrine\DBAL\Sharding\ShardChoser\ShardChoser"
);
Expand All @@ -114,7 +115,7 @@ public function testShardChoserWrongInstance(): void

public function testShardNonNumericId(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Shard Id has to be a non-negative number.');

DriverManager::getConnection([
Expand All @@ -130,7 +131,7 @@ public function testShardNonNumericId(): void

public function testShardMissingId(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Missing 'id' for one configured shard. Please specify a unique shard-id.");

DriverManager::getConnection([
Expand All @@ -146,7 +147,7 @@ public function testShardMissingId(): void

public function testDuplicateShardId(): void
{
$this->expectException('InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Shard 1 is duplicated in the configuration.');

DriverManager::getConnection([
Expand Down