Skip to content

Commit 0987f26

Browse files
[PhpUnitBridge] Fix enum_exists mock tests
1 parent b30d276 commit 0987f26

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/EnumExistsMockTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class EnumExistsMockTest extends TestCase
2323
{
2424
public static function setUpBeforeClass(): void
2525
{
26+
// Require the fixture file to allow PHP to be fully aware of the enum existence
27+
require __DIR__.'/Fixtures/ExistingEnumReal.php';
28+
2629
ClassExistsMock::register(__CLASS__);
2730
}
2831

@@ -34,6 +37,11 @@ protected function setUp(): void
3437
]);
3538
}
3639

40+
public static function tearDownAfterClass(): void
41+
{
42+
ClassExistsMock::withMockedEnums([]);
43+
}
44+
3745
public function testClassExists()
3846
{
3947
$this->assertFalse(class_exists(ExistingEnum::class));

0 commit comments

Comments
 (0)