Skip to content

Commit ab4439b

Browse files
committed
Use ::class keyword when possible
1 parent 8ff22ca commit ab4439b

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

Tests/LockTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public function testNoAutoReleaseWhenNotConfigured()
278278

279279
public function testReleaseThrowsExceptionWhenDeletionFail()
280280
{
281-
$this->expectException('Symfony\Component\Lock\Exception\LockReleasingException');
281+
$this->expectException(\Symfony\Component\Lock\Exception\LockReleasingException::class);
282282
$key = new Key(uniqid(__METHOD__, true));
283283
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
284284
$lock = new Lock($key, $store, 10);
@@ -299,7 +299,7 @@ public function testReleaseThrowsExceptionWhenDeletionFail()
299299

300300
public function testReleaseThrowsExceptionIfNotWellDeleted()
301301
{
302-
$this->expectException('Symfony\Component\Lock\Exception\LockReleasingException');
302+
$this->expectException(\Symfony\Component\Lock\Exception\LockReleasingException::class);
303303
$key = new Key(uniqid(__METHOD__, true));
304304
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
305305
$lock = new Lock($key, $store, 10);
@@ -320,7 +320,7 @@ public function testReleaseThrowsExceptionIfNotWellDeleted()
320320

321321
public function testReleaseThrowsAndLog()
322322
{
323-
$this->expectException('Symfony\Component\Lock\Exception\LockReleasingException');
323+
$this->expectException(\Symfony\Component\Lock\Exception\LockReleasingException::class);
324324
$key = new Key(uniqid(__METHOD__, true));
325325
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
326326
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

Tests/Store/CombinedStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function setUp(): void
7171

7272
public function testSaveThrowsExceptionOnFailure()
7373
{
74-
$this->expectException('Symfony\Component\Lock\Exception\LockConflictedException');
74+
$this->expectException(LockConflictedException::class);
7575
$key = new Key(uniqid(__METHOD__, true));
7676

7777
$this->store1
@@ -166,7 +166,7 @@ public function testSaveAbortWhenStrategyCantBeMet()
166166

167167
public function testputOffExpirationThrowsExceptionOnFailure()
168168
{
169-
$this->expectException('Symfony\Component\Lock\Exception\LockConflictedException');
169+
$this->expectException(LockConflictedException::class);
170170
$key = new Key(uniqid(__METHOD__, true));
171171
$ttl = random_int(1, 10);
172172

Tests/Store/FlockStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function getStore(): PersistingStoreInterface
3232

3333
public function testConstructWhenRepositoryDoesNotExist()
3434
{
35-
$this->expectException('Symfony\Component\Lock\Exception\InvalidArgumentException');
35+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidArgumentException::class);
3636
$this->expectExceptionMessage('The directory "/a/b/c/d/e" is not writable.');
3737
if (!getenv('USER') || 'root' === getenv('USER')) {
3838
$this->markTestSkipped('This test will fail if run under superuser');
@@ -43,7 +43,7 @@ public function testConstructWhenRepositoryDoesNotExist()
4343

4444
public function testConstructWhenRepositoryIsNotWriteable()
4545
{
46-
$this->expectException('Symfony\Component\Lock\Exception\InvalidArgumentException');
46+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidArgumentException::class);
4747
$this->expectExceptionMessage('The directory "/" is not writable.');
4848
if (!getenv('USER') || 'root' === getenv('USER')) {
4949
$this->markTestSkipped('This test will fail if run under superuser');

Tests/Store/MemcachedStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testAbortAfterExpiration()
6363

6464
public function testInvalidTtl()
6565
{
66-
$this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException');
66+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidTtlException::class);
6767
$store = $this->getStore();
6868
$store->putOffExpiration(new Key('toto'), 0.1);
6969
}

Tests/Store/PdoStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ public function testAbortAfterExpiration()
6262

6363
public function testInvalidTtl()
6464
{
65-
$this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException');
65+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidTtlException::class);
6666
$store = $this->getStore();
6767
$store->putOffExpiration(new Key('toto'), 0.1);
6868
}
6969

7070
public function testInvalidTtlConstruct()
7171
{
72-
$this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException');
72+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidTtlException::class);
7373

7474
return new PdoStore('sqlite:'.self::$dbFile, [], 0.1, 0.1);
7575
}

Tests/Store/RedisArrayStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RedisArrayStoreTest extends AbstractRedisStoreTest
2121
{
2222
public static function setUpBeforeClass(): void
2323
{
24-
if (!class_exists('RedisArray')) {
24+
if (!class_exists(\RedisArray::class)) {
2525
self::markTestSkipped('The RedisArray class is required.');
2626
}
2727
try {

Tests/Store/RedisClusterStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RedisClusterStoreTest extends AbstractRedisStoreTest
2121
{
2222
public static function setUpBeforeClass(): void
2323
{
24-
if (!class_exists('RedisCluster')) {
24+
if (!class_exists(\RedisCluster::class)) {
2525
self::markTestSkipped('The RedisCluster class is required.');
2626
}
2727
if (!getenv('REDIS_CLUSTER_HOSTS')) {

Tests/Store/RedisStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function getRedisConnection()
4040

4141
public function testInvalidTtl()
4242
{
43-
$this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException');
43+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidTtlException::class);
4444
new RedisStore($this->getRedisConnection(), -1);
4545
}
4646
}

0 commit comments

Comments
 (0)