views_plugin_style_base.test

Definition of ViewsPluginStyleTestBase.

File

tests/styles/views_plugin_style_base.test
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of ViewsPluginStyleTestBase.
  5. */
  6. /**
  7. * Provides a base foundation for testing style plugins.
  8. */
  9. abstract class ViewsPluginStyleTestBase extends ViewsSqlTest {
  10. /**
  11. * Stores the SimpleXML representation of the output.
  12. *
  13. * @var SimpleXMLElement
  14. */
  15. protected $elements;
  16. /**
  17. * Stores a view output in the elements.
  18. */
  19. function storeViewPreview($output) {
  20. $htmlDom = new DOMDocument();
  21. @$htmlDom->loadHTML($output);
  22. if ($htmlDom) {
  23. // It's much easier to work with simplexml than DOM, luckily enough
  24. // we can just simply import our DOM tree.
  25. $this->elements = simplexml_import_dom($htmlDom);
  26. }
  27. }
  28. }