1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

50 Commits

Author SHA1 Message Date
Brown
f78fbbe4c9 Fix #4146 - allow null checks on Iterator::current output 2020-09-07 11:40:36 -04:00
Brown
02a58f787b Fix #4148 - add Closure to scanned classes when arrow function is seen 2020-09-07 11:11:01 -04:00
Brown
b5279cd7d4 Fix erroneous Closure::__invoke return type 2020-09-01 12:33:25 -04:00
Brown
efe143a396 Fix #4077 - always track closure purity 2020-08-28 12:42:55 -04:00
Bruce Weirdan
1cf5153700
Test parallelization (#4045)
* Run tests in random order

Being able to run tests in any order is a pre-requisite for being able
to run them in parallel.

* Reset type coverage between tests, fix affected tests

* Reset parser and lexer between test runs and on php version change

Previously lexer was reset, but parser kept the reference to the old
one, and reference to the parser was kept by StatementsProvider. This
resulted in order-dependent tests - if the parser was first initialized
with phpVersion set to 7.4 then arrow functions worked fine, but were
failing when the parser was initially constructed with settings for 7.3

This can be demonstrated on current master by upgrading to
nikic/php-parser:4.9 and running:

```
vendor/bin/phpunit --no-coverage --filter="inferredArgArrowFunction" tests/ClosureTest.php
```

Now all tests using PHP 7.4 features must set the PHP version
accordingly.

* Marked more tests using 7.4 syntax

* Reset newline-between-annotation flag between tests

* Resolve real paths before passing them to checkPaths

When checkPaths is called from psalm.php the paths are resolved, so we
just mimicking SUT behaviour here.

* Restore newline-between-annotations in DocCommentTest

* Tweak Appveyor caches

* Tweak TravisCI caches

* Tweak CircleCI caches

* Run tests in parallel

Use `vendor/bin/paratest` instead of `vendor/bin/phpunit`

* Use default paratest runner on Windows

WrapperRunner is not supported on Windows.

* TRAVIS_TAG could be empty

* Restore appveyor conditional caching
2020-08-23 10:32:07 -04:00
Bruce Weirdan
4dcb7183f5
Fix windows tests (#4040)
* Fix windows tests by not mangling the expectations

* Use platform-dependent directory separator in expected messages

* fix CS
2020-08-22 10:00:36 -04:00
Brown
37e238a68b Fix tests 2020-07-07 10:41:46 -04:00
Brown
21f4deed3b Fix #3268 - infer generator return for closure 2020-04-29 16:52:37 -04:00
Matthew Brown
a179076de5 Break apart callabletest 2019-11-29 23:46:21 -05:00
Matt Brown
24490aac0e Fix #609 - fix callable coercion in reconciliation step 2018-03-20 13:24:16 -04:00
Matthew Brown
b8a8e9bc5b Add two skipped (bug-identifying) tests 2018-03-20 09:30:37 -04:00
Matthew Brown
d17058e7d5 Fix #608 - only check callable type if string/array is not also there 2018-03-20 08:58:05 -04:00
Matt Brown
93b714d7c8 Fix #541 - make array_map on object-like more accurate 2018-02-26 11:01:30 -05:00
Matthew Brown
e862e4ddb1 Make all plugin methods static
cc @TysonAndre
2018-02-11 20:56:34 -05:00
Matt Brown
21eafd8bfc Fix #352 with a mixed copout if the use is passed by reference 2018-01-12 12:33:26 -05:00
Matt Brown
2120d258a4 Fix formatting of return type adder 2018-01-11 15:50:58 -05:00
Matthew Brown
2f5b05887b Promote CircularReference from exception to issue 2017-12-22 18:56:59 +01:00
Matthew Brown
e3b688b06d Fix #316 - self resolves to proper class 2017-11-21 21:50:39 -05:00
Matthew Brown
440db3be89 Fix #313 - correctly analyse closure self return types 2017-11-16 20:06:00 -05:00
Matthew Brown
8aabcbce35 Introduce UntypedParam warnings when functions are missing param types 2017-09-02 11:18:56 -04:00
Matt Brown
7f9529e8a3 Remove stray comma 2017-08-18 17:23:12 -04:00
Matt Brown
d65a777641 Fix test function declaration 2017-08-18 17:06:01 -04:00
Matt Brown
c626b7d68a Fix #200 - allow mapping of more callable strings, and callable arrays 2017-08-14 19:30:11 -04:00
Matt Brown
0b0e7aa662 Fix #197 - allow nested class and function definitions 2017-08-14 15:46:01 -04:00
Matt Brown
13d98b803d Check that callable string class exists first 2017-08-11 18:48:58 -04:00
Matt Brown
17a900ab54 Add ability to detect invalid callable functions 2017-08-11 18:30:58 -04:00
Matt Brown
ac70ea31b2 Change test assertion keying 2017-06-29 10:22:49 -04:00
Matthew Brown
d6909193ea Add additional formatting changes 2017-05-26 20:05:57 -04:00
Jon Ursenbach
11bc153deb Rewriting and streamlining every unit test with data providers. (#147)
* Rewriting and streamlining every unit test with data providers.

All unit tests have been rewritten into PHPUnit data providers
to reduce the amount of unnecessary code-reuse through out the
test suite.
2017-04-24 23:45:02 -04:00
Matthew Brown
32efdfd0f7 Fix #129 - emit PossiblyNullFuntionCall when encountering such a thing 2017-04-08 11:38:06 -04:00
Matthew Brown
2d454d6e10 Fix #130 - check class exists before checking for __invoke 2017-04-08 11:15:17 -04:00
Matt Brown
a7872472be Add stubbing tests and modify config initialisation 2017-01-31 19:22:05 -05:00
Matthew Brown
b3726c9de5 Use getcwd() for the project’s base, not the config file parent directory 2017-01-16 18:33:04 -05:00
Matthew Brown
2e2f2f4ffb Add new suppressable error for missing closure return types 2017-01-16 01:22:36 -05:00
Matthew Brown
ac92de181f Allow classes that use __invoke to be called 2017-01-16 00:29:18 -05:00
Matt Brown
6e6106c080 Add docblocks to tests 2017-01-13 14:07:23 -05:00
Matt Brown
dc585ff22a Fix #47 - check closure param types properly 2017-01-13 12:40:01 -05:00
Matthew Brown
e7568f8400 Fix type coercion issues 2017-01-09 01:27:35 -05:00
Matthew Brown
17329015dc Discriminate between checking, visiting and analyzing in method names 2017-01-07 15:09:47 -05:00
Matthew Brown
7609ca02c0 Fix #32 by evaluating all class references in files lazily 2017-01-04 23:42:58 -05:00
Matthew Brown
30a39a0ee6 Do not emit issue when callable is called 2017-01-01 19:24:15 -05:00
Matthew Brown
846cc59d5f Add support for checking closure return types 2016-12-31 10:51:42 -05:00
Matthew Brown
52b3e1ba8c Simplify test config setup; 2016-12-18 19:00:32 -05:00
Matt Brown
c91e457c28 Add psalm.xml support for checking tests 2016-12-14 12:55:23 -05:00
Matt Brown
154d023a9d Add more robust config testing 2016-12-14 12:28:38 -05:00
Matt Brown
5077424844 Fix a bunch of tests to not emit issues on echo 2016-12-09 13:04:08 -05:00
Matt Brown
55a060b53a Add support for closure checks 2016-12-07 14:13:39 -05:00
Matthew Brown
8c64dfd7fb Add return types everywhere 2016-11-11 17:13:30 -05:00
Jon Ursenbach
27c2db1d1d PSR-2 2016-11-02 17:50:54 -04:00
Matthew Brown
98437c52db Check closure params to see if they align with array_map/array_filter args 2016-10-29 22:17:46 -04:00