How To Install php-hamcrest on Fedora 36

In this tutorial we learn how to install php-hamcrest in Fedora 36. php-hamcrest is PHP port of Hamcrest Matchers

Introduction

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

What is php-hamcrest

Hamcrest is a matching library originally written for Java, but subsequently ported to many other languages. php-hamcrest is the official PHP port of Hamcrest and essentially follows a literal translation of the original Java API for Hamcrest, with a few Exceptions, mostly down to PHP language barriers. To use this library, you just have to add, in your project require_once ‘/usr/share/php/Hamcrest/autoload.php’;

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

Install php-hamcrest 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-hamcrest using dnf by running the following command:

sudo dnf -y install php-hamcrest

Install php-hamcrest 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-hamcrest using yum by running the following command:

sudo yum -y install php-hamcrest

How To Uninstall php-hamcrest on Fedora 36

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

sudo dnf remove php-hamcrest

php-hamcrest Package Contents on Fedora 36

/usr/share/doc/php-hamcrest
/usr/share/doc/php-hamcrest/CHANGES.txt
/usr/share/doc/php-hamcrest/README.md
/usr/share/doc/php-hamcrest/TODO.txt
/usr/share/doc/php-hamcrest/composer.json
/usr/share/licenses/php-hamcrest
/usr/share/licenses/php-hamcrest/LICENSE.txt
/usr/share/php/Hamcrest
/usr/share/php/Hamcrest/Arrays
/usr/share/php/Hamcrest/Arrays/IsArray.php
/usr/share/php/Hamcrest/Arrays/IsArrayContaining.php
/usr/share/php/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php
/usr/share/php/Hamcrest/Arrays/IsArrayContainingInOrder.php
/usr/share/php/Hamcrest/Arrays/IsArrayContainingKey.php
/usr/share/php/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php
/usr/share/php/Hamcrest/Arrays/IsArrayWithSize.php
/usr/share/php/Hamcrest/Arrays/MatchingOnce.php
/usr/share/php/Hamcrest/Arrays/SeriesMatchingOnce.php
/usr/share/php/Hamcrest/AssertionError.php
/usr/share/php/Hamcrest/BaseDescription.php
/usr/share/php/Hamcrest/BaseMatcher.php
/usr/share/php/Hamcrest/Collection
/usr/share/php/Hamcrest/Collection/IsEmptyTraversable.php
/usr/share/php/Hamcrest/Collection/IsTraversableWithSize.php
/usr/share/php/Hamcrest/Core
/usr/share/php/Hamcrest/Core/AllOf.php
/usr/share/php/Hamcrest/Core/AnyOf.php
/usr/share/php/Hamcrest/Core/CombinableMatcher.php
/usr/share/php/Hamcrest/Core/DescribedAs.php
/usr/share/php/Hamcrest/Core/Every.php
/usr/share/php/Hamcrest/Core/HasToString.php
/usr/share/php/Hamcrest/Core/Is.php
/usr/share/php/Hamcrest/Core/IsAnything.php
/usr/share/php/Hamcrest/Core/IsCollectionContaining.php
/usr/share/php/Hamcrest/Core/IsEqual.php
/usr/share/php/Hamcrest/Core/IsIdentical.php
/usr/share/php/Hamcrest/Core/IsInstanceOf.php
/usr/share/php/Hamcrest/Core/IsNot.php
/usr/share/php/Hamcrest/Core/IsNull.php
/usr/share/php/Hamcrest/Core/IsSame.php
/usr/share/php/Hamcrest/Core/IsTypeOf.php
/usr/share/php/Hamcrest/Core/Set.php
/usr/share/php/Hamcrest/Core/ShortcutCombination.php
/usr/share/php/Hamcrest/Description.php
/usr/share/php/Hamcrest/DiagnosingMatcher.php
/usr/share/php/Hamcrest/FeatureMatcher.php
/usr/share/php/Hamcrest/Hamcrest.php
/usr/share/php/Hamcrest/Internal
/usr/share/php/Hamcrest/Internal/SelfDescribingValue.php
/usr/share/php/Hamcrest/Matcher.php
/usr/share/php/Hamcrest/MatcherAssert.php
/usr/share/php/Hamcrest/Matchers.php
/usr/share/php/Hamcrest/NullDescription.php
/usr/share/php/Hamcrest/Number
/usr/share/php/Hamcrest/Number/IsCloseTo.php
/usr/share/php/Hamcrest/Number/OrderingComparison.php
/usr/share/php/Hamcrest/SelfDescribing.php
/usr/share/php/Hamcrest/StringDescription.php
/usr/share/php/Hamcrest/Text
/usr/share/php/Hamcrest/Text/IsEmptyString.php
/usr/share/php/Hamcrest/Text/IsEqualIgnoringCase.php
/usr/share/php/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php
/usr/share/php/Hamcrest/Text/MatchesPattern.php
/usr/share/php/Hamcrest/Text/StringContains.php
/usr/share/php/Hamcrest/Text/StringContainsIgnoringCase.php
/usr/share/php/Hamcrest/Text/StringContainsInOrder.php
/usr/share/php/Hamcrest/Text/StringEndsWith.php
/usr/share/php/Hamcrest/Text/StringStartsWith.php
/usr/share/php/Hamcrest/Text/SubstringMatcher.php
/usr/share/php/Hamcrest/Type
/usr/share/php/Hamcrest/Type/IsArray.php
/usr/share/php/Hamcrest/Type/IsBoolean.php
/usr/share/php/Hamcrest/Type/IsCallable.php
/usr/share/php/Hamcrest/Type/IsDouble.php
/usr/share/php/Hamcrest/Type/IsInteger.php
/usr/share/php/Hamcrest/Type/IsNumeric.php
/usr/share/php/Hamcrest/Type/IsObject.php
/usr/share/php/Hamcrest/Type/IsResource.php
/usr/share/php/Hamcrest/Type/IsScalar.php
/usr/share/php/Hamcrest/Type/IsString.php
/usr/share/php/Hamcrest/TypeSafeDiagnosingMatcher.php
/usr/share/php/Hamcrest/TypeSafeMatcher.php
/usr/share/php/Hamcrest/Util.php
/usr/share/php/Hamcrest/Xml
/usr/share/php/Hamcrest/Xml/HasXPath.php
/usr/share/php/Hamcrest/autoload.php

References

Summary

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