@magentoAppArea frontend
Definition at line 16 of file SuggestionsTest.php.
◆ setUp()
Definition at line 21 of file SuggestionsTest.php.
23 $suggestedQueries = $this->createMock(SuggestedQueriesInterface::CLASS);
24 $suggestedQueries->expects($this->any())->method(
'getItems')->willReturn([
25 new QueryResult(
'test item', 1),
26 new QueryResult(
"<script>alert('Test');</script>", 1)
30 'searchDataProvider' => $suggestedQueries,
static getObjectManager()
◆ testRenderEscaping()
Definition at line 35 of file SuggestionsTest.php.
37 $html = $this->block->toHtml();
39 $this->assertContains(
'test+item', $html);
40 $this->assertContains(
'test item', $html);
42 $this->assertNotContains(
'<script>', $html);
43 $this->assertContains(
'%3Cscript%3Ealert%28%27Test%27%29%3B%3C%2Fscript%3E', $html);
44 $this->assertContains(
"<script>alert('Test');</script>", $html);
◆ $block
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/AdvancedSearch/Block/SuggestionsTest.php