Created
February 28, 2011 14:56
-
-
Save flevour/847420 to your computer and use it in GitHub Desktop.
Testing 2 things with 2 test methods.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function testIteratesOverOneElementArraysUsingValues() | |
{ | |
$iterator = new ArrayIterator(array('foo')); | |
foreach ($iterator as $element) { | |
$this->assertEquals('foo', $element); | |
} | |
} | |
public function testIteratesOneTimeOverOneElementArrays() | |
{ | |
$iterator = new ArrayIterator(array('foo')); | |
$i = 0; | |
foreach ($iterator as $element) { | |
$i++; | |
} | |
$this->assertEquals(1, $i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment