Gets the number of items at a priority within the list
public getPriorityCount ( $priority = null ) : integer | ||
return | integer | the number of items in the list at the specified priority |
public function testRemoveTPriorityList() { $plist = new TPriorityList($this->plist); $this->assertEquals(2, $plist->remove($this->pitem2)); $this->assertEquals(1, $plist->getPriorityCount()); $plist = new TPriorityList($this->plist); try { $plist->remove($this->pitem5); $this->fail('Exception not raised: TInvalidDataValueException: The item cannot be found in the list'); } catch (TInvalidDataValueException $v) { } try { $plist->remove($this->pitem3, null); $this->fail('Exception not raised: TInvalidDataValueException: The item cannot be found in the list'); } catch (TInvalidDataValueException $v) { } try { $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)); }