Skip to content

Commit 6b0cf7f

Browse files
committed
clone iterator
1 parent b8f6966 commit 6b0cf7f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/IteratorTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
*
4+
*/
5+
6+
namespace Mvc5\Test;
7+
8+
use Mvc5\Config;
9+
use Mvc5\Iterator;
10+
11+
use Mvc5\Test\Test\TestCase;
12+
13+
class IteratorTest
14+
extends TestCase
15+
{
16+
/**
17+
*
18+
*/
19+
function test_clone()
20+
{
21+
$config = new Config(['foo' => 'bar']);
22+
$iterator = new Iterator($config);
23+
24+
$clone = clone $iterator;
25+
$config['foo'] = 'foobar';
26+
27+
$this->assertEquals('foobar', $iterator->current());
28+
$this->assertEquals('bar', $clone->current());
29+
}
30+
}

0 commit comments

Comments
 (0)