.. _extensions-extuopz: .. _ext-uopz: ext/uopz ++++++++ Extension UOPZ : User Operations for Zend. The uopz extension is focused on providing utilities to aid with unit testing PHP code. It supports the following activities: Intercepting function execution, Intercepting object creation, Hooking into function execution, Manipulation of function statics, Manipulation of function flags, Redefinition of constants, Deletion of constants, Runtime creation of functions and methods, .. code-block:: php bar(1)); uopz_set_return(Foo::class, 'bar', function(int $arg) : int { return $arg * 2; }, true); var_dump($foo->bar(2)); try { uopz_set_return(Foo::class, 'nope', 1); } catch(Throwable $t) { var_dump($t->getMessage()); } class Bar extends Foo {} try { uopz_set_return(Bar::class, 'bar', null); } catch (Throwable $t) { var_dump($t->getMessage()); } uopz_set_something(Bar::class, 'bar', null); ?> See also `ext/uopz `_ and `User Operations for Zend `_. Specs _____ +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Extensions/Extuopz | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Appinfo `, :ref:`CE `, :ref:`Changed Behavior ` | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.1.7 | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Community Edition `_, `Exakat Cloud `_ | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+