Skip to content

Commit

Permalink
Implemented receipt a queue name
Browse files Browse the repository at this point in the history
  • Loading branch information
khaperets committed May 27, 2016
1 parent b036393 commit d23d5ed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Service/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public function setName($name)
$this->name = $name;
}

/**
* {@inheritdoc}
*/
public function getName()
{
return $this->name;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions Service/QueueInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public function setStorage(Storage\StorageInterface $storage);
*/
public function setName($name);

/**
* Gets the name of the queue list.
*
* @return string
*/
public function getName();

/**
* Removes and returns the first element of the list.
*
Expand Down
14 changes: 14 additions & 0 deletions Tests/Service/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ public function setUp()
}
}

public function testName()
{
$oldName = $this->queue->getName();
$newName = 'foobaz';

$this->queue->setName($newName);

$this->assertSame($newName, $this->queue->getName());

$this->queue->setName($oldName);

$this->assertSame($oldName, $this->queue->getName());
}

public function testPop()
{
$this->assertSame(false, $this->queue->pop());
Expand Down

0 comments on commit d23d5ed

Please sign in to comment.