tj09 / test-utils
Mocking utils for test cases.
2.2.0
2025-06-08 09:31 UTC
Requires
- php: >=8
- phpunit/phpunit: ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- mikey179/vfsstream: ^1.6.0
README
Some common test utils used across projects. Likely not useful outside of projects that happen to use them.
Includes:
- MockFunctions A wrapper around
uopz
to make it easy-ish to stub out functions in tests. - BaseTestCase Test case class that will clear mocks and APC after each test.
- TestPDO Allows copying an existing database's schema into temporary tables in another database, presenting a clean slate for tests.
- TestWithSnapshots Provides assertions for tests to assert that some data matches a previously-recorded state.