|
7 | 7 |
|
8 | 8 | class RemoveQuotesTest extends TestCase
|
9 | 9 | {
|
| 10 | + protected $response; |
| 11 | + |
| 12 | + public function setUp(): void |
| 13 | + { |
| 14 | + parent::setUp(); |
| 15 | + |
| 16 | + $this->response = $this->middleware->handle($this->request, $this->getNext()); |
| 17 | + } |
| 18 | + |
10 | 19 | protected function getMiddleware()
|
11 | 20 | {
|
12 | 21 | $this->middleware = new RemoveQuotes();
|
13 | 22 | }
|
14 | 23 |
|
15 | 24 | public function testRemoveQuotes()
|
16 | 25 | {
|
17 |
| - $response = $this->middleware->handle($this->request, $this->getNext()); |
18 |
| - |
19 |
| - $this->assertStringContainsString('<link rel="apple-touch-icon" href="icon.png">', $response->getContent()); |
20 |
| - $this->assertStringContainsString('<meta charset=utf-8>', $response->getContent()); |
21 |
| - $this->assertStringContainsString('<meta name=viewport content="width=device-width, initial-scale=1">', $response->getContent()); |
22 |
| - $this->assertStringContainsString('<img src=http://emblemsbf.com/img/18346.jpg width=250 style="height:300px; padding:10px" >', $response->getContent()); |
23 |
| - $this->assertStringContainsString('<img src=/images/1000coin.png>', $response->getContent()); |
24 |
| - $this->assertStringContainsString('<vue-component :src="\'src\'" :type="\'type\'" :width="200"></vue-component>', $response->getContent()); |
25 |
| - $this->assertStringContainsString('<img src="tile whitespace.png" width=250 style="height:300px; padding:10px">', $response->getContent()); |
26 |
| - $this->assertStringContainsString('<input type=text name="name with spaces" value="name with spaces" width=100%>', $response->getContent()); |
| 26 | + $this->assertStringContainsString('<link rel="apple-touch-icon" href="icon.png">', $this->response->getContent()); |
| 27 | + $this->assertStringContainsString('<meta charset=utf-8>', $this->response->getContent()); |
| 28 | + $this->assertStringContainsString('<meta name=viewport content="width=device-width, initial-scale=1">', $this->response->getContent()); |
| 29 | + $this->assertStringContainsString('<img src=http://emblemsbf.com/img/18346.jpg width=250 style="height:300px; padding:10px" >', $this->response->getContent()); |
| 30 | + $this->assertStringContainsString('<img src=/images/1000coin.png>', $this->response->getContent()); |
| 31 | + $this->assertStringContainsString('<vue-component :src="\'src\'" :type="\'type\'" :width="200"></vue-component>', $this->response->getContent()); |
| 32 | + $this->assertStringContainsString('<img src="tile whitespace.png" width=250 style="height:300px; padding:10px">', $this->response->getContent()); |
| 33 | + $this->assertStringContainsString('<input type=text name="name with spaces" value="name with spaces" width=100%>', $this->response->getContent()); |
| 34 | + } |
| 35 | + |
| 36 | + public function testWontRemoveTrailingSlashesOfNonVoidElements() |
| 37 | + { |
| 38 | + $this->assertStringContainsString('<path d="M 80 80 A 45 45, 0, 0, 0, 125 125 L 125 80 Z" fill="green"/>', $this->response->getContent()); |
| 39 | + $this->assertStringContainsString('<path d="M 230 80 A 45 45, 0, 1, 0, 275 125 L 275 80 Z" fill="red"/>', $this->response->getContent()); |
27 | 40 | }
|
28 | 41 | }
|
0 commit comments