You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7583afd
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/workflows/e2e-tests.yml
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -901,6 +901,70 @@ jobs:
901
901
echo "$OUTPUT"
902
902
../bashunit -a contains 'Result cache restored. 1 file will be reanalysed.' "$OUTPUT"
903
903
../bashunit -a contains 'UsesCopied.php:16:Method ResultCacheE2EPathRepository\UsesCopied::doUsesCopied() should return int but returns string.' "$OUTPUT"
904
+
- script: |
905
+
cd e2e/result-cache-composer-json
906
+
composer install
907
+
../../bin/phpstan analyse
908
+
# composer.json decides which PHP version the analysis targets (config.platform.php) and
909
+
# which symbols the autoloader can reach, but its contents are hashed nowhere in the cache
910
+
# metadata - composerLocks and composerInstalled cover composer.lock and installed.php, and
911
+
# neither of those moves when only composer.json changes.
912
+
patch -p0 < platform.patch
913
+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -vv --error-format raw")
914
+
echo "$OUTPUT"
915
+
../bashunit -a contains 'Foo.php:10:Function str_contains not found.' "$OUTPUT"
916
+
- script: |
917
+
cd e2e/result-cache-empty-file-gains-symbol
918
+
# src/script.php declares no symbol, so the cache holds no exported nodes entry for it at
919
+
# all, and src/user.php uses a class that does not exist yet.
920
+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -vv --error-format raw")
921
+
echo "$OUTPUT"
922
+
../bashunit -a contains 'user.php:7:Instantiated class ResultCacheE2EEmptyFileGainsSymbol\Thing not found.' "$OUTPUT"
923
+
# That file now declares a class. A root symbol appeared, so the files with errors have to
924
+
# be re-analysed, the same way a brand new file makes them re-analysed - the missing
925
+
# exported nodes entry must not be read as "nothing changed".
926
+
mv gains/script.php src/script.php
927
+
OUTPUT=$(../bashunit -a exit_code "0" "../../bin/phpstan analyse -vv --error-format raw")
928
+
echo "$OUTPUT"
929
+
../bashunit -a not_contains 'Instantiated class ResultCacheE2EEmptyFileGainsSymbol\Thing not found.' "$OUTPUT"
930
+
- script: |
931
+
cd e2e/result-cache-string-class
932
+
../../bin/phpstan analyse
933
+
# The instantiated class is named by a constant string, so it is resolved through the type
934
+
# system rather than through a name node, and the dependency graph records no edge from
935
+
# Thing.php to Factory.php. Deleting the class still has to be noticed.
936
+
rm src/Thing.php
937
+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -vv --error-format raw")
938
+
echo "$OUTPUT"
939
+
../bashunit -a contains 'Factory.php:12:Instantiated class ResultCacheE2EStringClass\Thing not found.' "$OUTPUT"
940
+
- script: |
941
+
cd e2e/result-cache-import-type-deleted
942
+
../../bin/phpstan analyse
943
+
# Deleting the class an imported type alias comes from makes the PHPDoc of Base.php
944
+
# unresolvable, and a file whose PHPDoc cannot be resolved records no dependencies at all -
945
+
# the edge to User.php is dropped. The next edit of Base.php must still reach User.php.
946
+
rm src/Aliases.php
947
+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -vv --error-format raw")
948
+
echo "$OUTPUT"
949
+
patch -b -p0 < signature.patch
950
+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -vv --error-format raw")
951
+
echo "$OUTPUT"
952
+
../bashunit -a contains 'User.php:10:Method ResultCacheE2EImportType\User::doUser() should return int but returns string.' "$OUTPUT"
953
+
- script: |
954
+
cd e2e/result-cache-require-deleted
955
+
../../bin/phpstan analyse
956
+
# The file named in require() is not analysed, not scanned and not autoloadable, so no hash
957
+
# of it exists anywhere in the cache. Deleting it has to be noticed all the same: the rule
958
+
# that checks the path reports an error the moment it is gone.
959
+
rm config/app.php
960
+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -vv --error-format raw")
961
+
echo "$OUTPUT"
962
+
../bashunit -a contains 'Foo.php:10:Path in require() "config/app.php" is not a file or it does not exist.' "$OUTPUT"
963
+
# And putting it back has to clear the error again.
0 commit comments