Skip to content

Commit

Permalink
Properly initialize TestSuiteIterator.position
Browse files Browse the repository at this point in the history
Now this field always is an integer, following up on the promise
given by the type annotation.
  • Loading branch information
oliverklee authored and sebastianbergmann committed Sep 7, 2019
1 parent 4f201f7 commit 7fdbf5c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion src/Framework/TestSuiteIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class TestSuiteIterator implements RecursiveIterator
/**
* @var int
*/
private $position;
private $position = 0;

/**
* @var Test[]
Expand Down
6 changes: 0 additions & 6 deletions tests/unit/Framework/TestSuiteIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ final class TestSuiteIteratorTest extends TestCase

public function testKeyForEmptyTestSuiteInitiallyReturnsZero(): void
{
$this->markTestSkipped('This test needs a bug fix to pass.');

$testSuite = new TestSuite();
$subject = new TestSuiteIterator($testSuite);

Expand Down Expand Up @@ -52,8 +50,6 @@ public function testCurrentForEmptyTestSuiteInitiallyReturnsNull(): void

public function testKeyForNonEmptyTestSuiteInitiallyReturnsZero(): void
{
$this->markTestSkipped('This test needs a bug fix to pass.');

$testSuite = new TestSuite();
$testSuite->addTest(new \EmptyTestCaseTest());
$subject = new TestSuiteIterator($testSuite);
Expand All @@ -72,8 +68,6 @@ public function testValidForNonEmptyTestSuiteInitiallyReturnsTrue(): void

public function testCurrentForNonEmptyTestSuiteInitiallyReturnsFirstTest(): void
{
$this->markTestSkipped('This test needs a bug fix to pass.');

$test = new \EmptyTestCaseTest();
$testSuite = new TestSuite();
$testSuite->addTest($test);
Expand Down

0 comments on commit 7fdbf5c

Please sign in to comment.