66use Doctrine \DBAL \Sharding \PoolingShardConnection ;
77use Doctrine \DBAL \Sharding \ShardChoser \MultiTenantShardChoser ;
88use Doctrine \DBAL \Sharding \ShardingException ;
9+ use InvalidArgumentException ;
910use PHPUnit \Framework \TestCase ;
1011use stdClass ;
1112
@@ -50,7 +51,7 @@ public function testConnect(): void
5051
5152 public function testNoGlobalServerException (): void
5253 {
53- $ this ->expectException (' InvalidArgumentException ' );
54+ $ this ->expectException (InvalidArgumentException::class );
5455 $ this ->expectExceptionMessage ("Connection Parameters require 'global' and 'shards' configurations. " );
5556
5657 DriverManager::getConnection ([
@@ -66,7 +67,7 @@ public function testNoGlobalServerException(): void
6667
6768 public function testNoShardsServersException (): void
6869 {
69- $ this ->expectException (' InvalidArgumentException ' );
70+ $ this ->expectException (InvalidArgumentException::class );
7071 $ this ->expectExceptionMessage ("Connection Parameters require 'global' and 'shards' configurations. " );
7172
7273 DriverManager::getConnection ([
@@ -79,7 +80,7 @@ public function testNoShardsServersException(): void
7980
8081 public function testNoShardsChoserException (): void
8182 {
82- $ this ->expectException (' InvalidArgumentException ' );
83+ $ this ->expectException (InvalidArgumentException::class );
8384 $ this ->expectExceptionMessage ("Missing Shard Choser configuration 'shardChoser' " );
8485
8586 DriverManager::getConnection ([
@@ -95,7 +96,7 @@ public function testNoShardsChoserException(): void
9596
9697 public function testShardChoserWrongInstance (): void
9798 {
98- $ this ->expectException (' InvalidArgumentException ' );
99+ $ this ->expectException (InvalidArgumentException::class );
99100 $ this ->expectExceptionMessage (
100101 "The 'shardChoser' configuration is not a valid instance of Doctrine\DBAL\Sharding\ShardChoser\ShardChoser "
101102 );
@@ -114,7 +115,7 @@ public function testShardChoserWrongInstance(): void
114115
115116 public function testShardNonNumericId (): void
116117 {
117- $ this ->expectException (' InvalidArgumentException ' );
118+ $ this ->expectException (InvalidArgumentException::class );
118119 $ this ->expectExceptionMessage ('Shard Id has to be a non-negative number. ' );
119120
120121 DriverManager::getConnection ([
@@ -130,7 +131,7 @@ public function testShardNonNumericId(): void
130131
131132 public function testShardMissingId (): void
132133 {
133- $ this ->expectException (' InvalidArgumentException ' );
134+ $ this ->expectException (InvalidArgumentException::class );
134135 $ this ->expectExceptionMessage ("Missing 'id' for one configured shard. Please specify a unique shard-id. " );
135136
136137 DriverManager::getConnection ([
@@ -146,7 +147,7 @@ public function testShardMissingId(): void
146147
147148 public function testDuplicateShardId (): void
148149 {
149- $ this ->expectException (' InvalidArgumentException ' );
150+ $ this ->expectException (InvalidArgumentException::class );
150151 $ this ->expectExceptionMessage ('Shard 1 is duplicated in the configuration. ' );
151152
152153 DriverManager::getConnection ([
0 commit comments