Download the PHP package voral/mock-builder without Composer

On this page you can find all versions of the php package voral/mock-builder. 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 mock-builder

Utility for Generating Class Mocks

RU

Description

This utility is designed to automatically generate "mock" shells of classes from PHP source code. It allows you to:

This tool is particularly useful for testing complex systems where:

After processing the classes, you can add a special trait to the generated mocks to control their behavior during testing. For more details on how to use this trait, see the section Testing with the MockTools Trait.


Installation


Usage

Via Command Line

You can run the utility using the following command:

Available Options:

Examples:

Via Configuration File

You can create a configuration file .vs-mock-builder.php in the root of your project. An example of the file's content and a description of all available parameters can be found in the section Configuration File.

If a configuration file exists, its values are used as default parameters. However, parameters passed via the command line take precedence.


Features

  1. Processing Interfaces, Classes, and Traits:

    • The utility supports processing classes, interfaces, and traits.
    • A separate file is created in the target directory for each class or interface.
  2. Class Filtering:

    • You can specify a list of substrings to filter class names.
    • If no filter is specified, all classes are processed.
  3. PSR-4 Compliance:

    • Transformed files are saved in a directory structure corresponding to the class namespace.
  4. Method Cleanup:

    • All public methods remain in the class, but their bodies are cleared (content is removed).
  5. Customization via Visitors:
    • You can customize the AST processing using visitors. For more details on built-in and custom visitors, see the section Visitors.

Requirements


License

The project is distributed under the MIT license. For details, see the LICENSE file.


Additional Information


Frequently Asked Questions (FAQ)

  1. What to Do with Classes in the Global Namespace?
  2. How to Create Mocks for Functions in the Global Scope?

Changes

The change history can be found in the CHANGELOG.md file.

Todo


All versions of mock-builder with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
nikic/php-parser Version ^5.4
phpdocumentor/reflection-docblock Version ^5.6
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 voral/mock-builder contains the following files

Loading the files please wait ....