Skip to content

Commit 8f585d0

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Use ::class keyword when possible
2 parents 663dff3 + 27968e3 commit 8f585d0

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

Tests/LockTest.php

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

299299
public function testReleaseThrowsExceptionWhenDeletionFail()
300300
{
301-
$this->expectException('Symfony\Component\Lock\Exception\LockReleasingException');
301+
$this->expectException(\Symfony\Component\Lock\Exception\LockReleasingException::class);
302302
$key = new Key(uniqid(__METHOD__, true));
303303
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
304304
$lock = new Lock($key, $store, 10);
@@ -319,7 +319,7 @@ public function testReleaseThrowsExceptionWhenDeletionFail()
319319

320320
public function testReleaseThrowsExceptionIfNotWellDeleted()
321321
{
322-
$this->expectException('Symfony\Component\Lock\Exception\LockReleasingException');
322+
$this->expectException(\Symfony\Component\Lock\Exception\LockReleasingException::class);
323323
$key = new Key(uniqid(__METHOD__, true));
324324
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
325325
$lock = new Lock($key, $store, 10);
@@ -340,7 +340,7 @@ public function testReleaseThrowsExceptionIfNotWellDeleted()
340340

341341
public function testReleaseThrowsAndLog()
342342
{
343-
$this->expectException('Symfony\Component\Lock\Exception\LockReleasingException');
343+
$this->expectException(\Symfony\Component\Lock\Exception\LockReleasingException::class);
344344
$key = new Key(uniqid(__METHOD__, true));
345345
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
346346
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

Tests/Store/CombinedStoreTest.php

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

7474
public function testSaveThrowsExceptionOnFailure()
7575
{
76-
$this->expectException('Symfony\Component\Lock\Exception\LockConflictedException');
76+
$this->expectException(LockConflictedException::class);
7777
$key = new Key(uniqid(__METHOD__, true));
7878

7979
$this->store1
@@ -168,7 +168,7 @@ public function testSaveAbortWhenStrategyCantBeMet()
168168

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

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
@@ -45,7 +45,7 @@ protected function getRedisConnection(): object
4545

4646
public function testInvalidTtl()
4747
{
48-
$this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException');
48+
$this->expectException(\Symfony\Component\Lock\Exception\InvalidTtlException::class);
4949
new RedisStore($this->getRedisConnection(), -1);
5050
}
5151
}

0 commit comments

Comments
 (0)