You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Allow to start several phiremock instances
* Added support for secure phiremock server
* Set defaults
* Allows to provide a list of the suites phiremock-server must be run for
* Cleaned a bit
* Cleaned up a bit
* Removed unused parameters
* Added documentation for new features
* Update README.md
* Update README.md
* Cleaned code a bit
* Fixed composer json
Co-authored-by: Mariano Custiel <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+65-1Lines changed: 65 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# phiremock-codeception-extension
2
-
Codeception extension to make working with [Phiremock Server](https://github.com/mcustiel/phiremock-server) even easier. It allows to start a Phiremock Server before each suite and stop it when the suite ends.
2
+
Codeception extension to make working with [Phiremock Server](https://github.com/mcustiel/phiremock-server) even easier. It allows to start a Phiremock Server before a suite is executed and stop it when the suite ends.
expectations_path: /my/expectations/path # defaults to tests/_expectations
44
44
server_factory: \My\FactoryClass # defaults to 'default'
45
+
extra_instances: [] # deaults to an empty array
46
+
suites: [] # defaults to an empty array
47
+
certificate: /path/to/cert # defaults to null
48
+
certificate_key: /path/to/cert-key # defaults to null
49
+
cert_passphrase: 'my-pass' # defaults to null
45
50
```
46
51
Note: Since Codeception version 2.2.7, extensions configuration can be added directly in the suite configuration file. That will avoid phiremock to be started for every suite.
47
52
48
53
### Parameters
49
54
50
55
#### listen
51
56
Specifies the interface and port where phiremock must listen for requests.
57
+
52
58
**Default:** 0.0.0.0:8086
53
59
54
60
#### bin_path
55
61
Path where Phiremock Server's "binary" is located. You can, for instance, point to the location of the phar in your file system.
Time to wait after Phiremock Server is started before running the tests (used to give time to Phiremock Server to boot)
77
+
68
78
**Default:** 0
69
79
70
80
#### expectations_path
71
81
Specifies a directory to search for json files defining expectations to load by default.
82
+
72
83
**Default:** codecption_dir/_expectations
73
84
85
+
#### certificate
86
+
Path to a certificate file to allow phiremock-server to listen for secure https connections.
87
+
88
+
**Default:** null. Meaning phiremock will only listen on unsecured http connections.
89
+
90
+
#### certificate-key
91
+
Path to the certificate key file.
92
+
93
+
**Default:** null.
94
+
95
+
#### cert-passphrase
96
+
Path to the certificate passphrase used to encrypt the certificate (only needed if encrypted).
97
+
98
+
**Default:** null. Meaning no decryption based in passphrase will be performed.
99
+
100
+
#### suites
101
+
Specifies a list of suites for which the phiremock-server must be executed.
102
+
103
+
**Default:** [] Empty array, meaning that phiremock will be executed for each suite.
104
+
105
+
#### extra_instances
106
+
Allows to specify more instances of phiremock-server to run. This is useful if you want, for instance, run one instance listening for http and one listening for https connections. Each instance has its own configuration, and can separately run for different suites.
107
+
108
+
**Default:** [] Empty array, meaning that no extra phiremock-server instances are configured.
109
+
110
+
**Example:**
111
+
```yaml
112
+
extensions:
113
+
enabled:
114
+
- \Codeception\Extension\Phiremock
115
+
config:
116
+
\Codeception\Extension\Phiremock:
117
+
listen: 127.0.0.1:18080
118
+
debug: true
119
+
start_delay: 1
120
+
expectations_path: /my/expectations/path-1
121
+
suites:
122
+
- acceptance
123
+
extra_instances:
124
+
-
125
+
listen: 127.0.0.1:18081
126
+
debug: true
127
+
start_delay: 1
128
+
expectations_path: /my/expectations/path-2
129
+
suites:
130
+
- acceptance
131
+
- api
132
+
certificate: /path/to/cert
133
+
certificate_key: /path/to/cert-key
134
+
cert_passphrase: 'my-pass'
135
+
```
136
+
74
137
#### server_factory
75
138
Specifies a Factory class extending `\Mcustiel\Phiremock\Server\Factory\Factory`. Useful if you want to provide your own PSR. This works only if you install phiremock as a local dependency required in your composer file.
0 commit comments