PHPackages                             lancerhe/phpunit-mock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. lancerhe/phpunit-mock

ActiveLibrary[Testing &amp; Quality](/categories/testing)

lancerhe/phpunit-mock
=====================

PHPUnit extension to Mock PHP internal functions using Runkit.

1.1.1(8y ago)216.9k3[1 PRs](https://github.com/lancerhe/phpunit-mock/pulls)1MITPHP

Since Apr 22Pushed 8y agoCompare

[ Source](https://github.com/lancerhe/phpunit-mock)[ Packagist](https://packagist.org/packages/lancerhe/phpunit-mock)[ RSS](/packages/lancerhe-phpunit-mock/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (5)Used By (1)

PHPUnit Mock Function
=====================

[](#phpunit-mock-function)

PHPUnit extension to Mock PHP internal functions using Runkit.

Requirements
------------

[](#requirements)

- [Runkit](https://github.com/zenovich/runkit)
- [Test Helpers\*](https://github.com/sebastianbergmann/php-test-helpers/blob/master/test_helpers.c)

\*This is an optional requirement. Runkit doesn't currently support the override of internal functions (exit, die etc).

Installation
------------

[](#installation)

Using composer, add the following to the composer.json file:

```
{
   "require": {
       "lancerhe/phpunit-mock": "dev-master"
   }
}

```

Function Example
----------------

[](#function-example)

`ExampleClass.php`

```
