Download the PHP package dbt/client-fake without Composer

On this page you can find all versions of the php package dbt/client-fake. 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 client-fake

Client Fake for Laravel

This package provides an easy way to fake HTTP calls for services that requires Laravel's HTTP Client in testing contexts. If you're using the HTTP Facade, this package isn't for you.

Simply extend or directly construct the ClientFake, register your fakes, then commit or invoke the result. When your service resolves the HTTP Client from the container, it will be resolved with the fakes applied only to that instance of the HTTP Client.

For instance if you have FooService and BarService, if you register a fake for BarService, the fake only be applied to that service, and not to any others.

This is useful when you have one service that you want to fake, but not others.

Installation

You can install the package via composer:

Usage

You can use the ClientFake class directly, or extend it and define method fakes of your own.

If you want to use the ClientFake directly, you can do so like this (for example, in the body of your test):

Then you can resolve your service and use it as normal:

Catchall

By default, a catchall is added, which will return a 500 response for any endpoint that isn't faked. You can disable this:

Conditionally Enabling

You can conditionally enable and disable the fake by using the enable method:

You can optionally add a callback that will be resolved from the container and executed when the boolean condition is false:

Options

You can use the ClientFakeOptions object as-is, or define your own by implementing the ClientFakeOptionsInterface.

Etc.

Please see CONTRIBUTING for details. The MIT License (MIT). Please see License File for more information.


All versions of client-fake with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
fakerphp/faker Version ^1.21
illuminate/http Version ^8.0|^9.0|^10.0
guzzlehttp/guzzle Version ^7.2
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 dbt/client-fake contains the following files

Loading the files please wait ....