diff options
Diffstat (limited to 'vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php')
-rw-r--r-- | vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php b/vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php new file mode 100644 index 0000000..3742981 --- /dev/null +++ b/vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php @@ -0,0 +1,22 @@ +<?php + +namespace PhpParser\ErrorHandler; + +use PhpParser\Error; + +class CollectingTest extends \PHPUnit_Framework_TestCase { + public function testHandleError() { + $errorHandler = new Collecting(); + $this->assertFalse($errorHandler->hasErrors()); + $this->assertEmpty($errorHandler->getErrors()); + + $errorHandler->handleError($e1 = new Error('Test 1')); + $errorHandler->handleError($e2 = new Error('Test 2')); + $this->assertTrue($errorHandler->hasErrors()); + $this->assertSame([$e1, $e2], $errorHandler->getErrors()); + + $errorHandler->clearErrors(); + $this->assertFalse($errorHandler->hasErrors()); + $this->assertEmpty($errorHandler->getErrors()); + } +}
\ No newline at end of file |