Browse files

Renamed the ItemIterator to RecursiveItemIterator

  • Loading branch information...
1 parent cc5a570 commit 19156b502db72ec42089d40ee12f001e6211de61 @stof stof committed May 8, 2012
View
2 src/Knp/Menu/Iterator/ItemIterator.php → ...p/Menu/Iterator/RecursiveItemIterator.php
@@ -5,7 +5,7 @@
/**
* Recursive iterator iterating on an item
*/
-class ItemIterator extends \IteratorIterator implements \RecursiveIterator
+class RecursiveItemIterator extends \IteratorIterator implements \RecursiveIterator
{
public function hasChildren()
{
View
4 tests/Knp/Menu/Tests/Iterator/CurrentItemFilterIteratorTest.php
@@ -3,7 +3,7 @@
namespace Knp\Menu\Tests\Iterator;
use Knp\Menu\Iterator\CurrentItemFilterIterator;
-use Knp\Menu\Iterator\ItemIterator;
+use Knp\Menu\Iterator\RecursiveItemIterator;
use Knp\Menu\Tests\TestCase;
class CurrentItemFilterIteratorTest extends TestCase
@@ -16,7 +16,7 @@ public function testFiltering()
$names = array();
$iterator = new CurrentItemFilterIterator(
- new \RecursiveIteratorIterator(new ItemIterator($this->menu), \RecursiveIteratorIterator::SELF_FIRST)
+ new \RecursiveIteratorIterator(new RecursiveItemIterator($this->menu), \RecursiveIteratorIterator::SELF_FIRST)
);
foreach ($iterator as $value) {
$names[] = $value->getName();
View
6 tests/Knp/Menu/Tests/Iterator/IteratorTest.php
@@ -2,7 +2,7 @@
namespace Knp\Menu\Tests\Iterator;
-use Knp\Menu\Iterator\ItemIterator;
+use Knp\Menu\Iterator\RecursiveItemIterator;
use Knp\Menu\Tests\TestCase;
class IteratorTest extends TestCase
@@ -30,7 +30,7 @@ public function testRecursiveIterator()
$this->menu->addChild($child);
$names = array();
- foreach (new \RecursiveIteratorIterator(new ItemIterator($this->menu), \RecursiveIteratorIterator::SELF_FIRST) as $value) {
+ foreach (new \RecursiveIteratorIterator(new RecursiveItemIterator($this->menu), \RecursiveIteratorIterator::SELF_FIRST) as $value) {
$names[] = $value->getName();
}
@@ -40,7 +40,7 @@ public function testRecursiveIterator()
public function testRecursiveIteratorLeavesOnly()
{
$names = array();
- foreach (new \RecursiveIteratorIterator(new ItemIterator($this->menu), \RecursiveIteratorIterator::LEAVES_ONLY) as $value) {
+ foreach (new \RecursiveIteratorIterator(new RecursiveItemIterator($this->menu), \RecursiveIteratorIterator::LEAVES_ONLY) as $value) {
$names[] = $value->getName();
}

0 comments on commit 19156b5

Please sign in to comment.