File tree Expand file tree Collapse file tree 5 files changed +45
-0
lines changed
e2e/result-cache-meta-extension Expand file tree Collapse file tree 5 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,16 @@ jobs:
233233 cd e2e/bug-11857
234234 composer install
235235 ../../bin/phpstan
236+ - script : |
237+ cd e2e/result-cache-meta-extension
238+ ../../bin/phpstan -vvv
239+ ../../bin/phpstan -vvv --fail-without-result-cache
240+ echo 'modified-hash' > hash.txt
241+ OUTPUT=$(../bashunit -a exit_code "2" "../../bin/phpstan -vvv --fail-without-result-cache")
242+ echo "$OUTPUT"
243+ ../bashunit -a line_count 3 "$OUTPUT"
244+ ../bashunit -a matches "Note: Using configuration file .+phpstan.neon." "$OUTPUT"
245+ ../bashunit -a contains 'Result cache not used because the metadata do not match: metaExtensions' "$OUTPUT"
236246
237247 steps :
238248 - name : " Checkout"
Original file line number Diff line number Diff line change 140140 "classmap" : [
141141 " tests/e2e" ,
142142 " tests/PHPStan"
143+ ],
144+ "files" : [
145+ " e2e/result-cache-meta-extension/src/DummyResultCacheMetaExtension.php"
143146 ]
144147 },
145148 "repositories" : [
Original file line number Diff line number Diff line change 1+ initial-hash
Original file line number Diff line number Diff line change 1+ parameters :
2+ level : 8
3+ paths :
4+ - src
5+
6+ services :
7+ -
8+ class : ResultCacheE2E\MetaExtension\DummyResultCacheMetaExtension
9+ tags :
10+ - phpstan.resultCacheMetaExtension
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace ResultCacheE2E \MetaExtension ;
6+
7+ use PHPStan \Analyser \ResultCache \ResultCacheMetaExtension ;
8+
9+ final class DummyResultCacheMetaExtension implements ResultCacheMetaExtension
10+ {
11+ public function getKey (): string
12+ {
13+ return 'e2e-self-hashing-result-cache-meta-extension ' ;
14+ }
15+
16+ public function getHash (): string
17+ {
18+ // @phpstan-ignore argument.type (the file is always present so this won't pass `false` as an argument)
19+ return trim (file_get_contents (__DIR__ . '/../hash.txt ' ));
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments