Skip to content

Commit d8a720d

Browse files
kubawerlossebastianbergmann
authored andcommitted
Add test showing current behaviour when createStubForIntersectionOfInterfaces is called with a class
1 parent 7d63da7 commit d8a720d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/unit/Framework/MockObject/Creation/CreateStubForIntersectionOfInterfacesTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use PHPUnit\TestFixture\MockObject\AnInterface;
1919
use PHPUnit\TestFixture\MockObject\AnotherInterface;
2020
use PHPUnit\TestFixture\MockObject\AnotherInterfaceThatDoesSomething;
21+
use PHPUnit\TestFixture\MockObject\ExtendableClass;
2122

2223
#[Group('test-doubles')]
2324
#[Group('test-doubles/creation')]
@@ -71,4 +72,12 @@ public function testCannotCreateTestStubForIntersectionOfInterfacesThatDeclareTh
7172

7273
$this->createStubForIntersectionOfInterfaces([AnInterface::class, AnotherInterfaceThatDoesSomething::class]);
7374
}
75+
76+
public function testCannotCreateTestStubForIntersectionOfInterfacesWhenClassIsUsed(): void
77+
{
78+
$this->expectException(UnknownTypeException::class);
79+
$this->expectExceptionMessage('Class or interface "PHPUnit\TestFixture\MockObject\ExtendableClass" does not exist');
80+
81+
$this->createStubForIntersectionOfInterfaces([AnInterface::class, ExtendableClass::class]);
82+
}
7483
}

0 commit comments

Comments
 (0)