class StyleTestBase
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php \Drupal\Tests\views\Kernel\Plugin\StyleTestBase
Tests some general style plugin related functionality.
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\views\Kernel\Plugin\StyleTestBase implements \Drupal\Tests\views\Kernel\ViewsKernelTestBase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of StyleTestBase
File
-
core/
modules/ views/ tests/ src/ Kernel/ Plugin/ StyleTestBase.php, line 11
Namespace
Drupal\Tests\views\Kernel\PluginView source
abstract class StyleTestBase extends ViewsKernelTestBase {
/**
* Stores the SimpleXML representation of the output.
*
* @var \SimpleXMLElement
*/
protected $elements;
/**
* Stores a view output in the elements.
*/
public function storeViewPreview($output) {
$html5 = new HTML5();
$htmlDom = $html5->loadHTML('<html><body>' . $output . '</body></html>');
if ($htmlDom) {
// It's much easier to work with simplexml than DOM, luckily enough
// we can just simply import our DOM tree.
$this->elements = simplexml_import_dom($htmlDom);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.