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