Skip to content

Commit 2d0d816

Browse files
committed
Add a verb to remove an expectation
1 parent f31fd4d commit 2d0d816

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/MockServerHelper.php

+13-8
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,13 @@ public function createMockRequest(string $json): void
120120
);
121121
}
122122

123-
public function clearMockServerLogs(): void
123+
public function removeMockRequest(string $mockRequestId): void
124124
{
125-
$request = new Request('PUT', '/mockserver/clear?type=log');
125+
$body = json_encode([
126+
'id' => $mockRequestId
127+
]);
128+
Assert::assertIsString($body);
129+
$request = new Request('PUT', '/mockserver/clear?type=expectations', [], $body);
126130
$response = $this->mockserverClient->sendRequest($request);
127131
Assert::assertEquals(
128132
200,
@@ -131,18 +135,19 @@ public function clearMockServerLogs(): void
131135
);
132136
}
133137

134-
public function deactivateNotMatchedRequest(): void
138+
public function clearMockServerLogs(): void
135139
{
136-
$body = json_encode([
137-
'id' => self::NOT_MATCHED_REQUEST_ID
138-
]);
139-
Assert::assertIsString($body);
140-
$request = new Request('PUT', '/mockserver/clear?type=expectations', [], $body);
140+
$request = new Request('PUT', '/mockserver/clear?type=log');
141141
$response = $this->mockserverClient->sendRequest($request);
142142
Assert::assertEquals(
143143
200,
144144
$response->getStatusCode(),
145145
$response->getBody()->getContents()
146146
);
147147
}
148+
149+
public function deactivateNotMatchedRequest(): void
150+
{
151+
$this->removeMockRequest(self::NOT_MATCHED_REQUEST_ID);
152+
}
148153
}

0 commit comments

Comments
 (0)