28 Commits

Author SHA1 Message Date
80219635ad fix: unset repo_name 💚
Some checks failed
Create Distribution / Create Archive (push) Failing after 5s
CI / release (push) Successful in 1m41s
Also remove the overwrite_files toggle.
2024-10-30 10:09:25 +13:00
2d2047f0b9 fix: Fixing CI. Set (package) repo name variable 👷🔥
All checks were successful
CI / release (push) Successful in 12s
Create Distribution / Create Archive (push) Successful in 1m33s
2024-10-30 09:53:24 +13:00
443f5eefa9 fix: Fixing CI. Use tag ref from ENV 👷🔥
All checks were successful
CI / release (push) Successful in 14s
Create Distribution / Create Archive (push) Successful in 1m32s
2024-10-30 09:38:47 +13:00
fe8fac0e07 fix: Fixing CI. Use tag ref from ENV 👷🔥
Some checks failed
CI / release (push) Successful in 14s
Create Distribution / Create Archive (push) Failing after 1m32s
2024-10-30 09:31:40 +13:00
fe7e429568 fix: Fixing CI. Update variables 👷🔥
Some checks failed
CI / release (push) Successful in 15s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-30 09:29:50 +13:00
f7e5bf4cd9 fix: Fixing CI. Update variables 👷🔥
Some checks failed
CI / release (push) Successful in 15s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-30 09:25:58 +13:00
1b69a901d9 fix: Fixing CI. Update variables 👷🔥
Some checks failed
CI / release (push) Successful in 13s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-30 09:23:00 +13:00
ee889a3841 fix: Fixing CI. List build dir too 👷🔥
Some checks failed
CI / release (push) Successful in 17s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-29 23:33:58 +13:00
4400bff0b4 fix: Fixing CI. Use master branch 👷🔥
Some checks failed
CI / release (push) Successful in 20s
Create Distribution / Create Archive (push) Failing after 1m30s
2024-10-29 22:07:41 +13:00
8b9534bc91 fix: Fixing CI. Added directory listing 👷🔥
Some checks failed
CI / release (push) Successful in 13s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-29 21:40:11 +13:00
a6ecf19932 fix: Fixing CI. Added directory listing 👷🔥
Some checks failed
CI / release (push) Successful in 13s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-29 21:37:39 +13:00
942c4e8699 fix: Fixing CI. Separate flow for upload 👷🔥
Some checks failed
CI / release (push) Successful in 14s
Create Distribution / Create Archive (push) Failing after 4s
2024-10-29 21:31:10 +13:00
d9d01fcbb3 fix: Fixing CI. Separate flow for upload 👷🔥
Some checks failed
CI / release (push) Successful in 1m47s
Create Distribution / Create Archive (push) Failing after 2s
2024-10-29 21:10:53 +13:00
de1973025f fix: Exclude generated changelog 🔥
All checks were successful
CI / release (push) Successful in 16s
2024-10-24 23:03:56 +13:00
dede25ec32 fix: Do not include semrel folder 🔥
All checks were successful
CI / release (push) Successful in 16s
2024-10-24 22:59:47 +13:00
607d3a9004 fix: Relabelling namespace/package names ♻️
All checks were successful
CI / release (push) Successful in 24s
2024-10-24 22:38:37 +13:00
032be45f9f fix: Create .zip archive instead of .tar.gz for Gitea 💚👷
All checks were successful
CI / release (push) Successful in 42s
2024-10-24 22:25:21 +13:00
afbddabea2 chore: Updated repo path 🔨 2024-10-24 22:24:23 +13:00
2ec085419f fix: Updated build script 🔨💚
All checks were successful
CI / release (push) Successful in 22s
2024-10-24 16:58:31 +13:00
7657af0a55 fix: Updated build script 🔨💚
All checks were successful
CI / release (push) Successful in 19s
2024-10-24 16:55:02 +13:00
8b87324850 ci: Use gitea provider from go-semantic-release 💚
All checks were successful
CI / release (push) Successful in 21s
2024-10-24 16:41:41 +13:00
25c80c4baf chore: Updated gitignore 🙈
Some checks failed
CI / release (push) Failing after 2m21s
2024-10-24 16:36:53 +13:00
afc24185d3 ci: Added Gitea Actions config 👷 2024-10-24 16:36:25 +13:00
e1cac1e31d fix: Don't break on whitespace. Helpful for JSON 🐛 2024-10-24 16:26:31 +13:00
0c05079327 tests: Updated tests for later PHPUnit 🔥 2024-10-24 15:37:18 +13:00
7526e04e08 chore: Update namespace 2024-10-24 15:36:26 +13:00
b84bde262e ⬆️ chore: Change namespace 2024-10-24 15:34:40 +13:00
a2b204fa47 Update README.md 2015-10-13 15:49:15 -05:00
12 changed files with 359 additions and 255 deletions

23
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: CI
on:
push:
branches:
- "**"
tags:
- "!**"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Release Archive
id: semrelease
uses: go-semantic-release/action@v1
with:
# custom-arguments: --provider=gitea
hooks: exec
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}

