Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 002d4fc

Browse files
[PhpUnitBridge] Add enum_exists mock
1 parent a93dae9 commit 002d4fc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/phpunit_bridge.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ reason, this component also provides mocks for these PHP functions:
736736
* :phpfunction:`class_exists`
737737
* :phpfunction:`interface_exists`
738738
* :phpfunction:`trait_exists`
739+
* :phpfunction:`enum_exists` (requires PHP 8.1)
739740

740741
Use Case
741742
~~~~~~~~
@@ -798,6 +799,13 @@ classes, interfaces and/or traits for the code to run::
798799
}
799800
}
800801

802+
Note that mocking a class with ``ClassExistsMock::withMockedClasses()``
803+
will make :phpfunction:`class_exists`, :phpfunction:`interface_exists`
804+
and :phpfunction:`trait_exists` return true.
805+
806+
To register an enumeration and mock :phpfunction:`enum_exists`,
807+
``ClassExistsMock::withMockedEnums()`` must be used.
808+
801809
Troubleshooting
802810
---------------
803811

0 commit comments

Comments
 (0)