Hamcrest is a matching library originally written for Java, but subsequently ported to many other languages. hamcrest-php is the 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. Unless it would be non-semantic for a matcher to do so, hamcrest-php allows dynamic typing for it's input, in "the PHP way". Exception are where semantics surrounding the type itself would suggest otherwise, such as stringContains() and greaterThan(). Several matchers have not been ported because they don't make sense or don't apply in PHP. When most of the collections matchers are finally ported, PHP-specific aliases will probably be created due to a difference in naming conventions between Java's Arrays, Collections, Sets and Maps compared with PHP's Arrays.

Features

  • Hamcrest matchers are easy to use
  • You can use the global proxy-functions
  • The global proxy-functions aren't autoloaded by default
  • A tutorial can be found on the Hamcrest site
  • Evaluate arrays

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

BSD License

Follow Hamcrest PHP

Hamcrest PHP Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Hamcrest PHP!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Libraries

Registered

2021-08-20