{"id":88933,"library":"php-mock-php-mock-mockery","title":"PHP-Mock Mockery","description":"Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.","status":"active","version":"1.5.0","language":"php","source_language":null,"source_url":"https://github.com/php-mock/php-mock-mockery","tags":["testing","mock","php-mock","mockery","unit-testing"],"install":[{"cmd":"composer require php-mock/php-mock-mockery","lang":"bash","label":"composer require"}],"dependencies":[],"imports":[{"symbol":"PHPMockery","correct":"use phpmock\\mockery\\PHPMockery;"}],"quickstart":{"code":"use phpmock\\mockery\\PHPMockery;\n\nPHPMockery::mock('MyNamespace', 'time')->andReturn(12345);\necho time(); // outputs 12345","lang":"php","description":"Mock the time() function in a specific namespace."},"warnings":[{"fix":"Ensure the code under test uses a namespace.","message":"Only works in namespaced code; does not affect global functions.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'built':7 'built-in':6 'e.g':11 'extens':26 'fallback':22 'function':10 'mock':3,5,30,33 'mockeri':4,14,34 'namespac':21 'need':28 'packag':16 'php':2,9,19,32 'php-mock':1,31 'polici':23 'reli':17 'test':29,37 'time':12 'unit':36 'unit-test':35","created_at":"2026-06-19T08:39:51.673104+00:00","updated_at":"2026-06-19T08:39:51.673104+00:00","problems":[],"ecosystem":"packagist","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/php-mock/php-mock-mockery","github":"https://github.com/php-mock/php-mock-mockery","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-19","next_check":"2026-12-16","install_tag":null}}