2010-04-18 13:58:43 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Resque test case class. Contains setup and teardown methods.
|
|
|
|
*
|
|
|
|
* @package Resque/Tests
|
2012-10-13 06:55:41 +00:00
|
|
|
* @author Chris Boulton <chris@bigcommerce.com>
|
2010-04-18 13:58:43 +00:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php
|
|
|
|
*/
|
|
|
|
class Resque_Tests_TestCase extends PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
protected $resque;
|
|
|
|
protected $redis;
|
|
|
|
|
2016-10-13 03:45:02 +00:00
|
|
|
public static function setUpBeforeClass()
|
|
|
|
{
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
}
|
2016-10-06 01:49:15 +00:00
|
|
|
|
2010-04-18 13:58:43 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$config = file_get_contents(REDIS_CONF);
|
|
|
|
preg_match('#^\s*port\s+([0-9]+)#m', $config, $matches);
|
2013-01-12 12:37:38 +00:00
|
|
|
$this->redis = new Credis_Client('localhost', $matches[1]);
|
2010-04-18 13:58:43 +00:00
|
|
|
|
|
|
|
// Flush redis
|
|
|
|
$this->redis->flushAll();
|
|
|
|
}
|
2016-10-06 01:49:15 +00:00
|
|
|
}
|