From 7322e94c8bf749f7062f70d8e50a35d6b26dde1c Mon Sep 17 00:00:00 2001
From: WidgetsBurritos <davidstinemetze@gmail.com>
Date: Sun, 5 Feb 2017 16:24:09 -0600
Subject: [PATCH] tests

---
 tests/PanelsPaneReportWebTestCase.test | 58 +++++++++++++++++++++++++++++++++-
 1 file changed, 57 insertions(+), 1 deletion(-)

diff --git a/tests/PanelsPaneReportWebTestCase.test b/tests/PanelsPaneReportWebTestCase.test
index e774a2c..9c10179 100644
--- a/tests/PanelsPaneReportWebTestCase.test
+++ b/tests/PanelsPaneReportWebTestCase.test
@@ -27,7 +27,7 @@ class PanelsPaneReportWebTestCase extends DrupalWebTestCase {
    * Implements setUp().
    */
   public function setUp() {
-    parent::setUp(array('panels_pane_report', 'panels_node', 'page_manager'));
+    parent::setUp(array('panels_pane_report', 'panels_node', 'panelizer'));
     db_truncate('panels_pane_report');
   }
 
@@ -198,4 +198,60 @@ class PanelsPaneReportWebTestCase extends DrupalWebTestCase {
     $this->assertText('panels_node [' . $storage_id . ']');
   }
 
+  /**
+   * Test report supports panelizer_entity containers.
+   */
+  public function testPanelizerEntityContainers() {
+    $admin_user = $this->drupalCreateUser(array(
+      'access panels pane report',
+      'generate panels pane report',
+    ));
+
+    // Create a temporary node.
+    $node = $this->drupalCreateNode(array('type' => 'widget', 'uid' => $admin_user->uid));
+
+    // Simulate the addition of the node to a panels_node panel.
+    $did = 500;
+    $storage_nid = 123;
+    $storage_id = 'node:' . $storage_nid . ':page_manager';
+    $config_array = array('nid' => $node->nid, 'build_mode' => 'taco');
+    $style_array = array('style' => 'puffy');
+
+    db_insert('panels_pane')->fields(array(
+      'did' => $did,
+      'configuration' => serialize($config_array),
+      'style' => serialize($style_array),
+      'type' => 'node',
+      'subtype' => 'node',
+    ))->execute();
+
+    db_insert('panels_display')->fields(array(
+      'did' => $did,
+      'panel_settings' => serialize(''),
+      'storage_type' => 'panelizer_entity',
+      'storage_id' => $storage_id,
+    ))->execute();
+
+    db_insert('panelizer_entity')->fields(array(
+      'entity_type' => 'node',
+      'entity_id' => $node->nid,
+      'revision_id' => $node->vid,
+      'view_mode' => 'page_manager',
+      'did' => $did,
+      'pipeline' => 'standard',
+    ))->execute();
+
+    // Attempt to login and regenerate the report.
+    $this->drupalLogin($admin_user);
+    $submit_options = array('query' => array('op' => 'Regenerate Report'));
+    $this->drupalGet('admin/reports/panels-pane-report', $submit_options);
+    $this->assertText('node:widget');
+    $this->assertText('Build Mode: taco');
+    $this->assertText('Style: puffy');
+    $this->assertText($node->title);
+    $this->assertRaw('<a href="' . url('node/' . $node->nid) . '" target="_blank">node/' . $node->nid . '</a>');
+    $this->assertRaw('<a href="' . url('node/' . $storage_nid) . '" target="_blank">node/' . $storage_nid . '</a>');
+    $this->assertText('panelizer_entity [' . $storage_id . ']');
+  }
+
 }
-- 
2.10.1 (Apple Git-78)

