-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQlessTest.php
More file actions
35 lines (27 loc) · 848 Bytes
/
QlessTest.php
File metadata and controls
35 lines (27 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once __DIR__ . '/../lib/Qless/Client.php';
require_once __DIR__ . '/../lib/Qless/Queue.php';
require_once __DIR__ . '/../lib/Qless/Jobs.php';
require_once __DIR__ . '/../demo/TestWorkerImpl.php';
require_once __DIR__ . '/LuaTester.php';
/**
* Base class for qless-php testing
*/
abstract class QlessTest extends PHPUnit_Framework_TestCase {
static $REDIS_HOST;
static $REDIS_PORT;
public static function setUpBeforeClass() {
self::$REDIS_HOST = getenv('REDIS_HOST') ?: 'localhost';
self::$REDIS_PORT = getenv('REDIS_PORT') ?: 6379;
}
/**
* @var Qless\Client
*/
protected $client;
public function setUp() {
$this->client = new Qless\Client(self::$REDIS_HOST, self::$REDIS_PORT);
}
public function tearDown() {
$this->client->lua->flush();
}
}