Releases: rowanhill/wiremock-php
Fix PHP 8.2 deprecation warnings
PHP 8.2 deprecated the use of "${var}"
string interpolation (preferring "{$var}"
). This is a minor release to update one or two places in the wiremock-php codebase using the deprecated syntax, to avoid deprecation warnings.
Update to WireMock 2.35 API
This release brings new features available in the WireMock 2.35 JSON API:
- Matching values with
notContaining
Note that this release brings the major internal changes of version 2.33.1-RC1 to a stable release for the first time. Please report any bugs you may encounter!
Replace Symfony with a custom serde solution
Historically, wiremock-php has serialized PHP objects to JSON by a) translating to an intermediate form of associative arrays, then b) using json_encode. Similarly, deserialization was performed by a) using json_decode to produce an intermediate form of associative arrays, then b) translating to PHP objects. The translation between PHP objects and intermediate form associative arrays was performed by hand-written code that was both laborious and potentially error prone.
Release 2.33.0 replaced this translation code with the Symfony serializer library (heavily modified through subclassing and other hooks). This introduced a dependency on Symfony, however, which wasn't ideal.
This release replaces the Symfony serializer with a custom build serializer. This avoids the boilerplate code in the wiremock-php classes without introducing any production dependencies - albeit at the cost of introducing the complexity of a custom JSON serializer/deserializer!
Due to the wide-ranging nature of this change, this release is only at Release Candidate stability. The intent is to release this at production stability soon, if the RC doesn't cause problems - please report any issues encountered using this version.
This release includes no functional changes.
Update to WireMock 2.33 API
This release brings new features available in the WireMock 2.33 JSON API:
- Resetting individual scenario states with
resetScenario
- Directly setting the state of a scenario with
setScenarioState
Note that WireMock 2.33.0 was released with a regression in the JSON API that removed the name
field from returned scenario objects. This causes an incompatibility with wiremock-php. This bug is patched in version 2.33.1 of WireMock.
Update to WireMock 2.32 API
This release brings new features available in the WireMock 2.32 JSON API:
- Multi-host mocking with
withHost
- A new convenience method for JSON responses
WireMock::jsonResponse
- Get serve events for unmatched requests or requests matching a particular stub via passing a
ServeEventQuery
togetAllServeEvents
- Proxy prefix removal with
withProxyUrlPrefixToRemove
Update to WireMock 2.30 API
This release brings new features available in the WireMock 2.30 JSON API, namely the ability to configure webhooks to be called when a request is matched.
Update to WireMock 2.29 API
This release brings new features available in the WireMock 2.29 JSON API:
- Date/time matching with the
before
,beforeNow
,equalToDateTime
,isNow
,after
, andafterNow
static methods onWireMock
. See also the offset unit and truncation type consts onDateTimeMatchingStrategy
- Logical "and" and "or" of other matchers with the
and
andor
static methods onWireMock
, plus theand
andor
instance methods on matcher types.
As of this release, PHP 7.0+ is a required (to allow the keywords 'and' and 'or' in method names) dependency of wiremock-php.
Update to WireMock 2.27 API
This release brings new features available in the WireMock 2.27 JSON API:
- When matching XML bodies with
WireMock::equalToXml
it's possible to exempt specific XmlUnit comparison types withexemptingComparisons
. Valid values are are available as consts inWireMock\Client\XmlUnitComparisonType
.
Update to WireMock 2.25 API
This release brings new features available in the WireMock 2.25 JSON API:
- Removing serve events from the journal with
WireMock::removeServeEvent
,WireMock::removeServeEvents
, andWireMock::removeEventsByStubMetadata
Update to WireMock 2.22 API
This release brings new features available in the WireMock 2.22 JSON API:
- Multi-stub importing with
WireMock::importStubs
(andWireMock::stubImport
) - XMLUnit placeholders in
equalToXml