Skip to content

Commit

Permalink
Merge pull request #82 from glensc/Zend_Controller_Action_HelperBroke…
Browse files Browse the repository at this point in the history
…r_PriorityStackTest

Fix iterators usage
  • Loading branch information
falkenhawk authored Mar 15, 2021
2 parents 9150d8a + 922efe3 commit 1cfdc03
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/Zend/Controller/Action/HelperBroker/PriorityStackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public function testStackMaintainsLifo()
$this->stack->push(new Zend_Controller_Action_Helper_ViewRenderer());
$this->stack->push(new Zend_Controller_Action_Helper_Redirector());
$this->assertEquals(2, count($this->stack));
$iterator = $this->stack->getIterator();
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class(current($iterator)));
next($iterator);
$this->assertEquals('Zend_Controller_Action_Helper_ViewRenderer', get_class(current($iterator)));
$iterator = $this->stack->getIterator()->getIterator();
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class($iterator->current()));
$iterator->next();
$this->assertEquals('Zend_Controller_Action_Helper_ViewRenderer', get_class($iterator->current()));
}

public function testStackPrioritiesWithDefaults()
Expand Down Expand Up @@ -107,7 +107,7 @@ public function testStackAccessors()
$this->stack->push(new Zend_Controller_Action_Helper_Redirector());
unset($this->stack->ViewRenderer);
$this->assertEquals(1, count($this->stack));
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class(current($this->stack->getIterator())));
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class($this->stack->getIterator()->getIterator()->current()));
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class($this->stack->Redirector));
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class($this->stack->offsetGet('Redirector')));
$this->assertEquals('Zend_Controller_Action_Helper_Redirector', get_class($this->stack->offsetGet(2)));
Expand Down

0 comments on commit 1cfdc03

Please sign in to comment.