Download the PHP package exan/moock without Composer

On this page you can find all versions of the php package exan/moock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package moock

Moock


A simple way of mocking objects in PHP

Installation

About

Moock is a package to abstract creating test dummies for objects, intended to be used in unit tests. Using test dummies allows you to write more specific tests, where you don't have to worry about a class's dependencies. This works best when using the Dependency Injection pattern.

Check out the docs here!

Sales pitch

If you're looking into this library, there's a good chance you already know of some other mocking library. (If not, see the new to mocking introduction) For Moock, the goal is to rely on PHP language tricks as much as possible for the syntax.

Take for example the mocking of methods:

This makes it so IDE's don't (or shouldn't) need specific extensions to get nice auto-complete, or to support refactoring method names.

If you go ahead and rename someMethod on MyClass, your IDE will properly recognize it in your creation of mocks, and thus also rename it there.

Compare this to a fictional example:

To get an IDE to automatically refactor someMethod, your IDE needs to be aware of PHP's syntax rules and the syntax of the package. Rather than only needing to know PHP syntax.

This can be achieved by having extensions specific to your IDE & mocking library of choice, of course. Relying on these specific types of extensions however, is not my personal preference.

Conscious omissions

There are some features you may take for granted in other libraries, including but not limited to:

These are (opinionated) conscious omissions. These features can lead you down a path of hard to maintain tests, or tests which don't meaningfully test your application.

If you are missing a feature, please consider the above. If you don't think it applies, please create an issue with your request.


All versions of moock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package exan/moock contains the following files

Loading the files please wait ...