diff --git a/core/modules/views/lib/Drupal/views/Tests/BasicTest.php b/core/modules/views/lib/Drupal/views/Tests/BasicTest.php index dc65207..5464adc 100644 --- a/core/modules/views/lib/Drupal/views/Tests/BasicTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/BasicTest.php @@ -7,8 +7,6 @@ namespace Drupal\views\Tests; -use Drupal\views\Tests\ViewUnitTestBase; - /** * Basic test class for Views query builder tests. */ diff --git a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php index 249e120..bbc998d 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php @@ -7,8 +7,6 @@ namespace Drupal\views\Tests; -use Drupal\views\Tests\ViewUnitTestBase; - /** * Tests basic functions from the Views module. */ diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php index ce72eea..d5c83d9 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php @@ -7,12 +7,23 @@ namespace Drupal\views\Tests\Plugin; +use Drupal\views\Tests\ViewTestBase; +use Drupal\views_test_data\Plugin\views\row\RowTest; +use Drupal\views_test_data\Plugin\views\style\StyleTest as StyleTestPlugin; + /** * Tests some general style plugin related functionality. * * @see Drupal\views_test_data\Plugin\views\style\StyleTest. */ -class StyleTest extends StyleTestBase { +class StyleTest extends ViewTestBase { + + /** + * Stores the SimpleXML representation of the output. + * + * @var \SimpleXMLElement + */ + protected $elements; public static function getInfo() { return array( @@ -22,6 +33,12 @@ public static function getInfo() { ); } + protected function setUp() { + parent::setUp(); + + $this->enableViewsTestModule(); + } + /** * Tests the general renderering of styles. */ @@ -33,7 +50,7 @@ public function testStyle() { $view->display_handler->setOption('style', $style); $view->initDisplay(); $view->initStyle(); - $this->assertTrue($view->style_plugin instanceof \Drupal\views_test_data\Plugin\views\style\StyleTest, 'Make sure the right style plugin class is loaded.'); + $this->assertTrue($view->style_plugin instanceof StyleTestPlugin, 'Make sure the right style plugin class is loaded.'); $random_text = $this->randomName(); // Set some custom text to the output and make sure that this value is @@ -56,7 +73,7 @@ public function testStyle() { $view->style_plugin->setUsesRowPlugin(TRUE); // Reinitialize the style as it supports row plugins now. $view->style_plugin->init($view, $view->display_handler, array()); - $this->assertTrue($view->style_plugin->row_plugin instanceof \Drupal\views_test_data\Plugin\views\row\RowTest, 'Make sure the right row plugin class is loaded.'); + $this->assertTrue($view->style_plugin->row_plugin instanceof RowTest, 'Make sure the right row plugin class is loaded.'); $random_text = $this->randomName(); $view->style_plugin->row_plugin->setOutput($random_text); @@ -310,4 +327,17 @@ function testCustomRowClasses() { } } + /** + * Stores a view output in the elements. + */ + protected 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); + } + } + } diff --git a/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php b/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php index f36e8f2..baa8079 100644 --- a/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php @@ -7,8 +7,6 @@ namespace Drupal\views\Tests; -use Drupal\views\Tests\ViewUnitTestBase; - /** * Checks general plugin data and instances for all plugin types. */ diff --git a/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php b/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php index 7f92356..bcc1a1c 100644 --- a/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php @@ -7,8 +7,6 @@ namespace Drupal\views\Tests; -use Drupal\views\Tests\ViewUnitTestBase; - /** * Tests core view token replacement. */