diff --git a/tests/Matchers/MatcherHeaderAbstractTest.php b/tests/Matchers/MatcherHeaderAbstractTest.php new file mode 100644 index 0000000..76a6a98 --- /dev/null +++ b/tests/Matchers/MatcherHeaderAbstractTest.php @@ -0,0 +1,41 @@ +headers(['header' => 'value']); + $this->assertSame(['header' => 'value'], $matcher->getHeaders()); + } + + public function testWithHeaders(): void + { + $matcher = new MatcherHeaderAbstractMock(); + $matcher2 = $matcher->withHeaders(['header' => 'value']); + $this->assertSame([], $matcher->getHeaders()); + $this->assertSame(['header' => 'value'], $matcher2->getHeaders()); + } + + public function testResetHeaders(): void + { + $matcher = new MatcherHeaderAbstractMock(); + $matcher->headers(['header' => 'value']); + $matcher->resetHeaders(); + $this->assertSame([], $matcher->getHeaders()); + } + + public function testWithoutHeaders(): void + { + $matcher = new MatcherHeaderAbstractMock(); + $matcher->headers(['header' => 'value']); + $matcher2 = $matcher->withoutHeaders(); + $this->assertSame(['header' => 'value'], $matcher->getHeaders()); + $this->assertSame([], $matcher2->getHeaders()); + } +} \ No newline at end of file diff --git a/tests/Matchers/Mocks/MatcherHeaderAbstractMock.php b/tests/Matchers/Mocks/MatcherHeaderAbstractMock.php new file mode 100644 index 0000000..a7d0b97 --- /dev/null +++ b/tests/Matchers/Mocks/MatcherHeaderAbstractMock.php @@ -0,0 +1,13 @@ +headers; + } +} \ No newline at end of file