Download the PHP package oscarotero/psr7-unitesting without Composer

On this page you can find all versions of the php package oscarotero/psr7-unitesting. 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 psr7-unitesting

psr7-unitesting

Scrutinizer Code Quality Build Status

Simple library to execute unit tests in psr-7 compatible http messages.

It uses symfony/dom-crawler and symfony/css-selector library to parse and test the html in the body. And Guzzle as http client

This package provides a binary java file with the w3c vnu validator (to validate html) but you can use the REST api (slower) if you don't have (or don't want to have) java installed.

Usage example:

Available assertions:

Message

method description
hasHeader Asserts that a header exists
hasNotHeader Asserts that a header does not exists
header Asserts that a header has a specific value
protocolVersion Asserts the protocol version of the message
body Asserts the body content (as string)
assertBody Returns a Stream assertion instance

Request

Extends Message with the following additions:

method description
method Asserts the method value
requestTarget Asserts the request target value
uri Asserts the uri value (as string)
assertUri Returns a Uri assertion instance

ServerRequest

Extends Request with the following additions:

method description
hasServerParam Asserts that a server param exists
serverParam Asserts a server param value
hasCookieParam Asserts that a cookie param exists
cookieParam Asserts a cookie param value
hasQueryParam Asserts that a query param exists
queryParam Asserts a query param value
hasUploadedFile Asserts that an uploaded file exists
hasParsedBody Asserts that a param exists in the parsed body
parsedBody Asserts a value in the parsed body
hasAttribute Asserts that an attribute exists
attribute Asserts an attribute value

Response

Extends Message with the following additions:

method description
statusCode Asserts the status code value
reasonPhrase Asserts the reason pharase value
assertHtml Returns a Html assertion instance

Uri

method description
scheme Asserts the scheme value
authority Asserts the authority value
userInfo Asserts the user info value
host Asserts the host value
port Asserts the port value
path Asserts the path value
query Asserts the query value
fragment Asserts the fragment value

Stream

method description
size Asserts the stream size
isSeekable Asserts that the stream is seekable
isNotSeekable Asserts that the stream is not seekable
isWritable Asserts that the stream is writable
isNotWritable Asserts that the stream is not writable
isReadable Asserts that the stream is readable
isNotReadable Asserts that the stream is not readable
assertHtml Returns a Html assertion instance

Html

method description
count Asserts the number of elements matching with the selector
has Asserts there is at least one element matching with the selector
hasNot Asserts there is not any element matching with the selector
contains Asserts there is at least one element matching with the selector containing the text
notContains Asserts there is not any element matching with the selector and containing the text
isValid Asserts the html value is w3c standard
map Execute a callback for each element selected

All versions of psr7-unitesting with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
phpunit/phpunit Version *
psr/http-message Version ^1.0
symfony/dom-crawler Version ~3.0
symfony/css-selector Version ~3.0
guzzlehttp/guzzle Version ~6.2
symfony/process Version ~3.0
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 oscarotero/psr7-unitesting contains the following files

Loading the files please wait ....