| @@ 19-48 (lines=30) @@ | ||
| 16 | * |
|
| 17 | * This test requires local beanstalkd running |
|
| 18 | */ |
|
| 19 | class JobManagerNoPriorityTest extends JobManagerTest |
|
| 20 | { |
|
| 21 | use AutoRetryTrait; |
|
| 22 | public static $connection; |
|
| 23 | ||
| 24 | public static function setUpBeforeClass() |
|
| 25 | { |
|
| 26 | $host = getenv('REDIS_HOST'); |
|
| 27 | $port = getenv('REDIS_PORT') ?: 6379; |
|
| 28 | $jobTimingClass = JobTiming::class; |
|
| 29 | $runClass = Run::class; |
|
| 30 | $redis = new \Redis(); |
|
| 31 | $redis->connect($host, $port); |
|
| 32 | $redis->flushAll(); |
|
| 33 | $phpredis = new PhpRedis($redis); |
|
| 34 | ||
| 35 | self::$jobTimingManager = new JobTimingManager($jobTimingClass, false); |
|
| 36 | self::$runManager = new RunManager($runClass); |
|
| 37 | self::$jobManager = new JobManager( |
|
| 38 | self::$runManager, |
|
| 39 | self::$jobTimingManager, |
|
| 40 | \Dtc\QueueBundle\Redis\Job::class, |
|
| 41 | 'test_cache_key' |
|
| 42 | ); |
|
| 43 | self::$jobManager->setRedis($phpredis); |
|
| 44 | self::$jobManager->setMaxPriority(null); |
|
| 45 | self::$worker = new FibonacciWorker(); |
|
| 46 | parent::setUpBeforeClass(); |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| @@ 20-50 (lines=31) @@ | ||
| 17 | * |
|
| 18 | * This test requires local beanstalkd running |
|
| 19 | */ |
|
| 20 | class PhpRedisJobManagerTest extends JobManagerTest |
|
| 21 | { |
|
| 22 | use PriorityTestTrait; |
|
| 23 | use AutoRetryTrait; |
|
| 24 | public static $connection; |
|
| 25 | ||
| 26 | public static function setUpBeforeClass() |
|
| 27 | { |
|
| 28 | $host = getenv('REDIS_HOST'); |
|
| 29 | $port = getenv('REDIS_PORT') ?: 6379; |
|
| 30 | $jobTimingClass = JobTiming::class; |
|
| 31 | $runClass = Run::class; |
|
| 32 | $redis = new \Redis(); |
|
| 33 | $redis->connect($host, $port); |
|
| 34 | $redis->flushAll(); |
|
| 35 | $phpredis = new PhpRedis($redis); |
|
| 36 | ||
| 37 | self::$jobTimingManager = new JobTimingManager($jobTimingClass, false); |
|
| 38 | self::$runManager = new RunManager($runClass); |
|
| 39 | self::$jobManager = new JobManager( |
|
| 40 | self::$runManager, |
|
| 41 | self::$jobTimingManager, |
|
| 42 | \Dtc\QueueBundle\Redis\Job::class, |
|
| 43 | 'test_cache_key' |
|
| 44 | ); |
|
| 45 | self::$jobManager->setRedis($phpredis); |
|
| 46 | self::$jobManager->setMaxPriority(255); |
|
| 47 | self::$worker = new FibonacciWorker(); |
|
| 48 | parent::setUpBeforeClass(); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||