view sites/all/modules/views/tests/styles/views_plugin_style_base.test @ 2:b74b41bb73f0

-- Google analytics module
author danieleb <danielebarchiesi@me.com>
date Thu, 22 Aug 2013 17:22:54 +0100
parents ff03f76ab3fe
children
line wrap: on
line source
<?php

/**
 * @file
 * Definition of ViewsPluginStyleTestBase.
 */

/**
 * Provides a base foundation for testing style plugins.
 */
abstract class ViewsPluginStyleTestBase extends ViewsSqlTest {

  /**
   * Stores the SimpleXML representation of the output.
   *
   * @var SimpleXMLElement
   */
  protected $elements;

  /**
   * Stores a view output in the elements.
   */
  function storeViewPreview($output) {
    $htmlDom = new DOMDocument();
    @$htmlDom->loadHTML($output);
    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);
    }
  }

}