Skip to content

Commit d7b6591

Browse files
author
Davert
committed
amqp module updated and module stability docs added
1 parent 03864f6 commit d7b6591

50 files changed

Lines changed: 525 additions & 76 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/update_docs.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ function clean_doc($doc, $indent = 3)
2222
$moduleName = basename(substr($module, 0, -4));
2323
$text = '# ' . $moduleName . " Module\n";
2424

25+
$text .= "**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/$moduleName)**";
26+
2527
$className = '\Codeception\Module\\' . $moduleName;
2628
$class = new ReflectionClass($className);
2729

codeception.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ modules:
2222
username: 'guest'
2323
password: 'guest'
2424
vhost: '/'
25-
routes:
26-
- exchange: Exchange1
27-
queue: Queue1
28-
- exchange: Exchange1
29-
queue: Queue2
25+
queues: [queue1, queue2]
26+
3027
coverage:
3128
enabled: true
3229
include:

docs/modules/AMQP.md

Lines changed: 81 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,98 @@
11
# AMQP Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/AMQP)**
33
This module interacts with message broker software that implements
4-
the Advanced Message Queuing Protocol (AMQP) standard. For example, RabbitMQ.
4+
the Advanced Message Queuing Protocol (AMQP) standard. For example, RabbitMQ (tested).
55
Use it to cleanup the queue between tests.
66

7+
## Status
8+
* Maintainer: **davert**, **tiger-seo**
9+
* Stability: **alpha**
10+
* Contact: codecept@davert.mail.ua
11+
* Contact: tiger.seo@gmail.com
12+
13+
*Please review the code of non-stable modules and provide patches if you have issues.*
14+
715
## Config
816

17+
* host: localhost - host to connect
18+
* username: guest - username to connect
19+
* password: guest - password to connect
20+
* vhost: '/' - vhost to connect
921
* cleanup: true - defined queues will be purged before running every test.
22+
* queues: [mail, twitter] - queues to cleanup
23+
24+
Example:
25+
26+
modules:
27+
enabled: [AMQP]
28+
config:
29+
AMQP:
30+
host: 'localhost'
31+
port: '5672'
32+
username: 'guest'
33+
password: 'guest'
34+
vhost: '/'
35+
queues: [queue1, queue2]
36+
37+
## Public Properties
1038

11-
## Other
39+
* connection - AMQPConnection - current connection
40+
* channel - AMQPChannel - current channel
1241

1342
* available since version 1.1.2
1443
* author tiger.seo@gmail.com
44+
* author davert
1545

1646
## Actions
1747

1848

19-
### cleanupAMQP
49+
### pushToExchange
50+
51+
52+
Sends message to exchange
53+
54+
``` php
55+
<?php
56+
$I->pushToExchange('exchange.emails', 'thanks');
57+
$I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'));
58+
?>
59+
```
60+
61+
* param $exchange
62+
* param $message string|AMQPMessage
63+
64+
65+
### pushToQueue
66+
67+
68+
Sends message to queue
69+
70+
``` php
71+
<?php
72+
$I->pushToQueue('queue.jobs', 'create user');
73+
$I->pushToQueue('queue.jobs', new AMQPMessage('create'));
74+
?>
75+
```
76+
77+
* param $queue
78+
* param $message string|AMQPMessage
79+
80+
81+
### seeMessageInQueue
82+
83+
84+
Checks if message containing text received.
85+
86+
**This method drops message from queue**
87+
**This method will wait for message. If none is sent the script will stuck**.
88+
**Purges queue in the end**
2089

90+
``` php
91+
<?php
92+
$I->pushToQueue('queue.emails', 'Hello, davert');
93+
$I->seeMessageInQueue('queue.emails','davert');
94+
?>
95+
```
2196

22-
Cleans up queue.
97+
* param $queue
98+
* param $message

docs/modules/Cli.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
11
# Cli Module
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Cli)**
3+
Wrapper for basic shell commands and shell output
4+
5+
## Responsibility
6+
* Maintainer: **davert**
7+
* Status: **stable**
8+
* Contact: codecept@davert.mail.ua
9+
10+
*Please review the code of non-stable modules and provide patches if you have issues.*
211

312
## Actions
413

514

615
### dontSeeInShellOutput
716

8-
__not documented__
17+
18+
Checks that output from latest command doesn't contain text
19+
20+
* param $text
21+
922

