diff --git a/src/PhpPact/Consumer/Matcher/Matchers/Includes.php b/src/PhpPact/Consumer/Matcher/Matchers/Includes.php new file mode 100644 index 00000000..7435d919 --- /dev/null +++ b/src/PhpPact/Consumer/Matcher/Matchers/Includes.php @@ -0,0 +1,31 @@ + + */ + public function jsonSerialize(): array + { + return [ + 'pact:matcher:type' => $this->getType(), + 'value' => $this->value, + ]; + } + + public function getType(): string + { + return 'include'; + } +} diff --git a/tests/PhpPact/Consumer/Matcher/Matchers/IncludesTest.php b/tests/PhpPact/Consumer/Matcher/Matchers/IncludesTest.php new file mode 100644 index 00000000..6310f3fe --- /dev/null +++ b/tests/PhpPact/Consumer/Matcher/Matchers/IncludesTest.php @@ -0,0 +1,18 @@ +assertSame( + '{"pact:matcher:type":"include","value":"contains this string"}', + json_encode($string) + ); + } +}