Skip to content

Commit ae197d0

Browse files
committed
Remove old test; improve parser test
1 parent a593ac8 commit ae197d0

File tree

2 files changed

+18
-289
lines changed

2 files changed

+18
-289
lines changed

test/ErrorTypesParserTest.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,34 @@
77

88
class ErrorTypesParserTest extends TestCase
99
{
10-
public function test_error_types_parser()
10+
/**
11+
* @dataProvider parsableValueProvider
12+
*/
13+
public function testParse(string $value, int $expected): void
1114
{
12-
$ex = new ErrorTypesParser('E_ALL & ~E_DEPRECATED & ~E_NOTICE');
13-
$this->assertEquals($ex->parse(), E_ALL & ~E_DEPRECATED & ~E_NOTICE);
15+
$ex = new ErrorTypesParser($value);
16+
$this->assertEquals($expected, $ex->parse());
1417
}
1518

16-
public function test_error_types_parser_throws_exception_for_unwanted_values()
19+
public function parsableValueProvider(): array
20+
{
21+
return [
22+
['E_ALL', E_ALL],
23+
['E_ALL & ~E_DEPRECATED & ~E_NOTICE', E_ALL & ~E_DEPRECATED & ~E_NOTICE],
24+
['-1', -1],
25+
[-1, -1],
26+
];
27+
}
28+
29+
public function testParseStopsAtDangerousValues(): void
1730
{
1831
$ex = new ErrorTypesParser('exec(something-dangerous)');
1932

2033
$this->expectException(\InvalidArgumentException::class);
2134
$ex->parse();
2235
}
2336

24-
public function test_error_types_parser_throws_exception_for_unparsable_values()
37+
public function testErrorTypesParserThrowsExceptionForUnparsableValues(): void
2538
{
2639
$ex = new ErrorTypesParser('something-wrong');
2740

test/EventListener/ExceptionListenerTest.php

Lines changed: 0 additions & 284 deletions
This file was deleted.

0 commit comments

Comments
 (0)