Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/test/PhpParser/ErrorHandler/CollectingTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 5fb285c0d0e3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace PhpParser\ErrorHandler; | |
4 | |
5 use PhpParser\Error; | |
6 | |
7 class CollectingTest extends \PHPUnit_Framework_TestCase { | |
8 public function testHandleError() { | |
9 $errorHandler = new Collecting(); | |
10 $this->assertFalse($errorHandler->hasErrors()); | |
11 $this->assertEmpty($errorHandler->getErrors()); | |
12 | |
13 $errorHandler->handleError($e1 = new Error('Test 1')); | |
14 $errorHandler->handleError($e2 = new Error('Test 2')); | |
15 $this->assertTrue($errorHandler->hasErrors()); | |
16 $this->assertSame([$e1, $e2], $errorHandler->getErrors()); | |
17 | |
18 $errorHandler->clearErrors(); | |
19 $this->assertFalse($errorHandler->hasErrors()); | |
20 $this->assertEmpty($errorHandler->getErrors()); | |
21 } | |
22 } |