PHP Package: mockery/mockery

Mockery is a PHP library for efficiently creating mock objects in unit tests, enhancing code coverage and simplifying testing workflows.

Current Version: 1.6.12
Last Updated: 2024-05-16
PHP Requirement: >=7.3
Dependencies:
phpunit/phpunit
symfony/yaml
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

Mockery is a powerful PHP library used for generating test doubles in unit testing. It provides an intuitive and flexible API for creating mock objects, spies, and stubs. Mockery is widely adopted in the PHP community for its ease of use and robust features, making it an essential tool for writing effective unit tests.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 1.6.12

Download Download v1.6.12

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/mockery/mockery/1.6.12/loader.php';
require_once 'libs/sebastianbergmann/phpunit/12.2.2/loader.php';
require_once 'libs/symfony/yaml/7.3.0/loader.php';

use Mockery\Mock;
use PHPUnit\Framework\TestCase;

$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.