Skip to content

Commit 9510412

Browse files
committed
fix tests.
1 parent 011f4be commit 9510412

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

GpsExtension.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Enqueue\Test;
4+
5+
use Enqueue\Gps\GpsConnectionFactory;
6+
use Enqueue\Gps\GpsContext;
7+
8+
trait GpsExtension
9+
{
10+
private function buildGpsContext(): GpsContext
11+
{
12+
if (false == getenv('GPS_DSN')) {
13+
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
}
15+
16+
$config = getenv('GPS_DSN');
17+
18+
return (new GpsConnectionFactory($config))->createContext();
19+
}
20+
}

0 commit comments

Comments
 (0)