2010-04-18 13:58:43 +00:00
|
|
|
<?php
|
2018-05-25 07:26:54 +00:00
|
|
|
|
2021-02-18 23:23:32 +00:00
|
|
|
namespace Resque\Test;
|
|
|
|
|
2010-04-18 13:58:43 +00:00
|
|
|
/**
|
|
|
|
* Resque test case class. Contains setup and teardown methods.
|
|
|
|
*
|
2018-05-25 07:26:54 +00:00
|
|
|
* @package Resque/Tests
|
2021-02-18 23:23:32 +00:00
|
|
|
* @author Daniel Mason <daniel@m2.nz>
|
2018-05-25 07:26:54 +00:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php
|
2010-04-18 13:58:43 +00:00
|
|
|
*/
|
2021-02-18 23:23:32 +00:00
|
|
|
class TestCase extends \PHPUnit\Framework\TestCase
|
2010-04-18 13:58:43 +00:00
|
|
|
{
|
2018-05-25 07:26:54 +00:00
|
|
|
protected $resque;
|
|
|
|
protected $redis;
|
2010-04-18 13:58:43 +00:00
|
|
|
|
2020-04-10 21:24:18 +00:00
|
|
|
public static function setUpBeforeClass(): void
|
2018-05-25 07:26:54 +00:00
|
|
|
{
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
}
|
2016-10-06 01:49:15 +00:00
|
|
|
|
2020-04-10 21:24:18 +00:00
|
|
|
public function setUp(): void
|
2018-05-25 07:26:54 +00:00
|
|
|
{
|
2018-05-30 07:05:13 +00:00
|
|
|
// Setup redis connection for testing.
|
2019-06-02 10:21:42 +00:00
|
|
|
global $redisTestServer;
|
|
|
|
|
2021-02-18 23:23:32 +00:00
|
|
|
$this->redis = new \Credis_Client($redisTestServer, '6379');
|
|
|
|
\Resque\Resque::setBackend($redisTestServer);
|
2018-05-25 07:26:54 +00:00
|
|
|
$this->redis->flushAll();
|
|
|
|
}
|
2016-10-06 01:49:15 +00:00
|
|
|
}
|