Skip to content

Commit

Permalink
Tidy linter warnings in StubbingIntegrationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanhill committed Dec 30, 2021
1 parent 27af5d2 commit 1d13566
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/WireMock/Client/EqualToXmlMatchingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
}

/**
* @param string[] $comparisonTypes...
* @param string $comparisonTypes...
* @return $this
*/
public function exemptingComparisons($comparisonTypes)
Expand Down
20 changes: 8 additions & 12 deletions test/WireMock/Integration/StubbingIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require_once 'WireMockIntegrationTest.php';

use Exception;
use WireMock\Client\DateTimeMatchingStrategy;
use WireMock\Client\WireMock;
use WireMock\Client\XmlUnitComparisonType;
Expand Down Expand Up @@ -672,7 +673,7 @@ public function testStubIdCanBeSet()
public function testStubIdIsReturnedInResponseHeader()
{
// given
$stubMapping = self::$_wireMock->stubFor(WireMock::get(WireMock::urlEqualTo('/some/url'))
self::$_wireMock->stubFor(WireMock::get(WireMock::urlEqualTo('/some/url'))
->withId('76ada7b0-49ae-4229-91c4-396a36f18e09')
->willReturn(WireMock::aResponse()));

Expand All @@ -697,7 +698,7 @@ public function testStubNameCanBeSet()
public function testStubNameIsReturnedInResponseHeader()
{
// given
$stubMapping = self::$_wireMock->stubFor(WireMock::get(WireMock::urlEqualTo('/some/url'))
self::$_wireMock->stubFor(WireMock::get(WireMock::urlEqualTo('/some/url'))
->withName('stub-name')
->willReturn(WireMock::aResponse()));

Expand Down Expand Up @@ -881,7 +882,7 @@ public function testStubsCanBeEdited()
}

/**
* @throws \Exception
* @throws Exception
*/
public function testStubsCanBeImported()
{
Expand All @@ -893,7 +894,6 @@ public function testStubsCanBeImported()
);

// then
/** @var StubMapping[] $mappings */
$mappings = getMappings();
$urls = array_map(function(/** @var $m StubMapping */$m) {
return $m->getRequest()->getUrlMatchingStrategy()->getMatchingValue();
Expand All @@ -903,7 +903,7 @@ public function testStubsCanBeImported()
}

/**
* @throws \Exception
* @throws Exception
*/
public function testStubImportOverwritesStubsByDefault()
{
Expand All @@ -919,15 +919,14 @@ public function testStubImportOverwritesStubsByDefault()
));

// then
/** @var StubMapping[] $mappings */
$mappings = getMappings();
assertThat($mappings, is(arrayWithSize(1)));
$mapping = $mappings[0];
assertThat($mapping->getRequest()->getUrlMatchingStrategy()->getMatchingValue(), is('/path2'));
}

/**
* @throws \Exception
* @throws Exception
*/
public function testStubImportCanBeSetToIgnoreDuplicates()
{
Expand All @@ -943,15 +942,14 @@ public function testStubImportCanBeSetToIgnoreDuplicates()
)->ignoreExisting());

// then
/** @var StubMapping[] $mappings */
$mappings = getMappings();
assertThat($mappings, is(arrayWithSize(1)));
$mapping = $mappings[0];
assertThat($mapping->getRequest()->getUrlMatchingStrategy()->getMatchingValue(), is('/path'));
}

/**
* @throws \Exception
* @throws Exception
*/
public function testStubImportLeavesExistingStubsInPlaceByDefault()
{
Expand All @@ -965,7 +963,6 @@ public function testStubImportLeavesExistingStubsInPlaceByDefault()
);

// then
/** @var StubMapping[] $mappings */
$mappings = getMappings();
assertThat($mappings, is(arrayWithSize(3)));
$urls = array_map(function(/** @var $m StubMapping */$m) {
Expand All @@ -976,7 +973,7 @@ public function testStubImportLeavesExistingStubsInPlaceByDefault()
}

/**
* @throws \Exception
* @throws Exception
*/
public function testStubImportCanBeSetToReplaceAnyExistingStubs()
{
Expand All @@ -991,7 +988,6 @@ public function testStubImportCanBeSetToReplaceAnyExistingStubs()
);

// then
/** @var StubMapping[] $mappings */
$mappings = getMappings();
assertThat($mappings, is(arrayWithSize(2)));
$urls = array_map(function(/** @var $m StubMapping */$m) {
Expand Down

0 comments on commit 1d13566

Please sign in to comment.