PHP Package: 10up/wp_mock
A powerful PHP library for mocking WordPress objects in unit tests efficiently and effectively.
Package Description
WP Mock is a feature-rich PHP library designed to streamline the process of mocking WordPress objects in unit tests. It provides a comprehensive set of tools and functionalities to create robust and reliable test cases for WordPress plugins and themes, ensuring optimal performance and accuracy throughout the testing process.
Code Integration Example
Make sure to include the correct namespace and class paths for proper usage.
<?php
// Example from PHPlibraries.com
require_once 'libs/10up/wp_mock/lib_version/autoload.php';
use WP_Mock\MockeryAdapter;
use WP_Mock\PHPUnitAdapter;
use WP_Mock\Functions;
use WP_Mock\Hooks;
use WP_Mock\PostType;
use WP_Mock\User;
$obj = new WP_Mock\MockeryAdapter();
echo "✅ Example created successfully.";
?>
We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.