diff --git a/README.md b/README.md index afd4436..21d6907 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Docker assigns automatically an open port. To see the assigned port use `$ docke ### Create a mock / Save a response - POST [url]?session_id=[session_id] + POST [url]/api-mock/create?session_id=[session_id] { "status_code": 200, "headers": { ... }, @@ -64,7 +64,7 @@ Docker assigns automatically an open port. To see the assigned port use `$ docke A GET request to the root URL of the API mock will return the count of unsent mock responses for the given session. - GET [url]/api-mock/?session_id=[session_id] + GET [url]/api-mock/count?session_id=[session_id] `$ curl [url]?session_id=[session_id]` * **url:** *URL to API Mock* diff --git a/config/routes/mock.php b/config/routes/mock.php index df5a66a..4f67364 100644 --- a/config/routes/mock.php +++ b/config/routes/mock.php @@ -6,7 +6,7 @@ */ return [ [ - 'pattern' => '', + 'pattern' => 'api-mock/create', 'route' => 'mock/mock/create', 'verb' => 'POST', ], diff --git a/tests/api/Mock/Controller/MockControllerCest.php b/tests/api/Mock/Controller/MockControllerCest.php index 3987b4e..dc613ac 100644 --- a/tests/api/Mock/Controller/MockControllerCest.php +++ b/tests/api/Mock/Controller/MockControllerCest.php @@ -17,7 +17,7 @@ class MockControllerCest */ public function tryToSaveResponse(\ApiTester $I) { - $I->sendPOST('/', [ + $I->sendPOST('/api-mock/create', [ 'data' => [ 'test' => 'api' ], @@ -68,7 +68,7 @@ public function tryToReceiveCountOfNotReceivedMocksAndShouldSeeZero(\ApiTester $ */ public function tryToStoreClientRequest(\ApiTester $I) { - $I->sendPOST('/', [ + $I->sendPOST('/api-mock/create', [ 'session_id' => 'apitest', 'status_code' => HttpCode::OK, 'headers' => ['Content-Type' => 'application/json'],