Commit 5799c9fa authored by damiankloip's avatar damiankloip Committed by tim.plunkett
Browse files

Renamed ViewsStorageTest and ViewsDisplay.

parent 46895347
<?php
/**
* Definition of Drupal\views\Tests\ViewsStorageTest.
* Definition of Drupal\views\Tests\ViewStorageTest.
*/
namespace Drupal\views\Tests;
......@@ -9,12 +9,12 @@
use Drupal\simpletest\WebTestBase;
use Drupal\views\ViewStorageController;
use Drupal\views\View;
use Drupal\views\ViewsDisplay;
use Drupal\views\ViewDisplay;
/**
* Tests that functionality of the the ViewsStorageController.
* Tests that functionality of the the ViewStorageController.
*/
class ViewsStorageTest extends WebTestBase {
class ViewStorageTest extends WebTestBase {
/**
* Properties that should be stored in the configuration.
......@@ -80,7 +80,7 @@ function testConfigurableCRUD() {
// Check each ViewDisplay object and confirm that it has the correct key.
foreach ($view->display as $key => $display) {
$this->assertTrue($display instanceof ViewsDisplay, format_string('Display: @display is instance of ViewsDisplay.', array('@display' => $key)));
$this->assertTrue($display instanceof ViewDisplay, format_string('Display: @display is instance of ViewDisplay.', array('@display' => $key)));
$this->assertEqual($key, $display->id, 'The display has the correct ID.');
// Confirm that the display options array exists.
$display_options = $display->display_options;
......@@ -131,7 +131,7 @@ function testConfigurableCRUD() {
// Test created displays.
foreach ($created->display as $key => $display) {
$this->assertTrue($display instanceof ViewsDisplay, format_string('Display @display is an instance of ViewsDisplay.', array('@display' => $key)));
$this->assertTrue($display instanceof ViewDisplay, format_string('Display @display is an instance of ViewDisplay.', array('@display' => $key)));
}
// Save the newly created view, but modify the name.
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\views\ViewsDisplay.
* Definition of Drupal\views\ViewDisplay.
*/
namespace Drupal\views;
......@@ -13,7 +13,7 @@
* This is just the database storage mechanism, and isn't terribly important
* to the behavior of the display at all.
*/
class ViewsDisplay {
class ViewDisplay {
/**
* The display handler itself, which has all the methods.
......
......@@ -78,7 +78,7 @@ function add_display($type = 'page', $title = NULL, $id = NULL) {
);
// Create the new display object
$display = new ViewsDisplay($display_options);
$display = new ViewDisplay($display_options);
// Add the new display object to the view.
$this->display[$id] = $display;
......
......@@ -110,7 +110,7 @@ public function create(array $values) {
}
/**
* Attaches an array of ViewsDisplay objects to the view display property.
* Attaches an array of ViewDisplay objects to the view display property.
*
* @param Drupal\entity\StorableInterface $entity
*/
......@@ -118,8 +118,8 @@ protected function attachDisplays($entity) {
if (isset($entity->display) && is_array($entity->display)) {
$displays = array();
foreach ($entity->get('display') as $key => $options) {
// Create a ViewsDisplay object using the display options.
$displays[$key] = new ViewsDisplay($options);
// Create a ViewDisplay object using the display options.
$displays[$key] = new ViewDisplay($options);
}
$entity->set('display', $displays);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment