forked from sebastianbergmann/phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,46 +43,21 @@ | |
* @since File available since Release 3.7.30 | ||
*/ | ||
|
||
require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TestIterator.php'; | ||
|
||
class TestIterator2 implements Iterator { | ||
|
||
protected $data; | ||
|
||
public function __construct(array $array) | ||
{ | ||
$this->data = $array; | ||
} | ||
|
||
public function current() | ||
{ | ||
return current($this->data); | ||
} | ||
|
||
public function next() | ||
{ | ||
next($this->data); | ||
} | ||
|
||
public function key() | ||
{ | ||
return key($this->data); | ||
} | ||
|
||
public function valid() | ||
{ | ||
return key($this->data) !== null; | ||
} | ||
|
||
public function rewind() | ||
/** | ||
* | ||
* | ||
* @package PHPUnit | ||
* @author Sebastian Bergmann <[email protected]> | ||
* @author Jeroen Versteeg <[email protected]> | ||
* @copyright 2001-2014 Sebastian Bergmann <[email protected]> | ||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License | ||
* @link http://www.phpunit.de/ | ||
* @since Class available since Release 3.7.30 | ||
*/ | ||
class CountTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testCount() | ||
{ | ||
reset($this->data); | ||
} | ||
} | ||
|
||
class CountTest extends PHPUnit_Framework_TestCase { | ||
|
||
public function test_Count() { | ||
$countConstraint = new PHPUnit_Framework_Constraint_Count(3); | ||
$this->assertTrue($countConstraint->evaluate(array(1,2,3), '', true)); | ||
|
||
|
@@ -94,7 +69,7 @@ public function test_Count() { | |
$this->assertTrue($countConstraint->evaluate($it, '', true)); | ||
} | ||
|
||
public function test_CountDoesNotChangeIteratorKey () | ||
public function testCountDoesNotChangeIteratorKey() | ||
{ | ||
$countConstraint = new PHPUnit_Framework_Constraint_Count(2); | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
class TestIterator2 implements Iterator { | ||
|
||
protected $data; | ||
|
||
public function __construct(array $array) | ||
{ | ||
$this->data = $array; | ||
} | ||
|
||
public function current() | ||
{ | ||
return current($this->data); | ||
} | ||
|
||
public function next() | ||
{ | ||
next($this->data); | ||
} | ||
|
||
public function key() | ||
{ | ||
return key($this->data); | ||
} | ||
|
||
public function valid() | ||
{ | ||
return key($this->data) !== null; | ||
} | ||
|
||
public function rewind() | ||
{ | ||
reset($this->data); | ||
} | ||
} |
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