mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-25 01:35:14 +00:00
Merge pull request #235 from magnusp/master
Resolves chrisboulton/php-resque#145
This commit is contained in:
commit
eb7ab0c81a
@ -98,7 +98,7 @@ class Resque_Redis
|
|||||||
*/
|
*/
|
||||||
public static function prefix($namespace)
|
public static function prefix($namespace)
|
||||||
{
|
{
|
||||||
if (strpos($namespace, ':') === false) {
|
if (substr($namespace, -1) !== ':') {
|
||||||
$namespace .= ':';
|
$namespace .= ':';
|
||||||
}
|
}
|
||||||
self::$defaultNamespace = $namespace;
|
self::$defaultNamespace = $namespace;
|
||||||
|
@ -167,6 +167,20 @@ class Resque_Tests_JobTest extends Resque_Tests_TestCase
|
|||||||
$this->assertTrue(Test_Job_With_TearDown::$called);
|
$this->assertTrue(Test_Job_With_TearDown::$called);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testNamespaceNaming() {
|
||||||
|
$fixture = array(
|
||||||
|
array('test' => 'more:than:one:with:', 'assertValue' => 'more:than:one:with:'),
|
||||||
|
array('test' => 'more:than:one:without', 'assertValue' => 'more:than:one:without:'),
|
||||||
|
array('test' => 'resque', 'assertValue' => 'resque:'),
|
||||||
|
array('test' => 'resque:', 'assertValue' => 'resque:'),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($fixture as $item) {
|
||||||
|
Resque_Redis::prefix($item['test']);
|
||||||
|
$this->assertEquals(Resque_Redis::getPrefix(), $item['assertValue']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function testJobWithNamespace()
|
public function testJobWithNamespace()
|
||||||
{
|
{
|
||||||
Resque_Redis::prefix('php');
|
Resque_Redis::prefix('php');
|
||||||
|
Loading…
Reference in New Issue
Block a user