estahn / guzzle-stereo-bundle
Record and Replay HTTP Responses easily in Symfony
Installs: 2 244
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 2
Type:symfony-bundle
Requires
- php: >=5.6.0
- ikwattro/guzzle-stereo: ~1.2
- symfony/config: ~2.3|~3.0
- symfony/dependency-injection: ~2.3|~3.0
- symfony/http-kernel: ~2.3|~3.0
Requires (Dev)
- codacy/coverage: dev-master
- phpunit/phpunit: ^5.2
This package is not auto-updated.
Last update: 2024-10-26 19:27:00 UTC
README
The GuzzleStereoBundle
provides integration of the guzzle-stereo library into the Symfony2 framework.
Features include:
- Automatic recording of all outgoing requests through Guzzle
- Replay recorded requests in functional tests
- Copy & paste of file with last recorded requests
GuzzleStereoBundle
automatically hooks guzzle-stereo
into Guzzle which then records all requests made through Guzzle.
The goal is to reduce the effort to create mocks for external requests.
Installation
-
Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require estahn/guzzle-stereo-bundle --dev
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
-
Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in the
app/AppKernel.php
file of your project:<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new EnricoStahn\Bundle\GuzzleStereoBundle\GuzzleStereoBundle(), ); // ... } // ... }
-
Enable the service by adding the following empty configuration:
# app/config/config_test.yml guzzle_stereo: ~
Usage
Refresh your page and find the created file in app/logs/record_<tape name>.json
.