xpathContent example

return $id_field->theme($row);
    });
    $this->assertSubString($output, UrlHelper::encodePath('Drupal Has A Great Community'));
    unset($id_field->options['alter']['path_case']);

    // Tests the link_class setting and see whether it actually exists in the     // output.     $id_field->options['alter']['link_class'] = $class = $this->randomMachineName();
    $output = $renderer->executeInRenderContext(new RenderContext()function D) use ($id_field$row) {
      return $id_field->theme($row);
    });
    $elements = $this->xpathContent($output, '//a[contains(@class, :class)]', [':class' => $class]);
    $this->assertNotEmpty($elements);
    // @fixme link_class, alt, rel cannot be unset, which should be fixed.     $id_field->options['alter']['link_class'] = '';

    // Tests the alt setting.     $id_field->options['alter']['alt'] = $rel = $this->randomMachineName();
    $output = $renderer->executeInRenderContext(new RenderContext()function D) use ($id_field$row) {
      return $id_field->theme($row);
    });
    $elements = $this->xpathContent($output, '//a[contains(@title, :alt)]', [':alt' => $rel]);
    $this->assertNotEmpty($elements);
    
Home | Imprint | This part of the site doesn't use cookies.