1 Commits
0.2.0 ... 0.2.1

Author SHA1 Message Date
89cb1ae4b1 Adding ability to check for queue group existence 2014-08-11 12:24:05 -05:00
2 changed files with 35 additions and 0 deletions

View File

@@ -355,6 +355,15 @@ HTML;
return false;
}
/**
* @param string $groupName
* @return bool
*/
public function queueExists($groupName)
{
return (bool)is_dir($this->getQueueBaseDir().$groupName);
}
/**
* @return boolean
*/

View File

@@ -630,4 +630,30 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
return $uglyQueue;
}
/**
* @covers \DCarbone\UglyQueue::queueExists
* @uses \DCarbone\UglyQueue
* @depends testCanInitializeNewUglyQueue
* @param \DCarbone\UglyQueue $uglyQueue
*/
public function testCanDetermineExistenceOfExistingQueue(\DCarbone\UglyQueue $uglyQueue)
{
$exists = $uglyQueue->queueExists('tasty-sandwich');
$this->assertTrue($exists);
}
/**
* @covers \DCarbone\UglyQueue::queueExists
* @uses \DCarbone\UglyQueue
* @depends testCanInitializeNewUglyQueue
* @param \DCarbone\UglyQueue $uglyQueue
*/
public function testCanDetermineExistenceOfNonExistingQueue(\DCarbone\UglyQueue $uglyQueue)
{
$exists = $uglyQueue->queueExists('nasty-sandwich');
$this->assertFalse($exists);
}
}