comparison vendor/nikic/php-parser/test/PhpParser/NodeDumperTest.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 NodeDumperTest extends \PHPUnit\Framework\TestCase
6
7 class NodeDumperTest extends TestCase
8 { 6 {
9 private function canonicalize($string) { 7 private function canonicalize($string) {
10 return str_replace("\r\n", "\n", $string); 8 return str_replace("\r\n", "\n", $string);
11 } 9 }
12 10
96 $dump = $dumper->dump($stmts, $code); 94 $dump = $dumper->dump($stmts, $code);
97 95
98 $this->assertSame($this->canonicalize($expected), $this->canonicalize($dump)); 96 $this->assertSame($this->canonicalize($expected), $this->canonicalize($dump));
99 } 97 }
100 98
101 /**
102 * @expectedException \InvalidArgumentException
103 * @expectedExceptionMessage Can only dump nodes and arrays.
104 */
105 public function testError() { 99 public function testError() {
100 $this->expectException(\InvalidArgumentException::class);
101 $this->expectExceptionMessage('Can only dump nodes and arrays.');
106 $dumper = new NodeDumper; 102 $dumper = new NodeDumper;
107 $dumper->dump(new \stdClass); 103 $dumper->dump(new \stdClass);
108 } 104 }
109 } 105 }