Skip to content

Commit 478cea1

Browse files
committed
Take advantage of gatherAssertTypesFromDirectory in NodeScopeResolverTest
1 parent 595de78 commit 478cea1

File tree

956 files changed

+139
-1457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

956 files changed

+139
-1457
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tests-golden-reflection:
2020
lint:
2121
php vendor/bin/parallel-lint --colors \
2222
--exclude tests/PHPStan/Analyser/data \
23+
--exclude tests/PHPStan/Analyser/nsrt \
2324
--exclude tests/PHPStan/Rules/Methods/data \
2425
--exclude tests/PHPStan/Rules/Functions/data \
2526
--exclude tests/PHPStan/Rules/Names/data \

build/downgrade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'tests/*/data/*',
1111
'tests/*/Fixture/*',
1212
'tests/PHPStan/Analyser/traits/*',
13+
'tests/PHPStan/Analyser/nsrt/*',
1314
'tests/PHPStan/Generics/functions.php',
1415
'tests/e2e/resultCache_1.php',
1516
'tests/e2e/resultCache_2.php',

build/phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ parameters:
2626
- ../src/Reflection/SignatureMap/functionMetadata.php
2727
- ../tests/*/data/*
2828
- ../tests/tmp/*
29+
- ../tests/PHPStan/Analyser/nsrt/*
2930
- ../tests/PHPStan/Analyser/traits/*
3031
- ../tests/notAutoloaded/*
3132
- ../tests/PHPStan/Generics/functions.php

phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
</properties>
206206
</rule>
207207
<exclude-pattern>tests/*/data</exclude-pattern>
208+
<exclude-pattern>tests/PHPStan/Analyser/nsrt</exclude-pattern>
208209
<exclude-pattern>tests/*/Fixture</exclude-pattern>
209210
<exclude-pattern>tests/e2e/resultCache_1.php</exclude-pattern>
210211
<exclude-pattern>tests/e2e/resultCache_2.php</exclude-pattern>

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function testBug3686(): void
263263

264264
public function testBug3379(): void
265265
{
266-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-3379.php');
266+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-3379.php');
267267
$this->assertCount(1, $errors);
268268
$this->assertSame('Constant SOME_UNKNOWN_CONST not found.', $errors[0]->getMessage());
269269
}
@@ -442,7 +442,7 @@ public function testBug5231Two(): void
442442

443443
public function testBug5529(): void
444444
{
445-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-5529.php');
445+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-5529.php');
446446
$this->assertNoErrors($errors);
447447
}
448448

@@ -715,7 +715,7 @@ public function testBug6192(): void
715715

716716
public function testBug7068(): void
717717
{
718-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-7068.php');
718+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-7068.php');
719719
$this->assertNoErrors($errors);
720720
}
721721

@@ -725,7 +725,7 @@ public function testDiscussion6993(): void
725725
$this->markTestSkipped('Test requires PHP 8.0.');
726726
}
727727

728-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-6993.php');
728+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-6993.php');
729729
$this->assertCount(1, $errors);
730730
$this->assertSame('Parameter #1 $specificable of method Bug6993\AndSpecificationValidator<Bug6993\TestSpecification,Bug6993\Foo>::isSatisfiedBy() expects Bug6993\Foo, Bug6993\Bar given.', $errors[0]->getMessage());
731731
}
@@ -742,7 +742,7 @@ public function testBug7078(): void
742742
$this->markTestSkipped('Test requires PHP 8.0.');
743743
}
744744

745-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-7078.php');
745+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-7078.php');
746746
$this->assertNoErrors($errors);
747747
}
748748

@@ -758,7 +758,7 @@ public function testBug7116(): void
758758

759759
public function testBug3853(): void
760760
{
761-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-3853.php');
761+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-3853.php');
762762
$this->assertNoErrors($errors);
763763
}
764764

@@ -827,7 +827,7 @@ public function testBug7094(): void
827827

828828
public function testOffsetAccess(): void
829829
{
830-
$errors = $this->runAnalyse(__DIR__ . '/data/offset-access.php');
830+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/offset-access.php');
831831
$this->assertCount(1, $errors);
832832
$this->assertSame('PHPDoc tag @return contains unresolvable type.', $errors[0]->getMessage());
833833
$this->assertSame(42, $errors[0]->getLine());
@@ -865,7 +865,7 @@ public function testBug7381(): void
865865

866866
public function testBug7153(): void
867867
{
868-
$errors = $this->runAnalyse(__DIR__ . '/data/bug-7153.php');
868+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-7153.php');
869869
$this->assertNoErrors($errors);
870870
}
871871

@@ -1063,7 +1063,7 @@ public function testBug8376(): void
10631063

10641064
public function testAssertDocblock(): void
10651065
{
1066-
$errors = $this->runAnalyse(__DIR__ . '/data/assert-docblock.php');
1066+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/assert-docblock.php');
10671067
$this->assertCount(4, $errors);
10681068
$this->assertSame('Call to method AssertDocblock\A::testInt() with string will always evaluate to false.', $errors[0]->getMessage());
10691069
$this->assertSame(218, $errors[0]->getLine());

0 commit comments

Comments
 (0)