Skip to content

Commit 05ee0f8

Browse files
author
Daniel Schischkin
committed
Initial commit
1 parent 26aa256 commit 05ee0f8

27 files changed

+3444
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor
2+
/.idea

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
# repository-template
2-
Repository Template
1+
# <a id="title" href="#">Surplex API Mock</a>
2+
---
3+
4+
API for "the software to mock third-party responses" to include in your application's API tests.
5+
&nbsp;
6+
&nbsp;
7+
## <a id="Troubleshooting" href="#Troubleshooting">Troubleshooting</a>
8+
---
9+
#### I used a requestKey, but the `ApiMock::getClientRequest()` gets a 404/null
10+
**A)** The request in question has never been called by your application, therefore a request with the requestKey has never
11+
been recorded. Make sure to `ApiMock::addResponse()` in the correct order. Maybe one of the earlier responses does not
12+
match your application's excpectations and causes it to fail?
13+
**B)** Your requests to API Mock use different session keys (or none at all). For example, this can happen if parts of
14+
your application run asyncronously (e.g. in queues). Use the $sessionCacheFile feature to retrieve the correct session
15+
key. (provide a file path where API Mock can dump the currently used session key into and then retrieve it in your
16+
application).

codeception.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
paths:
2+
tests: tests
3+
output: tests/_output
4+
data: tests/_data
5+
support: tests/_support
6+
envs: tests/_envs
7+
actor_suffix: Tester
8+
extensions:
9+
enabled:
10+
- Codeception\Extension\RunFailed

composer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "surplex/api-mock-api",
3+
"license": "Apache-2.0",
4+
"description": "Interface for the communication between software and api-mock",
5+
"type": "library",
6+
"authors": [
7+
{
8+
"name": "Daniel Schischkin",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": ">=7.1",
14+
"guzzlehttp/guzzle": "^6.3",
15+
"ext-json": "*"
16+
},
17+
"require-dev": {
18+
"codeception/codeception": "^2.5"
19+
},
20+
"autoload": {
21+
"psr-4": {
22+
"ApiMock\\": "src/"
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)