Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
rev | line source |
---|---|
Chris@13 | 1 <?php declare(strict_types=1); |
Chris@0 | 2 |
Chris@0 | 3 namespace PhpParser\ErrorHandler; |
Chris@0 | 4 |
Chris@0 | 5 use PhpParser\Error; |
Chris@0 | 6 |
Chris@17 | 7 class CollectingTest extends \PHPUnit\Framework\TestCase |
Chris@13 | 8 { |
Chris@0 | 9 public function testHandleError() { |
Chris@0 | 10 $errorHandler = new Collecting(); |
Chris@0 | 11 $this->assertFalse($errorHandler->hasErrors()); |
Chris@0 | 12 $this->assertEmpty($errorHandler->getErrors()); |
Chris@0 | 13 |
Chris@0 | 14 $errorHandler->handleError($e1 = new Error('Test 1')); |
Chris@0 | 15 $errorHandler->handleError($e2 = new Error('Test 2')); |
Chris@0 | 16 $this->assertTrue($errorHandler->hasErrors()); |
Chris@0 | 17 $this->assertSame([$e1, $e2], $errorHandler->getErrors()); |
Chris@0 | 18 |
Chris@0 | 19 $errorHandler->clearErrors(); |
Chris@0 | 20 $this->assertFalse($errorHandler->hasErrors()); |
Chris@0 | 21 $this->assertEmpty($errorHandler->getErrors()); |
Chris@0 | 22 } |
Chris@13 | 23 } |