Extract method in PriorityQueue does not remove top element correctly
Current behavior
Method extract removes the extracted element from the queue's internal binary heap, but not from its internal array of items. The count method is based on the array of items, so after calling extract a call to count returns an incorrect value.
Bug Report
laminas/laminas-stdlib version 3.2.1.
Summary
Extract method in PriorityQueue does not remove top element correctly
Current behavior
Method
extract
removes the extracted element from the queue's internal binary heap, but not from its internal array of items. Thecount
method is based on the array of items, so after callingextract
a call tocount
returns an incorrect value.How to reproduce
Here is a failing unit test:
The result of the test is the following:
Expected behavior
After
extract
is called, the result returned from methodcount
should decrease by 1.