Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/test/code/formatPreservation/comments.test @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | |
children |
rev | line source |
---|---|
Chris@13 | 1 Comment changes |
Chris@13 | 2 ----- |
Chris@13 | 3 <?php |
Chris@13 | 4 // Test |
Chris@13 | 5 foo(); |
Chris@13 | 6 ----- |
Chris@13 | 7 $stmts[0]->setAttribute('comments', []); |
Chris@13 | 8 ----- |
Chris@13 | 9 <?php |
Chris@13 | 10 foo(); |
Chris@13 | 11 ----- |
Chris@13 | 12 <?php |
Chris@13 | 13 $foo; |
Chris@13 | 14 |
Chris@13 | 15 |
Chris@13 | 16 /* bar */ |
Chris@13 | 17 $baz; |
Chris@13 | 18 ----- |
Chris@13 | 19 $comments = $stmts[1]->getComments(); |
Chris@13 | 20 $comments[] = new Comment("// foo"); |
Chris@13 | 21 $stmts[1]->setAttribute('comments', $comments); |
Chris@13 | 22 ----- |
Chris@13 | 23 <?php |
Chris@13 | 24 $foo; |
Chris@13 | 25 |
Chris@13 | 26 |
Chris@13 | 27 /* bar */ |
Chris@13 | 28 // foo |
Chris@13 | 29 $baz; |
Chris@13 | 30 ----- |
Chris@13 | 31 <?php |
Chris@13 | 32 class Test { |
Chris@13 | 33 /** |
Chris@13 | 34 * @expectedException \FooException |
Chris@13 | 35 */ |
Chris@13 | 36 public function test() { |
Chris@13 | 37 // some code |
Chris@13 | 38 } |
Chris@13 | 39 } |
Chris@13 | 40 ----- |
Chris@13 | 41 $method = $stmts[0]->stmts[0]; |
Chris@13 | 42 $method->setAttribute('comments', [new Comment\Doc("/**\n *\n */")]); |
Chris@13 | 43 ----- |
Chris@13 | 44 <?php |
Chris@13 | 45 class Test { |
Chris@13 | 46 /** |
Chris@13 | 47 * |
Chris@13 | 48 */ |
Chris@13 | 49 public function test() { |
Chris@13 | 50 // some code |
Chris@13 | 51 } |
Chris@13 | 52 } |