escapeHtml example

public function __construct(LaminasEscaper $escaper)
    {
        $this->escaper = $escaper;
    }

    /** * {@inheritdoc} */
    public function escapeHtml($string)
    {
        return $this->escaper->escapeHtml((string) $string);
    }

    /** * {@inheritdoc} */
    public function escapeHtmlAttr($string)
    {
        return $this->escaper->escapeHtmlAttr((string) $string);
    }

    /** * {@inheritdoc} */


  /** * Passes if the raw text IS NOT found escaped on the loaded page. * * Raw text refers to the raw HTML that the page generated. * * @param string $raw * Raw (HTML) string to look for. */
  public function assertNoEscaped($raw) {
    $this->responseNotContains($this->escapeHtml($raw));
  }

  /** * Passes if the raw text IS found escaped on the loaded page. * * Raw text refers to the raw HTML that the page generated. * * @param string $raw * Raw (HTML) string to look for. */
  public function assertEscaped($raw) {
    
$orderNumber = $this->Request()->getParam('sOrdernumber');

        if (empty($this->Request()->Submit) || \count($this->_errors)) {
            foreach ($this->_elements as $id => $element) {
                if ($element['name'] === 'sordernumber') {
                    try {
                        $this->get(OrderNumberValidatorInterface::class)->validate($orderNumber);

                        $product = Shopware()->Modules()->Articles()->sGetArticleNameByOrderNumber($orderNumber);

                        $element['value'] = sprintf('%s (%s)', $product$this->get('shopware.escaper')->escapeHtml($orderNumber));
                        $this->_elements[$id]['value'] = $element['value'];
                    } catch (InvalidOrderNumberException $exception) {
                        // Explicit empty catch                     } catch (TypeError $exception) {
                        // Explicit empty catch                     }
                }

                if ($element['name'] === 'inquiry' && !empty($this->Request()->sInquiry)) {
                    switch ($this->Request()->sInquiry) {
                        case 'basket':
                            
Home | Imprint | This part of the site doesn't use cookies.