Registry / testing / php-mock-php-mock-mockery

php-mock-php-mock-mockery

JSON →
library1.5.0phppackagistunverified

Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.

composer require php-mock/php-mock-mockery
INSTALL
IMPORT
SIG · PHP-MOCK-PHP-MOCK-
P
php-mock-php-mock-mockery
testingphpv1.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PHPMockery
✓ use phpmock\mockery\PHPMockery;

Mock the time() function in a specific namespace.

use phpmock\mockery\PHPMockery; PHPMockery::mock('MyNamespace', 'time')->andReturn(12345); echo time(); // outputs 12345
Debug
Known issues
gotchaOnly works in namespaced code; does not affect global functions.
fix
Ensure the code under test uses a namespace.
affects: *
Upgrade
Version history
1.5.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources