From 8b23810c70def9497cdf54ee55bd8fafd4e06be6 Mon Sep 17 00:00:00 2001
From: damiankloip <damian@damoweb.co.uk>
Date: Sun, 26 Aug 2012 14:41:13 +0200
Subject: [PATCH] Updated comments in ViewsStorageTest

---
 lib/Drupal/views/Tests/ViewsStorageTest.php | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/Drupal/views/Tests/ViewsStorageTest.php b/lib/Drupal/views/Tests/ViewsStorageTest.php
index 1e0a8ed0924d..b11b76251a3f 100644
--- a/lib/Drupal/views/Tests/ViewsStorageTest.php
+++ b/lib/Drupal/views/Tests/ViewsStorageTest.php
@@ -52,14 +52,16 @@ function testConfigEntityCRUD() {
     // Test an info array has been returned.
     $this->assertTrue(!empty($info) && is_array($info), 'View entity info array loaded.');
 
-    // Test we have the correct controller class.
+    // Confirm we have the correct controller class.
     $this->assertTrue($controller instanceof ViewStorageController, 'Correct entity controller loaded.');
 
+    // Loading.
+
     //Load a single config entity.
     $load = $controller->load(array('archive'));
     $view = reset($load);
 
-    // Check it's a view.
+    // Confirm it's a view.
     $this->assertTrue($view instanceof View, 'Single View instance loaded.');
 
     // Check that the View contains all of the properties.
@@ -73,16 +75,22 @@ function testConfigEntityCRUD() {
     $this->assertEqual(array_keys($view->display), $expected_displays, 'Correct display names present.');
 
     foreach ($view->display as $key => $display) {
+      // Confirm it's a ViewDisplay object.
       $this->assertTrue($display instanceof ViewsDisplay, t('Display: @display is instance of ViewsDisplay.', array('@display' => $key)));
+      // Check the display ID array key and object property match.
       $this->assertEqual($key, $display->id, 'The display has the correct ID.');
+      // Check display options array exists on the ViewsDisplay.
       $display_options = $display->display_options;
       $this->assertTrue(!empty($display_options) && is_array($display_options), 'Display options exist.');
     }
 
     // Load all config entities.
     $all_entities = $controller->load();
+    // Get a list of all existing default view config.
     $all_config = config_get_storage_names_with_prefix('views.view');
 
+    // Remove 'views.view.' prefix from config names for comparision with
+    // loaded config entities.
     $prefix_map = function ($value) {
       $parts = explode('.', $value);
       return end($parts);
@@ -91,6 +99,7 @@ function testConfigEntityCRUD() {
     // Check correct number of entities have been loaded.
     $count = count($all_entities);
     $this->assertEqual($count, count($all_config), t('Array of all @count entities loaded.', array('@count' => $count)));
+    // Check all of these machine names match.
     $this->assertIdentical(array_keys($all_entities), array_map($prefix_map, $all_config), 'All loaded elements match.');
   }
 
-- 
GitLab