Download the PHP package dxw/codeception-notify-module without Composer

On this page you can find all versions of the php package dxw/codeception-notify-module. 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 codeception-notify-module

codeception-notify-module

A Codeception module that extends phiremock-codeception-extension for testing applications that call GOV.UK Notify.

The Phiremock extension is loaded as a Composer dependency, so does not need to be installed separately.

Installation

How to use

Currently the module only tests requests to the Notify email endpoint.

Setup

Configure the Phiremock extension in your codeception.yml to start the Phiremock server. You'll need to modify your Notify config so it hits this mock server when in the testing environment.

Then enable the Notify module in your suite's configuration file, and configure it so it knows how to talk to the mock server:

Use

The standard methods defined by the Phiremock module are all available. On top of these, there are some Notify-specific ones:

expectEmailRequestWithSuccessResponse

Allows you to specify that a request to the email endpoint should receive a 200 response. (It's important to note that the test won't fail if this request is not made - this just tells the mock server what response to supply if it is).

You can also specify what the response body should be (in JSON format):

expectEmailRequestWithFailureResponse

Allows you to specify that a request to the email endpoint should receive a 401 response. You can use this if you're handling all failure responses in the same way.

You can also specify the error code and body that should be returned, e.g.

Note that the body must be in the format expected by the AlphaGov\Notifications\Exception\ApiException class otherwise the Notify client will error.

getRecipientEmailAddresses

Returns a chronological array of all email addresses that emails have been sent to.

seeLastEmailWasSentTo

Verifies if the last request was sent to the email address you provide.

seeNotifyReceivedEmailRequests

Verifies how any email requests have been sent to Notify.

Development

Install the dependencies:

Run the tests:

Run the linter:


All versions of codeception-notify-module with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
mcustiel/phiremock-codeception-extension Version ^1.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 dxw/codeception-notify-module contains the following files

Loading the files please wait ....