Download the PHP package nathanmac/im-codeception-module without Composer
On this page you can find all versions of the php package nathanmac/im-codeception-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nathanmac/im-codeception-module
More information about nathanmac/im-codeception-module
Files in nathanmac/im-codeception-module
Package im-codeception-module
Short Description Test messaging services in your Codeception acceptance tests
License MIT
Informations about the package im-codeception-module
Codeception Instant Messaging (IM) Module
This module will let you test messages that are sent during your Codeception acceptance tests.
Installation
Begin by installing this package through Composer. Edit your project's composer.json
file to require nathanmac/im-codeception-module
.
{
"require-dev": {
"codeception/codeception": "*",
"nathanmac/im-codeception-module": "~1.0"
}
}
Next, update Composer from the Terminal:
composer update
Then enable it in your suite configuration with the following settings
Configuration
The configuration settings depending on which queueing service is being used, all the options are listed here. Refer to the configuration examples below to identify the configuration options required for your chosen service.
- service - the messaging service.
- token - API token and/or Access Token.
- room - The room/channel id for the messaging service.
N.B. The API key for HipChat must be an users API token in order to provide sufficient access the last messages in a given room, however if you are just looking to send a messages to the service a room API token will be sufficient to send the message. Consult the HipChat API documentation for clarification on this topic.
Examples
Example Configuration (hipchat)
modules:
enabled: [IM]
config:
IM:
service: 'hipchat'
token: API_TOKEN
room: ROOM_ID
Example Usage
Actions
sendInstantMessage
Simple method for sending a messages to an messaging service.
- Param string $message Message to be sent.
- Param array $options Depends on service, for HipChat these include the color and the notify option.
grabLastInstantMessage
Grabber method to return the last messages on the service.
grabLastInstantMessageFrom
Grabber method to return the from field of the last message.
seeInLastInstantMessageFrom
Checks whether the last messages from address matches.
dontSeeInLastInstantMessageFrom
Checks whether the last messages from address does not match.
grabLastInstantMessageContent
Grabber method to return the content/text of the last message.
seeInLastInstantMessageContent
Checks whether the last messages content/text matches.
dontSeeInLastInstantMessageContent
Checks whether the last messages content/text does not match.
grabLastInstantMessageColor
Grabber method to return the color of the last message.
seeInLastInstantMessageColor
Checks whether the last messages color matches.
dontSeeInLastInstantMessageColor
Checks whether the last messages color does not match.
grabLastInstantMessageDate
Grabber method to return the date/time of the last message.
seeInLastInstantMessageDate
Checks whether the last messages date matches.
dontSeeInLastInstantMessageDate
Checks whether the last messages date does not match.
License
Released under the same license as Codeception: MIT