File tree Expand file tree Collapse file tree 9 files changed +56
-186
lines changed
tests/PHPStan/Analyser/traitsCachingIssue Expand file tree Collapse file tree 9 files changed +56
-186
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,36 @@ jobs:
184
184
- script : |
185
185
cd e2e/env-int-key
186
186
env 1=1 ../../bin/phpstan analyse test.php
187
+ - script : |
188
+ cd e2e/trait-caching
189
+ ../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
190
+ ../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
191
+ - script : |
192
+ cd e2e/trait-caching
193
+ ../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
194
+ patch -b data/TraitOne.php < TraitOne.patch
195
+ OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
196
+ echo "$OUTPUT"
197
+ [ $(echo "$OUTPUT" | wc -l) -eq 1 ]
198
+ grep 'Method TraitsCachingIssue\\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
199
+ - script : |
200
+ cd e2e/trait-caching
201
+ ../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
202
+ patch -b data/TraitTwo.php < TraitTwo.patch
203
+ OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
204
+ echo "$OUTPUT"
205
+ [ $(echo "$OUTPUT" | wc -l) -eq 1 ]
206
+ grep 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
207
+ - script : |
208
+ cd e2e/trait-caching
209
+ ../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
210
+ patch -b data/TraitOne.php < TraitOne.patch
211
+ patch -b data/TraitTwo.php < TraitTwo.patch
212
+ OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
213
+ echo "$OUTPUT"
214
+ [ $(echo "$OUTPUT" | wc -l) -eq 2 ]
215
+ grep 'Method TraitsCachingIssue\\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
216
+ grep 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
187
217
188
218
steps :
189
219
- name : " Checkout"
Original file line number Diff line number Diff line change
1
+ diff --git a/e2e/trait-caching/data/TraitOne.php b/e2e/trait-caching/data/TraitOne.php
2
+ index 395dc1333a..1641ad6e65 100644
3
+ --- a/e2e/trait-caching/data/TraitOne.php
4
+ +++ b/e2e/trait-caching/data/TraitOne.php
5
+ @@ -2,7 +2,7 @@
6
+
7
+ namespace TraitsCachingIssue;
8
+
9
+ - use stdClass as Foo;
10
+ + use Exception as Foo;
11
+
12
+ trait TraitOne
13
+ {
Original file line number Diff line number Diff line change
1
+ diff --git a/e2e/trait-caching/data/TraitTwo.php b/e2e/trait-caching/data/TraitTwo.php
2
+ index 1b9827b727..4089407f13 100644
3
+ --- a/e2e/trait-caching/data/TraitTwo.php
4
+ +++ b/e2e/trait-caching/data/TraitTwo.php
5
+ @@ -2,7 +2,7 @@
6
+
7
+ namespace TraitsCachingIssue;
8
+
9
+ - use stdClass as Foo;
10
+ + use Exception as Foo;
11
+
12
+ trait TraitTwo
13
+ {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments