Skip to content

Commit 2016000

Browse files
added test about iterable for ParsingErrors class (#284)
1 parent ec38de5 commit 2016000

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/Unit/Rules/ParsingErrorsTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,17 @@ public function test_convert_to_array(): void
8181

8282
$this->assertEquals($expected, $this->parsingStore->toArray());
8383
}
84+
85+
public function test_get_iterable(): void
86+
{
87+
$parsingError = ParsingError::create(
88+
'App\Controller\Foo',
89+
'Syntax error, unexpected T_STRING on line 8'
90+
);
91+
92+
$this->parsingStore->add($parsingError);
93+
$iterable = $this->parsingStore->getIterator();
94+
95+
$this->assertEquals([$this->parsingError, $parsingError], iterator_to_array($iterable));
96+
}
8497
}

0 commit comments

Comments
 (0)