PHP Package: 10up/wp_mock

A powerful PHP library for mocking WordPress objects in unit tests efficiently and effectively.

Current Version:
Last Updated:
PHP Requirement: >=7.1
Dependencies: phpunit/phpunit, johnpbloch/wordpress-core
⚠️ To ensure full functionality, the above dependencies might be required.

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.

🔗 View on GitHub

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.