How To Install php-mock2 on Fedora 36

In this tutorial we learn how to install php-mock2 in Fedora 36. php-mock2 is PHP-Mock can mock built-in PHP functions

Introduction

In this tutorial we learn how to install php-mock2 on Fedora 36.

What is php-mock2

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP’s namespace fallback policy. No further extension is needed. Autoloader

We can use yum or dnf to install php-mock2 on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install php-mock2.

Install php-mock2 on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install php-mock2 using dnf by running the following command:

sudo dnf -y install php-mock2

Install php-mock2 on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install php-mock2 using yum by running the following command:

sudo yum -y install php-mock2

How To Uninstall php-mock2 on Fedora 36

To uninstall only the php-mock2 package we can use the following command:

sudo dnf remove php-mock2

php-mock2 Package Contents on Fedora 36

/usr/share/doc/php-mock2
/usr/share/doc/php-mock2/README.md
/usr/share/doc/php-mock2/composer.json
/usr/share/licenses/php-mock2
/usr/share/licenses/php-mock2/LICENSE
/usr/share/php/phpmock2
/usr/share/php/phpmock2/Deactivatable.php
/usr/share/php/phpmock2/Mock.php
/usr/share/php/phpmock2/MockBuilder.php
/usr/share/php/phpmock2/MockEnabledException.php
/usr/share/php/phpmock2/MockRegistry.php
/usr/share/php/phpmock2/autoload.php
/usr/share/php/phpmock2/environment
/usr/share/php/phpmock2/environment/MockEnvironment.php
/usr/share/php/phpmock2/environment/SleepEnvironmentBuilder.php
/usr/share/php/phpmock2/functions
/usr/share/php/phpmock2/functions/AbstractSleepFunction.php
/usr/share/php/phpmock2/functions/FixedDateFunction.php
/usr/share/php/phpmock2/functions/FixedMicrotimeFunction.php
/usr/share/php/phpmock2/functions/FixedValueFunction.php
/usr/share/php/phpmock2/functions/FunctionProvider.php
/usr/share/php/phpmock2/functions/Incrementable.php
/usr/share/php/phpmock2/functions/MicrotimeConverter.php
/usr/share/php/phpmock2/functions/SleepFunction.php
/usr/share/php/phpmock2/functions/UsleepFunction.php
/usr/share/php/phpmock2/generator
/usr/share/php/phpmock2/generator/MockFunctionGenerator.php
/usr/share/php/phpmock2/generator/ParameterBuilder.php
/usr/share/php/phpmock2/generator/function.tpl
/usr/share/php/phpmock2/spy
/usr/share/php/phpmock2/spy/Invocation.php
/usr/share/php/phpmock2/spy/Spy.php
/usr/share/tests/phpmock2
/usr/share/tests/phpmock2/AbstractMockTest.php
/usr/share/tests/phpmock2/ExampleTest.php
/usr/share/tests/phpmock2/MockBuilderTest.php
/usr/share/tests/phpmock2/MockCaseInsensitivityTest.php
/usr/share/tests/phpmock2/MockDefiningOrderTest.php
/usr/share/tests/phpmock2/MockNamespaceTest.php
/usr/share/tests/phpmock2/MockTest.php
/usr/share/tests/phpmock2/TestCaseNoTypeHintTrait.php
/usr/share/tests/phpmock2/TestCaseTypeHintTrait.php
/usr/share/tests/phpmock2/autoload.php
/usr/share/tests/phpmock2/environment
/usr/share/tests/phpmock2/environment/MockEnvironmentTest.php
/usr/share/tests/phpmock2/environment/SleepEnvironmentBuilderTest.php
/usr/share/tests/phpmock2/functions
/usr/share/tests/phpmock2/functions/AbstractSleepFunctionTest.php
/usr/share/tests/phpmock2/functions/FixedDateFunctionTest.php
/usr/share/tests/phpmock2/functions/FixedMicrotimeFunctionTest.php
/usr/share/tests/phpmock2/functions/IncrementableTest.php
/usr/share/tests/phpmock2/functions/MicrotimeConverterTest.php
/usr/share/tests/phpmock2/generator
/usr/share/tests/phpmock2/generator/MockFunctionGeneratorTest.php
/usr/share/tests/phpmock2/generator/ParameterBuilderTest.php
/usr/share/tests/phpmock2/spy
/usr/share/tests/phpmock2/spy/SpyTest.php

References

Summary

In this tutorial we learn how to install php-mock2 on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).