summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorjavalizard <>2010-10-04 03:16:29 +0000
committerjavalizard <>2010-10-04 03:16:29 +0000
commitd9fb4b20d14b9f090fa3d7c77d6c3134ca386dc9 (patch)
treeb3b9f3ed64b843ed20c6b59db47dc990fe91ad9f /tests/unit
parentb4b885d3bc63525fa58b8eedbd0495a1e357e443 (diff)
#247 Removed one redundant function. Change the unit test to reflect the function removal.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/Collections/TPriorityListTest.php48
1 files changed, 18 insertions, 30 deletions
diff --git a/tests/unit/Collections/TPriorityListTest.php b/tests/unit/Collections/TPriorityListTest.php
index 70f7c159..f329538c 100644
--- a/tests/unit/Collections/TPriorityListTest.php
+++ b/tests/unit/Collections/TPriorityListTest.php
@@ -583,60 +583,48 @@ class TPriorityListTest extends PHPUnit_Framework_TestCase
$this->assertEquals(2, $plist->remove($this->pitem2));
$this->assertEquals(1, $plist->getPriorityCount());
- }
-
- public function testRemoveAtTPriorityList()
- {
- $plist = new TPriorityList($this->plist);
- $this->assertEquals($this->pitem1, $plist->removeAt(1));
- $this->assertEquals(-1, $plist->indexOf($this->pitem1));
- $this->assertEquals(1, $plist->indexOf($this->pitem2));
- $this->assertEquals(0, $plist->indexOf($this->pfirst));
- try {
- $plist->removeAt(3);
- $this->fail('exception not raised when removing item with invalid index');
- }
- catch (TInvalidDataValueException $e) {
- }
- }
-
- public function testRemoveFromPriorityTPriorityList()
- {
$plist = new TPriorityList($this->plist);
try {
- $plist->removeFromPriority($this->pitem5);
+ $plist->remove($this->pitem5);
$this->fail('Exception not raised: TInvalidDataValueException: The item cannot be found in the list');
}
catch (TInvalidDataValueException $v) {
}
try {
- $plist->removeFromPriority($this->pitem3);
+ $plist->remove($this->pitem3, null);
$this->fail('Exception not raised: TInvalidDataValueException: The item cannot be found in the list');
}
catch (TInvalidDataValueException $v) {
}
try {
- $plist->removeFromPriority($this->pitem3, null);
+ $plist->remove($this->pitem1, 100);
$this->fail('Exception not raised: TInvalidDataValueException: The item cannot be found in the list');
}
catch (TInvalidDataValueException $v) {
}
+ $plist->insertBefore($this->pitem3, $this->pitem4);
+ $this->assertEquals(4, $plist->remove($this->pitem3, 100));
+ }
+
+ public function testRemoveAtTPriorityList()
+ {
+ $plist = new TPriorityList($this->plist);
+
+ $this->assertEquals($this->pitem1, $plist->removeAt(1));
+ $this->assertEquals(-1, $plist->indexOf($this->pitem1));
+ $this->assertEquals(1, $plist->indexOf($this->pitem2));
+ $this->assertEquals(0, $plist->indexOf($this->pfirst));
try {
- $plist->removeFromPriority($this->pitem1, 100);
- $this->fail('Exception not raised: TInvalidDataValueException: The item cannot be found in the list');
+ $plist->removeAt(3);
+ $this->fail('exception not raised when removing item with invalid index');
}
- catch (TInvalidDataValueException $v) {
+ catch (TInvalidDataValueException $e) {
}
-
- $plist->insertBefore($this->pitem3, $this->pitem4);
- $this->assertEquals(1, $plist->removeFromPriority($this->pitem3, 100));
-
-
}
public function testItemAtIndexPriorityTPriorityList()