| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class TestView extends \Illuminate\Testing\TestView |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Assert that the given HTML is contained within the view. |
||
| 13 | * |
||
| 14 | * @return $this |
||
| 15 | */ |
||
| 16 | public function assertSeeHtml(string $value, bool $ignoreFormatting = false): static |
||
| 17 | { |
||
| 18 | if ($ignoreFormatting) { |
||
| 19 | return $this->assertSeeHtmlIgnoringFormatting($value); |
||
| 20 | } |
||
| 21 | |||
| 22 | return $this->assertSee($value, false); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Assert that the given HTML is contained within the view text, ignoring whitespace and newlines. |
||
| 27 | * |
||
| 28 | * @return $this |
||
| 29 | */ |
||
| 30 | public function assertSeeHtmlIgnoringFormatting(string $value): static |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Assert that the HTML attribute value is contained within the view. |
||
| 39 | * |
||
| 40 | * @return $this |
||
| 41 | */ |
||
| 42 | public function assertAttributeIs(string $attributeName, string $expectedValue): static |
||
| 43 | { |
||
| 44 | PHPUnit::assertStringContainsString($attributeName.'="'.$expectedValue.'"', $this->rendered); |
||
| 45 | |||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Assert that the given text is equals the view's text content. |
||
| 51 | * |
||
| 52 | * @return $this |
||
| 53 | */ |
||
| 54 | public function assertTextIs(string $value): static |
||
| 59 | } |
||
| 60 | |||
| 61 | protected function trimNewlinesAndIndentation(string $value): string |
||
| 64 | } |
||
| 65 | } |
||
| 66 |