PHP Package: php-mock/php-mock-phpunit
PHP library for mocking PHP functions in PHPUnit tests using PHP-Mock library
Package Description
php-mock-phpunit is a powerful PHP library that allows developers to mock PHP functions in PHPUnit tests effortlessly. With this library, you can easily simulate function behaviors, enabling efficient testing of complex PHP applications. It seamlessly integrates with PHPUnit, offering a seamless experience for developers in creating robust and reliable test suites. Whether you're working on legacy code or modern PHP projects, php-mock-phpunit is an indispensable tool for ensuring code quality and reliability.
Download Latest Version: 2.13.1

Previous Versions
v2.12.0
v2.13.0 - Coming soon
Code Integration Example
Make sure to include the correct namespace and class paths for proper usage.
<?php
// Example from PHPlibraries.com
require_once 'libs/php-mock/php-mock-phpunit/2.13.1/loader.php';
require_once 'libs/php-mock/php-mock/{lib_version}/loader.php';
use PhpMock\Mock;
use PhpMock\MockBuilder;
$obj = new Mock();
echo '✅ Test OK: ' . get_class($obj);
?>
We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.
Community Discussion
Ask questions, share tips, or report issues below.