Mercurial > hg > isophonics-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
12:7a779792577d | 13:5fb285c0d0e3 |
---|---|
1 Comment changes | |
2 ----- | |
3 <?php | |
4 // Test | |
5 foo(); | |
6 ----- | |
7 $stmts[0]->setAttribute('comments', []); | |
8 ----- | |
9 <?php | |
10 foo(); | |
11 ----- | |
12 <?php | |
13 $foo; | |
14 | |
15 | |
16 /* bar */ | |
17 $baz; | |
18 ----- | |
19 $comments = $stmts[1]->getComments(); | |
20 $comments[] = new Comment("// foo"); | |
21 $stmts[1]->setAttribute('comments', $comments); | |
22 ----- | |
23 <?php | |
24 $foo; | |
25 | |
26 | |
27 /* bar */ | |
28 // foo | |
29 $baz; | |
30 ----- | |
31 <?php | |
32 class Test { | |
33 /** | |
34 * @expectedException \FooException | |
35 */ | |
36 public function test() { | |
37 // some code | |
38 } | |
39 } | |
40 ----- | |
41 $method = $stmts[0]->stmts[0]; | |
42 $method->setAttribute('comments', [new Comment\Doc("/**\n *\n */")]); | |
43 ----- | |
44 <?php | |
45 class Test { | |
46 /** | |
47 * | |
48 */ | |
49 public function test() { | |
50 // some code | |
51 } | |
52 } |