comparison vendor/nikic/php-parser/test/PhpParser/ErrorTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 5fb285c0d0e3
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 <?php declare(strict_types=1); 1 <?php declare(strict_types=1);
2 2
3 namespace PhpParser; 3 namespace PhpParser;
4 4
5 use PHPUnit\Framework\TestCase; 5 class ErrorTest extends \PHPUnit\Framework\TestCase
6
7 class ErrorTest extends TestCase
8 { 6 {
9 public function testConstruct() { 7 public function testConstruct() {
10 $attributes = [ 8 $attributes = [
11 'startLine' => 10, 9 'startLine' => 10,
12 'endLine' => 11, 10 'endLine' => 11,
92 } catch (\RuntimeException $e) { 90 } catch (\RuntimeException $e) {
93 $this->assertSame('Error does not have column information', $e->getMessage()); 91 $this->assertSame('Error does not have column information', $e->getMessage());
94 } 92 }
95 } 93 }
96 94
97 /**
98 * @expectedException \RuntimeException
99 * @expectedExceptionMessage Invalid position information
100 */
101 public function testInvalidPosInfo() { 95 public function testInvalidPosInfo() {
96 $this->expectException(\RuntimeException::class);
97 $this->expectExceptionMessage('Invalid position information');
102 $error = new Error('Some error', [ 98 $error = new Error('Some error', [
103 'startFilePos' => 10, 99 'startFilePos' => 10,
104 'endFilePos' => 11, 100 'endFilePos' => 11,
105 ]); 101 ]);
106 $error->getStartColumn('code'); 102 $error->getStartColumn('code');