Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function testFailingPostRequestNoOrigin() |
||
12 | { |
||
13 | $request = new ServerRequest([], [], "http://alice.com/hello", "Post"); |
||
14 | |||
15 | $headerFetcher = new OriginOrRefererHeader(); |
||
16 | |||
17 | $this->expectException(CsrfHeaderCheckMiddlewareException::class); |
||
18 | $this->expectExceptionMessage('Could not find neither the ORIGIN header nor the REFERER header in the HTTP request.'); |
||
19 | |||
20 | $headerFetcher($request); |
||
21 | } |
||
22 | |||
43 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.