Skip to content

Commit 7b4f88a

Browse files
author
Mathieu Lemoine
committed
Reduced dependency to voryx/Thruway
1 parent 443e04d commit 7b4f88a

9 files changed

+23
-12
lines changed

GpsExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\Gps\GpsConnectionFactory;
66
use Enqueue\Gps\GpsContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait GpsExtension
910
{
1011
private function buildGpsContext(): GpsContext
1112
{
1213
if (false == getenv('GPS_DSN')) {
13-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1415
}
1516

1617
$config = getenv('GPS_DSN');

RabbitmqAmqpExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Enqueue\AmqpExt\AmqpConnectionFactory;
66
use Enqueue\AmqpExt\AmqpContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait RabbitmqAmqpExtension
910
{
@@ -13,7 +14,7 @@ trait RabbitmqAmqpExtension
1314
private function buildAmqpContext()
1415
{
1516
if (false == $dsn = getenv('AMQP_DSN')) {
16-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
17+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1718
}
1819

1920
return (new AmqpConnectionFactory($dsn))->createContext();

RabbitmqStompExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\Stomp\StompConnectionFactory;
66
use Enqueue\Stomp\StompContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait RabbitmqStompExtension
910
{
1011
private function buildStompContext(): StompContext
1112
{
1213
if (false == $dsn = getenv('RABITMQ_STOMP_DSN')) {
13-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1415
}
1516

1617
return (new StompConnectionFactory($dsn))->createContext();

RedisExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
use Enqueue\Redis\PRedis;
77
use Enqueue\Redis\RedisConnectionFactory;
88
use Enqueue\Redis\RedisContext;
9+
use PHPUnit\Framework\SkippedTestError;
910

1011
trait RedisExtension
1112
{
1213
private function buildPhpRedisContext(): RedisContext
1314
{
1415
if (false == getenv('PHPREDIS_DSN')) {
15-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
16+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1617
}
1718

1819
$config = getenv('PHPREDIS_DSN');
@@ -28,7 +29,7 @@ private function buildPhpRedisContext(): RedisContext
2829
private function buildPRedisContext(): RedisContext
2930
{
3031
if (false == getenv('PREDIS_DSN')) {
31-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
32+
throw new SkippedTestError('Functional tests are not allowed in this environment');
3233
}
3334

3435
$config = getenv('PREDIS_DSN');

RetryTrait.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
namespace Enqueue\Test;
44

5+
use PHPUnit\Framework\IncompleteTestError;
6+
use PHPUnit\Framework\SkippedTestError;
7+
58
trait RetryTrait
69
{
7-
public function runBare()
10+
public function runBare(): void
811
{
912
$e = null;
1013

@@ -22,9 +25,9 @@ public function runBare()
2225
parent::runBare();
2326

2427
return;
25-
} catch (\PHPUnit_Framework_IncompleteTestError $e) {
28+
} catch (IncompleteTestError $e) {
2629
throw $e;
27-
} catch (\PHPUnit_Framework_SkippedTestError $e) {
30+
} catch (SkippedTestError $e) {
2831
throw $e;
2932
} catch (\Throwable $e) {
3033
// last one thrown below

SnsExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\Sns\SnsConnectionFactory;
66
use Enqueue\Sns\SnsContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait SnsExtension
910
{
1011
private function buildSqsContext(): SnsContext
1112
{
1213
if (false == $dsn = getenv('SNS_DSN')) {
13-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1415
}
1516

1617
return (new SnsConnectionFactory($dsn))->createContext();

SnsQsExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\SnsQs\SnsQsConnectionFactory;
66
use Enqueue\SnsQs\SnsQsContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait SnsQsExtension
910
{
1011
private function buildSnsQsContext(): SnsQsContext
1112
{
1213
if (false == $dsn = getenv('SNSQS_DSN')) {
13-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1415
}
1516

1617
return (new SnsQsConnectionFactory($dsn))->createContext();

SqsExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\Sqs\SqsConnectionFactory;
66
use Enqueue\Sqs\SqsContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait SqsExtension
910
{
1011
private function buildSqsContext(): SqsContext
1112
{
1213
if (false == $dsn = getenv('SQS_DSN')) {
13-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1415
}
1516

1617
return (new SqsConnectionFactory($dsn))->createContext();

WampExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\Wamp\WampConnectionFactory;
66
use Enqueue\Wamp\WampContext;
7+
use PHPUnit\Framework\SkippedTestError;
78

89
trait WampExtension
910
{
1011
private function buildWampContext(): WampContext
1112
{
1213
if (false == $dsn = getenv('WAMP_DSN')) {
13-
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
throw new SkippedTestError('Functional tests are not allowed in this environment');
1415
}
1516

1617
return (new WampConnectionFactory($dsn))->createContext();

0 commit comments

Comments
 (0)