Skip to content

Commit

Permalink
Merge pull request #3 from lamoda/add-semantic-reset-methods
Browse files Browse the repository at this point in the history
Add semantic reset methods
  • Loading branch information
Pavel Batanov authored Aug 23, 2021
2 parents 1a07f04 + c771dda commit 17f9ded
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Module/WireMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace Codeception\Module;

use Codeception\Module as CodeceptionModule;
use Codeception\TestCase;
use Codeception\Util\Debug;
use WireMock\Client\WireMock as WireMockClient;
use WireMock\Client\MappingBuilder;
Expand Down Expand Up @@ -49,6 +48,9 @@ public function _beforeSuite($settings = [])
$this->wireMock = WireMockClient::create($this->config['host'], $this->config['port']);
}

/**
* @deprecated use resetMappingsAndRequestJournalInWireMock() instead
*/
public function cleanAllPreviousRequestsToWireMock()
{
$this->wireMock->reset();
Expand Down Expand Up @@ -79,4 +81,19 @@ public function findReceivedRequestsToWireMock(RequestPatternBuilder $builder)
{
return $this->wireMock->findAll($builder);
}

public function resetMappingsAndRequestJournalInWireMock()
{
$this->wireMock->reset();
}

public function resetRequestJournalInWireMock()
{
$this->wireMock->resetAllRequests();
}

public function resetMappingsInWireMock()
{
$this->wireMock->resetToDefault();
}
}

0 comments on commit 17f9ded

Please sign in to comment.