Download the PHP package dbeurive/slim-requester without Composer
On this page you can find all versions of the php package dbeurive/slim-requester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dbeurive/slim-requester
More information about dbeurive/slim-requester
Files in dbeurive/slim-requester
Package slim-requester
Short Description This package contains a tool that allows you to perform requests to your Slim application by bypassing the WEB server.
License Creative Commons Attribution 4.0 International Public License
Informations about the package slim-requester
- Introduction
- License
- Installation
- Synopsis
- API
- Examples
Introduction
This package contains a "requester" the Slim framework.
The requester allows you to perform requests over your Slim application without the need for a WEB server. This is particularly useful when you want to automate unit tests. Indeed, while you are unit-testing your application's logic, you don't want to test the WEB server's configuration.
Please note that this package is a work in progress, since new features will be added.
License
This code is published under the following license:
Creative Commons Attribution 4.0 International Public License
See the file LICENSE.TXT
Installation
From the command line:
composer require dbeurive/slim-requester
Or, from within the file composer.json
:
"require": {
"dbeurive/slim-requester": "*"
}
Synopsis
Create a the Slim application:
API
\dbeurive\Slim\Requester::__construct(App $inApplication)
\dbeurive\Slim\Requester::get($inRequestUri, $inQueryString='')
\dbeurive\Slim\Requester::post($inRequestUri, $inPostParameters=[])
\dbeurive\Slim\Requester::jsonRpc($inRequestUri, $inParameters=[])
\dbeurive\Slim\Requester::setServerCgiEnvironmentVariables(array $inServerCgiEnvironmentVariables, $inMerge=false)
\dbeurive\Slim\Requester::setHttpHeaders(array $inHttpHeaders, $inMerge=false)
\dbeurive\Slim\Requester::getResponse()
\dbeurive\Slim\Requester::getRequest()
Please see the file Requester.php for a detailed description of the API.
Examples
Please see the unit tests for examples.
The file below creates the application:
- index.php: this file is the application's entry point.
The three files below implement unit tests:
- AppInit.php: this file creates the application and initializes the requester.
- GetTest.php
- JsonRpcTest.php
- PostTest.php