22
.github/workflows/dist.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Create Distribution
run-name: Distribute composer package with Gitea Actions 🚀
on:
push:
tags:
- 'v*'
jobs:
dist:
name: Create Archive
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # Checkout Sourcecode
- uses: https://hub.cybercinch.nz/cybercinch/composer-build-action@v1
- uses: https://hub.cybercinch.nz/guisea/gitea-composer-upload-action@master
with:
baseurl: "${{ secrets.G_SERVER_URL}}"
access_token: "${{ secrets.G_TOKEN }}"
username: "${{ secrets.G_USERNAME }}"
owner: "cybercinch" # Override owner name for repository (Optional) Only if different from username
version: "${{ env.GITHUB_REF_NAME }}"

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
**/vendor
tests/misc/*
!tests/misc/cleanup.php
!tests/misc/index.html

21
.semrelrc Normal file
View File

@@ -0,0 +1,21 @@
{
"plugins": {
"provider": {
"name": "gitea"
},
"changelog-generator": {
"name": "default",
"options": {
"emojis": "true"
}
},
"hooks": {
"names": [
"exec"
],
"options": {
"exec_on_no_release": "echo {{.Reason}}: {{.Message}}"
}
}
}
}

View File

@@ -3,16 +3,14 @@ ugly-queue
A simple file-based FIFO queue system for PHP 5.3.3+
Build statuses:
- master: [![Build Status](https://travis-ci.org/dcarbone/ugly-queue.svg?branch=master)](https://travis-ci.org/dcarbone/ugly-queue)
- 0.3.1: [![Build Status](https://travis-ci.org/dcarbone/ugly-queue.svg?branch=0.3.1)](https://travis-ci.org/dcarbone/ugly-queue)
Build status: [![Build Status](https://travis-ci.org/Cybercinch/ugly-queue.svg?branch=master)](https://travis-ci.org/Cybercinch/ugly-queue)
## Installation
This library is designed to be installed into your app using [https://getcomposer.org/](Composer).
Simply copy-paste the following line into your `"requires:"` hash:
```json
"dcarbone/ugly-queue": "0.3.*"
"dcarbone/ugly-queue": "0.4.*"
```
## Basic Usage
@@ -57,10 +55,10 @@ $queueBaseDir = 'path to where you would like queue files and directories to be
$manager = new UglyQueueManager($queueBaseDir);
// 'tasty-sandwich' queue will exist now
$tastySandwich = $manager->getQueue('sandwiches');
// 'sandwiches' queue will exist now
$tastySandwich->lock();
// Specify the number of items you wish to retrieve from the queue

View File

@@ -1,5 +1,5 @@
{
"name" : "dcarbone/ugly-queue",
"name" : "cybercinch/ugly-queue",
"type" : "library",
"description" : "A simple file-based queue system for PHP 5.3.3+",
@@ -9,28 +9,32 @@
"file queue",
"ugly queue"
],
"homepage": "https://github.com/dcarbone/ugly-queue",
"homepage": "https://hub.cybercinch.nz/cybercinch/ugly-queue",
"license": "GPLv3",
"authors" : [
{
"name" : "Daniel Carbone",
"email" : "daniel.p.carbone@gmail.com"
},
{
"name" : "Aaron Guise",
"email" : "aaron-composer@guise.net.nz"
}
],
"require" : {
"php" : ">=5.3.3",
"php" : ">=7.1",
"dcarbone/helpers" : "~6.1"
},
"require-dev" : {
"phpunit/phpunit": "~4.1"
"phpunit/phpunit": "~9.6.21"
},
"autoload" : {
"psr-4" : {
"DCarbone\\" : "src/"
"Cybercinch\\" : "src/"
}
}
}

32
scripts/build.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
mkdir -p ./build/
echo "Made temporary directory"
# Package up the release (Needs to be .zip for upload to gitea)
zip -r "./build/Package.zip" \
. \
-x '.semrel/*' \
-x '.generated-go-semantic-release-changelog.md' \
-x './vendor/*' \
-x './tests/*' \
-x './build/*' \
-x './.git/*' \
-x './.idea/*' \
-x './.github/*' \
-x './scripts/*'
#RELEASE_ID=$(curl --silent -X 'GET' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/latest" \
#-H "accept: application/json" \
#-H "Authorization: token ${GITEA_TOKEN}" | jq -r .id)
#
## Attach to release
#curl --silent -X 'POST' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/${RELEASE_ID}/assets?name=ugly-queue-${1}.tar.gz" \
#-H "Authorization: token ${GITEA_TOKEN}" \
#--form attachment="@build/ugly-queue-${1}.tar.gz"
# Upload the artifact to composer registry
curl --user "cibot:${GITEA_TOKEN}" \
--upload-file "build/ugly-queue.zip" \
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"

View File

@@ -1,10 +1,10 @@
<?php namespace DCarbone;
<?php namespace Cybercinch;
use DCarbone\Helpers\FileHelper;
/**
* Class UglyQueue
* @package DCarbone
* @package Cybercinch
*/
class UglyQueue implements \Serializable, \SplSubject, \Countable
{
@@ -269,7 +269,7 @@ class UglyQueue implements \Serializable, \SplSubject, \Countable
$data = array();
$start_line = $lineCount - $count;
$i = 0;
while (($line = fscanf($queueFileHandle, "%s\t%s\n")) !== false && $i < $lineCount)
while (($line = fscanf($queueFileHandle, "%s\t%[^\n]")) !== false && $i < $lineCount)
{
if ($i++ >= $start_line)
{

View File

@@ -1,8 +1,8 @@
<?php namespace DCarbone;
<?php namespace Cybercinch;
/**
* Class UglyQueueEnum
* @package DCarbone
* @package Cybercinch
*
* Pseudo-enum thing.
*/

View File

@@ -1,8 +1,10 @@
<?php namespace DCarbone;
<?php namespace Cybercinch;
use InvalidArgumentException;
/**
* Class UglyQueueManager
* @package DCarbone
* @package Cybercinch
*/
class UglyQueueManager implements \SplObserver, \Countable
{
@@ -17,12 +19,12 @@ class UglyQueueManager implements \SplObserver, \Countable
*
* @param string $baseDir
* @throws \RuntimeException
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function __construct($baseDir)
{
if (false === is_string($baseDir))
throw new \InvalidArgumentException('Argument 1 expected to be string, "'.gettype($baseDir).'" seen.');
throw new InvalidArgumentException('Argument 1 expected to be string, "'.gettype($baseDir).'" seen.');
if (false === is_dir($baseDir))
throw new \RuntimeException('"'.$baseDir.'" points to a directory that does not exist.');
@@ -40,7 +42,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param string $name
* @return UglyQueue|UglyQueueManager
* @return UglyQueue
*/
public function getQueue($name)
{
@@ -56,7 +58,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param UglyQueue $uglyQueue
* @return \DCarbone\UglyQueueManager
* @return UglyQueueManager
* @throws \RuntimeException
*/
public function addQueue(UglyQueue $uglyQueue)
@@ -111,7 +113,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param UglyQueue $uglyQueue
* @return \DCarbone\UglyQueueManager
* @return UglyQueueManager
*/
public function removeQueue(UglyQueue $uglyQueue)
{
@@ -124,7 +126,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param string $name
* @return \DCarbone\UglyQueueManager
* @return UglyQueueManager
*/
public function removeQueueByName($name)
{
@@ -136,15 +138,15 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param string $name
* @return \DCarbone\UglyQueue
* @throws \InvalidArgumentException
* @return UglyQueue
* @throws InvalidArgumentException
*/
public function getQueueWithName($name)
{
if (isset($this->queues[$name]))
return $this->queues[$name];
throw new \InvalidArgumentException('Argument 1 expected to be valid queue name.');
throw new InvalidArgumentException('Argument 1 expected to be valid queue name.');
}
/**

View File

@@ -7,7 +7,7 @@ require_once __DIR__.'/../misc/cleanup.php';
/**
* Class UglyQueueTest
*/
class UglyQueueTest extends PHPUnit_Framework_TestCase
class UglyQueueTest extends PHPUnit\Framework\TestCase
{
protected $baseDir;
@@ -28,45 +28,44 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
'10' => 'Virginia baked ham, sliced',
);
protected function setUp()
protected function setUp(): void
{
$this->baseDir = realpath(__DIR__.'/../misc/queues');
}
/**
* @covers \DCarbone\UglyQueue::__construct
* @uses \DCarbone\UglyQueue
* @return \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::__construct
* @uses \Cybercinch\UglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanInitializeObjectWithValidParameters()
{
$uglyQueue = new \DCarbone\UglyQueue($this->baseDir, 'tasty-sandwich');
$uglyQueue = new \Cybercinch\UglyQueue($this->baseDir, 'tasty-sandwich');
$this->assertInstanceOf('\\DCarbone\\UglyQueue', $uglyQueue);
$this->assertInstanceOf('\\Cybercinch\\UglyQueue', $uglyQueue);
return $uglyQueue;
}
/**
* @covers \DCarbone\UglyQueue::retrieveItems
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::retrieveItems
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @expectedException \RuntimeException
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testExceptionThrownWhenTryingToProcessQueueAfterInitializationBeforeLock(\DCarbone\UglyQueue $uglyQueue)
public function testExceptionThrownWhenTryingToProcessQueueAfterInitializationBeforeLock(\Cybercinch\UglyQueue $uglyQueue)
{
$this->expectException(\RuntimeException::class);
$uglyQueue->retrieveItems();
}
/**
* @covers \DCarbone\UglyQueue::keyExistsInQueue
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::keyExistsInQueue
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testKeyExistsInQueueReturnsFalseWithEmptyQueueAfterInitialization(\DCarbone\UglyQueue $uglyQueue)
public function testKeyExistsInQueueReturnsFalseWithEmptyQueueAfterInitialization(\Cybercinch\UglyQueue $uglyQueue)
{
$exists = $uglyQueue->keyExistsInQueue(0);
@@ -75,24 +74,24 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::addItem
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::addItem
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @expectedException \RuntimeException
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testExceptionThrownWhenTryingToAddItemsToQueueWithoutLock(\DCarbone\UglyQueue $uglyQueue)
public function testExceptionThrownWhenTryingToAddItemsToQueueWithoutLock(\Cybercinch\UglyQueue $uglyQueue)
{
$this->expectException(\RuntimeException::class);
$uglyQueue->addItem('test', 'value');
}
/**
* @covers \DCarbone\UglyQueue::getPath
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::getPath
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetQueueDirectory(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetQueueDirectory(\Cybercinch\UglyQueue $uglyQueue)
{
$queuePath = $uglyQueue->getPath();
@@ -100,12 +99,12 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::getName
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::getName
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetQueueName(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetQueueName(\Cybercinch\UglyQueue $uglyQueue)
{
$queueName = $uglyQueue->getName();
@@ -113,33 +112,33 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::getMode
* @covers \Cybercinch\UglyQueue::getMode
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetQueueMode(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetQueueMode(\Cybercinch\UglyQueue $uglyQueue)
{
$mode = $uglyQueue->getMode();
$this->assertEquals(\DCarbone\UglyQueue::QUEUE_READWRITE, $mode);
$this->assertEquals(\Cybercinch\UglyQueue::QUEUE_READWRITE, $mode);
}
/**
* @covers \DCarbone\UglyQueue::getBaseDir
* @covers \Cybercinch\UglyQueue::getBaseDir
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetBaseDirectory(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetBaseDirectory(\Cybercinch\UglyQueue $uglyQueue)
{
$baseDir = $uglyQueue->getBaseDir();
$this->assertEquals($this->baseDir, $baseDir);
}
/**
* @covers \DCarbone\UglyQueue::getLockFile
* @covers \Cybercinch\UglyQueue::getLockFile
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetLockFilePath(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetLockFilePath(\Cybercinch\UglyQueue $uglyQueue)
{
$lockFile = $uglyQueue->getLockFile();
$this->assertEquals(
@@ -153,11 +152,11 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::getQueueFile
* @covers \Cybercinch\UglyQueue::getQueueFile
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetQueueFilePath(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetQueueFilePath(\Cybercinch\UglyQueue $uglyQueue)
{
$queueFile = $uglyQueue->getQueueFile();
$this->assertEquals(
@@ -171,11 +170,11 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::getQueueTmpFile
* @covers \Cybercinch\UglyQueue::getQueueTmpFile
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetQueueTmpFilePath(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetQueueTmpFilePath(\Cybercinch\UglyQueue $uglyQueue)
{
$queueTmpFile = $uglyQueue->getQueueTmpFile();
$this->assertEquals(
@@ -190,11 +189,11 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::getSerializeFile
* @covers \Cybercinch\UglyQueue::getSerializeFile
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetSerializeFilePath(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetSerializeFilePath(\Cybercinch\UglyQueue $uglyQueue)
{
$serializeFile = $uglyQueue->getSerializeFile();
$this->assertEquals(
@@ -209,77 +208,77 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetQueueLockedStatus(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetQueueLockedStatus(\Cybercinch\UglyQueue $uglyQueue)
{
$locked = $uglyQueue->isAlreadyLocked();
$this->assertFalse($locked);
}
/**
* @covers \DCarbone\UglyQueue::count
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::count
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testGetQueueItemCountReturnsZeroWithEmptyQueue(\DCarbone\UglyQueue $uglyQueue)
public function testGetQueueItemCountReturnsZeroWithEmptyQueue(\Cybercinch\UglyQueue $uglyQueue)
{
$itemCount = count($uglyQueue);
$this->assertEquals(0, $itemCount);
}
/**
* @covers \DCarbone\UglyQueue::__construct
* @uses \DCarbone\UglyQueue
* @return \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::__construct
* @uses \Cybercinch\UglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanInitializeExistingQueue()
{
$uglyQueue = new \DCarbone\UglyQueue($this->baseDir, 'tasty-sandwich');
$uglyQueue = new \Cybercinch\UglyQueue($this->baseDir, 'tasty-sandwich');
$this->assertInstanceOf('\\DCarbone\\UglyQueue', $uglyQueue);
$this->assertInstanceOf('\\Cybercinch\\UglyQueue', $uglyQueue);
return $uglyQueue;
}
/**
* @covers \DCarbone\UglyQueue::lock
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::lock
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @expectedException \InvalidArgumentException
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testExceptionThrownWhenPassingNonIntegerValueToLock(\DCarbone\UglyQueue $uglyQueue)
public function testExceptionThrownWhenPassingNonIntegerValueToLock(\Cybercinch\UglyQueue $uglyQueue)
{
$this->expectException(\InvalidArgumentException::class);
$uglyQueue->lock('7 billion');
}
/**
* @covers \DCarbone\UglyQueue::lock
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::lock
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @expectedException \InvalidArgumentException
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testExceptionThrownWhenPassingNegativeIntegerValueToLock(\DCarbone\UglyQueue $uglyQueue)
public function testExceptionThrownWhenPassingNegativeIntegerValueToLock(\Cybercinch\UglyQueue $uglyQueue)
{
$this->expectException(\InvalidArgumentException::class);
$uglyQueue->lock(-73);
}
/**
* @covers \DCarbone\UglyQueue::lock
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @covers \DCarbone\UglyQueue::createLockFile
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::lock
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @covers \Cybercinch\UglyQueue::createLockFile
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidParameters
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanLockUglyQueueWithDefaultTTL(\DCarbone\UglyQueue $uglyQueue)
public function testCanLockUglyQueueWithDefaultTTL(\Cybercinch\UglyQueue $uglyQueue)
{
$locked = $uglyQueue->lock();
@@ -298,13 +297,13 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::lock
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::lock
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeExistingQueue
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCannotLockQueueThatIsAlreadyLocked(\DCarbone\UglyQueue $uglyQueue)
public function testCannotLockQueueThatIsAlreadyLocked(\Cybercinch\UglyQueue $uglyQueue)
{
$lock = $uglyQueue->lock();
@@ -313,12 +312,12 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @uses \Cybercinch\UglyQueue
* @depends testCanLockUglyQueueWithDefaultTTL
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testIsLockedReturnsTrueAfterLocking(\DCarbone\UglyQueue $uglyQueue)
public function testIsLockedReturnsTrueAfterLocking(\Cybercinch\UglyQueue $uglyQueue)
{
$isLocked = $uglyQueue->isAlreadyLocked();
@@ -326,14 +325,14 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::unlock
* @uses \DCarbone\UglyQueue
* @uses \DCarbone\Helpers\FileHelper
* @covers \Cybercinch\UglyQueue::unlock
* @uses \Cybercinch\UglyQueue
* @uses \Cybercinch\Helpers\FileHelper
* @depends testCanLockUglyQueueWithDefaultTTL
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanUnlockLockedQueue(\DCarbone\UglyQueue $uglyQueue)
public function testCanUnlockLockedQueue(\Cybercinch\UglyQueue $uglyQueue)
{
$uglyQueue->unlock();
@@ -344,12 +343,12 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @uses \Cybercinch\UglyQueue
* @depends testCanUnlockLockedQueue
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testIsLockedReturnsFalseAfterUnlockingQueue(\DCarbone\UglyQueue $uglyQueue)
public function testIsLockedReturnsFalseAfterUnlockingQueue(\Cybercinch\UglyQueue $uglyQueue)
{
$isLocked = $uglyQueue->isAlreadyLocked();
@@ -358,14 +357,14 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::lock
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @uses \DCarbone\UglyQueue
* @uses \DCarbone\Helpers\FileHelper
* @covers \Cybercinch\UglyQueue::lock
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @uses \Cybercinch\UglyQueue
* @uses \Cybercinch\Helpers\FileHelper
* @depends testCanUnlockLockedQueue
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testIsLockedReturnsFalseWithStaleQueueLockFile(\DCarbone\UglyQueue $uglyQueue)
public function testIsLockedReturnsFalseWithStaleQueueLockFile(\Cybercinch\UglyQueue $uglyQueue)
{
$uglyQueue->lock(2);
@@ -379,14 +378,14 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::lock
* @covers \DCarbone\isAlreadyLocked::isAlreadyLocked
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::lock
* @covers \Cybercinch\isAlreadyLocked::isAlreadyLocked
* @uses \Cybercinch\UglyQueue
* @depends testCanUnlockLockedQueue
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanLockQueueWithValidIntegerValue(\DCarbone\UglyQueue $uglyQueue)
public function testCanLockQueueWithValidIntegerValue(\Cybercinch\UglyQueue $uglyQueue)
{
$locked = $uglyQueue->lock(200);
@@ -406,14 +405,14 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::addItem
* @uses \DCarbone\UglyQueue
* @uses \DCarbone\Helpers\FileHelper
* @covers \Cybercinch\UglyQueue::addItem
* @uses \Cybercinch\UglyQueue
* @uses \Cybercinch\Helpers\FileHelper
* @depends testCanLockQueueWithValidIntegerValue
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock(\DCarbone\UglyQueue $uglyQueue)
public function testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock(\Cybercinch\UglyQueue $uglyQueue)
{
foreach(array_reverse($this->tastySandwich, true) as $k=>$v)
@@ -426,7 +425,7 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
$uglyQueue->getQueueTmpFile(),
'queue.tmp file was not created!');
$lineCount = \DCarbone\Helpers\FileHelper::getLineCount($uglyQueue->getQueueTmpFile());
$lineCount = \Dcarbone\Helpers\FileHelper::getLineCount($uglyQueue->getQueueTmpFile());
$this->assertEquals(11, $lineCount);
@@ -434,13 +433,13 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::_populateQueue
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::_populateQueue
* @uses \Cybercinch\UglyQueue
* @depends testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanForciblyUpdateQueueFileFromTempFile(\DCarbone\UglyQueue $uglyQueue)
public function testCanForciblyUpdateQueueFileFromTempFile(\Cybercinch\UglyQueue $uglyQueue)
{
$uglyQueue->_populateQueue();
@@ -453,13 +452,13 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::count
* @uses \DCarbone\UglyQueue
* @uses \DCarbone\Helpers\FileHelper
* @covers \Cybercinch\UglyQueue::count
* @uses \Cybercinch\UglyQueue
* @uses \Cybercinch\Helpers\FileHelper
* @depends testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testCanGetCountOfItemsInPopulatedQueue(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetCountOfItemsInPopulatedQueue(\Cybercinch\UglyQueue $uglyQueue)
{
$itemCount = count($uglyQueue);
@@ -467,12 +466,12 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::keyExistsInQueue
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::keyExistsInQueue
* @uses \Cybercinch\UglyQueue
* @depends testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testKeyExistsReturnsTrueWithPopulatedQueue(\DCarbone\UglyQueue $uglyQueue)
public function testKeyExistsReturnsTrueWithPopulatedQueue(\Cybercinch\UglyQueue $uglyQueue)
{
$exists = $uglyQueue->keyExistsInQueue(5);
@@ -481,41 +480,40 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::retrieveItems
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::retrieveItems
* @uses \Cybercinch\UglyQueue
* @depends testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock
* @expectedException \InvalidArgumentException
* @param \DCarbone\UglyQueue $uglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testExceptionThrownWhenTryingToProcessLockedQueueWithNonInteger(\DCarbone\UglyQueue $uglyQueue)
public function testExceptionThrownWhenTryingToProcessLockedQueueWithNonInteger(\Cybercinch\UglyQueue $uglyQueue)
{
$this->expectException(\InvalidArgumentException::class);
$uglyQueue->retrieveItems('Eleventy Billion');
}
/**
* @covers \DCarbone\UglyQueue::retrieveItems
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueue::retrieveItems
* @uses \Cybercinch\UglyQueue
* @depends testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock
* @expectedException \InvalidArgumentException
* @param \DCarbone\UglyQueue $uglyQueue
* @expectedException
* @param \Cybercinch\UglyQueue $uglyQueue
*/
public function testExceptionThrownWhenTryingToProcessLockedQueueWithIntegerLessThan1(\DCarbone\UglyQueue $uglyQueue)
public function testExceptionThrownWhenTryingToProcessLockedQueueWithIntegerLessThan1(\Cybercinch\UglyQueue $uglyQueue)
{
$this->expectException(\InvalidArgumentException::class);
$uglyQueue->retrieveItems(0);
}
/**
* @covers \DCarbone\UglyQueue::retrieveItems
* @covers \DCarbone\UglyQueue::count
* @uses \DCarbone\UglyQueue
* @uses \DCarbone\Helpers\FileHelper
* @covers \Cybercinch\UglyQueue::retrieveItems
* @covers \Cybercinch\UglyQueue::count
* @uses \Cybercinch\UglyQueue
* @uses \Cybercinch\Helpers\FileHelper
* @depends testCanPopulateQueueTempFileAfterInitializationAndAcquiringLock
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanGetPartialQueueContents(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetPartialQueueContents(\Cybercinch\UglyQueue $uglyQueue)
{
$process = $uglyQueue->retrieveItems(5);
@@ -531,15 +529,15 @@ class UglyQueueTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueue::retrieveItems
* @covers \DCarbone\UglyQueue::count
* @uses \DCarbone\UglyQueue
* @uses \DCarbone\Helpers\FileHelper
* @covers \Cybercinch\UglyQueue::retrieveItems
* @covers \Cybercinch\UglyQueue::count
* @uses \Cybercinch\UglyQueue
* @uses \Cybercinch\Helpers\FileHelper
* @depends testCanGetPartialQueueContents
* @param \DCarbone\UglyQueue $uglyQueue
* @return \DCarbone\UglyQueue
* @param \Cybercinch\UglyQueue $uglyQueue
* @return \Cybercinch\UglyQueue
*/
public function testCanGetFullQueueContents(\DCarbone\UglyQueue $uglyQueue)
public function testCanGetFullQueueContents(\Cybercinch\UglyQueue $uglyQueue)
{
$process = $uglyQueue->retrieveItems(6);

View File

@@ -3,7 +3,7 @@
/**
* Class UglyQueueManagerTest
*/
class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
class UglyQueueManagerTest extends PHPUnit\Framework\TestCase
{
protected $baseDir;
@@ -13,47 +13,47 @@ class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
'2' => 'boneless pork ribs',
);
protected function setUp()
protected function setUp(): void
{
$this->baseDir = realpath(__DIR__.'/../misc/queues');
}
/**
* @covers \DCarbone\UglyQueueManager::__construct
* @covers \DCarbone\UglyQueue::unserialize
* @covers \DCarbone\UglyQueueManager::addQueue
* @covers \DCarbone\UglyQueueManager::containsQueueWithName
* @uses \DCarbone\UglyQueueManager
* @uses \DCarbone\UglyQueue
* @return \DCarbone\UglyQueueManager
* @covers \Cybercinch\UglyQueueManager::__construct
* @covers \Cybercinch\UglyQueue::unserialize
* @covers \Cybercinch\UglyQueueManager::addQueue
* @covers \Cybercinch\UglyQueueManager::containsQueueWithName
* @uses \Cybercinch\UglyQueueManager
* @uses \Cybercinch\UglyQueue
* @return \Cybercinch\UglyQueueManager
*/
public function testCanInitializeObjectWithValidPath()
{
$manager = new \DCarbone\UglyQueueManager($this->baseDir);
$manager = new \Cybercinch\UglyQueueManager($this->baseDir);
$this->assertInstanceOf('\\DCarbone\\UglyQueueManager', $manager);
$this->assertInstanceOf('\\Cybercinch\\UglyQueueManager', $manager);
return $manager;
}
/**
* @covers \DCarbone\UglyQueueManager::__construct
* @uses \DCarbone\UglyQueueManager
* @expectedException \RuntimeException
* @covers \Cybercinch\UglyQueueManager::__construct
* @uses \Cybercinch\UglyQueueManager
*/
public function testExceptionThrownDuringConstructionWithInvalidBasePathValue()
{
new \DCarbone\UglyQueueManager('i do not exist!');
$this->expectException(RuntimeException::class);
new \Cybercinch\UglyQueueManager('i do not exist!');
}
/**
* @covers \DCarbone\UglyQueueManager::containsQueueWithName
* @uses \DCarbone\UglyQueueManager
* @covers \Cybercinch\UglyQueueManager::containsQueueWithName
* @uses \Cybercinch\UglyQueueManager
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testCanDetermineIfValidQueueExistsInManager(\DCarbone\UglyQueueManager $manager)
public function testCanDetermineIfValidQueueExistsInManager(\Cybercinch\UglyQueueManager $manager)
{
$shouldBeTrue = $manager->containsQueueWithName('tasty-sandwich');
@@ -61,12 +61,12 @@ class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueueManager::containsQueueWithName
* @uses \DCarbone\UglyQueueManager
* @covers \Cybercinch\UglyQueueManager::containsQueueWithName
* @uses \Cybercinch\UglyQueueManager
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testCanDetermineQueueDoesNotExistInManager(\DCarbone\UglyQueueManager $manager)
public function testCanDetermineQueueDoesNotExistInManager(\Cybercinch\UglyQueueManager $manager)
{
$shouldBeFalse = $manager->containsQueueWithName('i should not exist');
@@ -74,95 +74,95 @@ class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
}
/**
* @covers \DCarbone\UglyQueueManager::getQueueWithName
* @uses \DCarbone\UglyQueueManager
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueueManager::getQueueWithName
* @uses \Cybercinch\UglyQueueManager
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testCanGetUglyQueueObjectFromManager(\DCarbone\UglyQueueManager $manager)
public function testCanGetUglyQueueObjectFromManager(\Cybercinch\UglyQueueManager $manager)
{
$uglyQueue = $manager->getQueueWithName('tasty-sandwich');
$this->assertInstanceOf('\\DCarbone\\UglyQueue', $uglyQueue);
$this->assertInstanceOf('\\Cybercinch\\UglyQueue', $uglyQueue);
$this->assertEquals('tasty-sandwich', $uglyQueue->getName());
}
/**
* @covers \DCarbone\UglyQueueManager::getQueueWithName
* @uses \DCarbone\UglyQueueManager
* @expectedException \InvalidArgumentException
* @covers \Cybercinch\UglyQueueManager::getQueueWithName
* @uses \Cybercinch\UglyQueueManager
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testExceptionThrownWhenTryingToGetNonExistentQueueFromManager(\DCarbone\UglyQueueManager $manager)
public function testExceptionThrownWhenTryingToGetNonExistentQueueFromManager(\Cybercinch\UglyQueueManager $manager)
{
$this->expectException(InvalidArgumentException::class);
$manager->getQueueWithName('sandwiches');
}
/**
* @covers \DCarbone\UglyQueueManager::getQueueList
* @uses \DCarbone\UglyQueueManager
* @covers \Cybercinch\UglyQueueManager::getQueueList
* @uses \Cybercinch\UglyQueueManager
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testCanGetListOfQueuesInManager(\DCarbone\UglyQueueManager $manager)
public function testCanGetListOfQueuesInManager(\Cybercinch\UglyQueueManager $manager)
{
$queueList = $manager->getQueueList();
$this->assertInternalType('array', $queueList);
$this->assertIsArray($queueList);
$this->assertCount(1, $queueList);
$this->assertContains('tasty-sandwich', $queueList);
}
/**
* @covers \DCarbone\UglyQueueManager::getQueueWithName
* @covers \DCarbone\UglyQueueManager::addQueue
* @uses \DCarbone\UglyQueueManager
* @uses \DCarbone\UglyQueue
* @expectedException \RuntimeException
* @covers \Cybercinch\UglyQueueManager::getQueueWithName
* @covers \Cybercinch\UglyQueueManager::addQueue
* @uses \Cybercinch\UglyQueueManager
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testExceptionThrownWhenReAddingQueueToManager(\DCarbone\UglyQueueManager $manager)
public function testExceptionThrownWhenReAddingQueueToManager(\Cybercinch\UglyQueueManager $manager)
{
$this->expectException(RuntimeException::class);
$uglyQueue = $manager->getQueueWithName('tasty-sandwich');
$manager->addQueue($uglyQueue);
}
/**
* @covers \DCarbone\UglyQueueManager::addQueueAtPath
* @covers \DCarbone\UglyQueueManager::addQueue
* @covers \DCarbone\UglyQueueManager::getQueueWithName
* @uses \DCarbone\UglyQueueManager
* @uses \DCarbone\UglyQueue
* @covers \Cybercinch\UglyQueueManager::addQueueAtPath
* @covers \Cybercinch\UglyQueueManager::addQueue
* @covers \Cybercinch\UglyQueueManager::getQueueWithName
* @uses \Cybercinch\UglyQueueManager
* @uses \Cybercinch\UglyQueue
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testCanInitializeNewQueueAndAddToManager(\DCarbone\UglyQueueManager $manager)
public function testCanInitializeNewQueueAndAddToManager(\Cybercinch\UglyQueueManager $manager)
{
$manager->addQueueAtPath($this->baseDir.'/really-tasty-sandwich');
$uglyQueue = $manager->getQueueWithName('really-tasty-sandwich');
$this->assertInstanceOf('\\DCarbone\\UglyQueue', $uglyQueue);
$this->assertInstanceOf('\\Cybercinch\\UglyQueue', $uglyQueue);
$this->assertEquals('really-tasty-sandwich', $uglyQueue->getName());
$queueList = $manager->getQueueList();
$this->assertInternalType('array', $queueList);
$this->assertIsArray($queueList);
$this->assertCount(2, $queueList);
$this->assertContains('really-tasty-sandwich', $queueList);
}
/**
* @covers \DCarbone\UglyQueueManager::removeQueueByName
* @uses \DCarbone\UglyQueueManager
* @covers \Cybercinch\UglyQueueManager::removeQueueByName
* @uses \Cybercinch\UglyQueueManager
* @depends testCanInitializeObjectWithValidPath
* @param \DCarbone\UglyQueueManager $manager
* @param \Cybercinch\UglyQueueManager $manager
*/
public function testCanRemoveQueueFromManagerByName(\DCarbone\UglyQueueManager $manager)
public function testCanRemoveQueueFromManagerByName(\Cybercinch\UglyQueueManager $manager)
{
$manager->removeQueueByName('really-tasty-sandwich');
@@ -173,12 +173,12 @@ class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
}
// /**
// * @covers \DCarbone\UglyQueue::queueExists
// * @uses \DCarbone\UglyQueue
// * @covers \Cybercinch\UglyQueue::queueExists
// * @uses \Cybercinch\UglyQueue
// * @depends testCanInitializeNewUglyQueue
// * @param \DCarbone\UglyQueue $uglyQueue
// * @param \Cybercinch\UglyQueue $uglyQueue
// */
// public function testCanDetermineExistenceOfExistingQueue(\DCarbone\UglyQueue $uglyQueue)
// public function testCanDetermineExistenceOfExistingQueue(\Cybercinch\UglyQueue $uglyQueue)
// {
// $exists = $uglyQueue->queueExists('tasty-sandwich');
//
@@ -186,12 +186,12 @@ class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
// }
//
// /**
// * @covers \DCarbone\UglyQueue::queueExists
// * @uses \DCarbone\UglyQueue
// * @covers \Cybercinch\UglyQueue::queueExists
// * @uses \Cybercinch\UglyQueue
// * @depends testCanInitializeNewUglyQueue
// * @param \DCarbone\UglyQueue $uglyQueue
// * @param \Cybercinch\UglyQueue $uglyQueue
// */
// public function testCanDetermineExistenceOfNonExistingQueue(\DCarbone\UglyQueue $uglyQueue)
// public function testCanDetermineExistenceOfNonExistingQueue(\Cybercinch\UglyQueue $uglyQueue)
// {
// $exists = $uglyQueue->queueExists('nasty-sandwich');
//
@@ -199,12 +199,12 @@ class UglyQueueManagerTest extends PHPUnit_Framework_TestCase
// }
//
// /**
// * @covers \DCarbone\UglyQueue::getInitializedQueueList
// * @uses \DCarbone\UglyQueue
// * @covers \Cybercinch\UglyQueue::getInitializedQueueList
// * @uses \Cybercinch\UglyQueue
// * @depends testCanInitializeNewUglyQueue
// * @param \DCarbone\UglyQueue $uglyQueue
// * @param \Cybercinch\UglyQueue $uglyQueue
// */
// public function testCanGetListOfInitializedQueues(\DCarbone\UglyQueue $uglyQueue)
// public function testCanGetListOfInitializedQueues(\Cybercinch\UglyQueue $uglyQueue)
// {
// $queueList = $uglyQueue->getInitializedQueueList();
//