1023

1124
### runShellCommmand
1225

13-
__not documented__
26+
27+
Executes a shell command
28+
29+
* param $command
1430

1531

1632
### seeInShellOutput
1733

18-
__not documented__
34+
35+
Checks that output from last executed command contains text
36+
37+
* param $text

docs/modules/Db.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Db Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Db)**
33
Works with SQL dabatase.
44

55
The most important function of this module is cleaning database before each test.
@@ -29,6 +29,19 @@ Supported but not tested.
2929
Connection is done by database Drivers, which are stored in Codeception\Util\Driver namespace.
3030
Check out drivers if you get problems loading dumps and cleaning databases.
3131

32+
## Status
33+
34+
* Maintainer: **davert**
35+
* stability:
36+
- Mysql: stable
37+
- SQLite: stable
38+
- Postgres: beta
39+
- MSSQL: alpha
40+
- Oracle: alpha
41+
* Contact: codecept@davert.mail.ua
42+
43+
*Please review the code of non-stable modules and provide patches if you have issues.*
44+
3245
## Config
3346

3447
* dsn *required* - PDO DSN

docs/modules/Dbh.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Dbh Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Dbh)**
33
This module replaces Db module for functional and unit testing, and requires PDO instance to be set.
44
Be default it will cover all database queries into transaction and rollback it afterwards.
55
The database should support nested transactions, in order to make cleanup work as expected.
@@ -19,6 +19,16 @@ This will make all queries in this connection run withing transaction and rolled
1919
Note, that you can't use this module with MySQL. Or perhaps you don't use transactions in your project, then it's ok.
2020
Otherwise consider using ORMs like Doctrine, that emulate nested transactions, or switch to Db module.
2121

22+
## Status
23+
24+
* Maintainer: **davert**
25+
* stability: stable
26+
* Contact: codecept@davert.mail.ua
27+
28+
This module despite of it's stability may act unstable because of transactions issue. If test fails with fatal error and transaction is not finished, it may affect other transactions.
29+
30+
*Please review the code of non-stable modules and provide patches if you have issues.*
31+
2232
### Configuration
2333

2434
* cleanup: true - enable cleanups by covering all queries inside transaction.

docs/modules/Doctrine1.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Doctrine1 Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Doctrine1)**
33
Performs DB operations with Doctrine ORM 1.x
44

55
Uses active Doctrine connection. If none can be found will fail.
66

77
This module cleans all cached data after each test.
88

9+
## Status
10+
11+
* Maintainer: **davert**
12+
* stability: stable
13+
* Contact: codecept@davert.mail.ua
14+
915
## Config
1016
* cleanup: true - all doctrine queries will be run in transaction, which will be rolled back at the end of test.
1117

docs/modules/Doctrine2.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Doctrine2 Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Doctrine2)**
33
Allows integration and testing for projects with Doctrine2 ORM.
44

55
Doctrine2 uses EntityManager to perform all database operations.
@@ -13,6 +13,11 @@ It can be done in bootstrap file, by setting static $em property:
1313
\Codeception\Module\Doctrine2::$em = $em
1414

1515
```
16+
## Status
17+
18+
* Maintainer: **davert**
19+
* stability: stable
20+
* Contact: codecept@davert.mail.ua
1621

1722
## Config
1823

docs/modules/Filesystem.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Filesystem Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Filesystem)**
33
Module for testing local filesystem.
44
Fork it to extend the module for FTP, Amazon S3, others.
55

6+
## Status
7+
8+
* Maintainer: **davert**
9+
* stability: stable
10+
* Contact: codecept@davert.mail.ua
11+
612
Module was developed to test Codeception itself.
713

814
## Actions

docs/modules/Kohana.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# Kohana Module
2-
2+
**For additional reference,, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/Kohana)**
33
This module provides integration with [Kohana](http://kohanaframework.org/) v3.
4-
Current status is PRE ALFA=)
54
Functional tests can be run inside Kohana. All commands of this module are just the same as in other modules that share Framework interface.
65

6+
## Status
7+
8+
* Maintainer: **Nikita Groshin**
9+
* stability: alpha
10+
* Contact: nike-17@ya.ru
11+
712
### Installation
813

914
This module sets $_SERVER['KOHANA_ENV'] = 'testing'

0 commit comments

Comments
 (0)