Skip to content

Commit 121c7c9

Browse files
committed
assert parameter types
1 parent 9cac8fb commit 121c7c9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/PHPStan/Type/StringTypeTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public static function dataIsSuperTypeOf(): array
9898
#[DataProvider('dataIsSuperTypeOf')]
9999
public function testIsSuperTypeOf(Type $stringType, Type $otherType, TrinaryLogic $expectedResult): void
100100
{
101+
$this->assertInstanceOf(StringType::class, $stringType);
102+
101103
$actualResult = $stringType->isSuperTypeOf($otherType);
102104
$this->assertSame(
103105
$expectedResult->describe(),
@@ -176,6 +178,8 @@ public static function dataAccepts(): iterable
176178
#[DataProvider('dataAccepts')]
177179
public function testAccepts(Type $stringType, Type $otherType, TrinaryLogic $expectedResult): void
178180
{
181+
$this->assertInstanceOf(StringType::class, $stringType);
182+
179183
$actualResult = $stringType->accepts($otherType, true)->result;
180184
$this->assertSame(
181185
$expectedResult->describe(),

tests/PHPStan/Type/UnionTypeTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public static function dataIsCallable(): array
7979
#[DataProvider('dataIsCallable')]
8080
public function testIsCallable(Type $unionType, TrinaryLogic $expectedResult): void
8181
{
82+
$this->assertInstanceOf(UnionType::class, $unionType);
83+
8284
$actualResult = $unionType->isCallable();
8385
$this->assertSame(
8486
$expectedResult->describe(),
@@ -701,6 +703,8 @@ public static function dataIsScalar(): array
701703
#[DataProvider('dataIsScalar')]
702704
public function testIsScalar(Type $unionType, TrinaryLogic $expectedResult): void
703705
{
706+
$this->assertInstanceOf(UnionType::class, $unionType);
707+
704708
$actualResult = $unionType->isScalar();
705709
$this->assertSame(
706710
$expectedResult->describe(),

0 commit comments

Comments
 (0)