Browse Source

Merge pull request #12187 from cakephp/cell-viewclass

Remove use of undefined property from Cell::__debugInfo()
Mark Sch 7 years ago
parent
commit
5bceac679f
2 changed files with 17 additions and 1 deletions
  1. 0 1
      src/View/Cell.php
  2. 17 0
      tests/TestCase/View/CellTest.php

+ 0 - 1
src/View/Cell.php

@@ -304,7 +304,6 @@ abstract class Cell
             'action' => $this->action,
             'args' => $this->args,
             'template' => $this->template,
-            'viewClass' => $this->viewClass,
             'request' => $this->request,
             'response' => $this->response,
         ];

+ 17 - 0
tests/TestCase/View/CellTest.php

@@ -86,6 +86,23 @@ class CellTest extends TestCase
     }
 
     /**
+     * Tests debug output.
+     *
+     * @return void
+     */
+    public function testDebugInfo()
+    {
+        $cell = $this->View->cell('Articles::teaserList');
+        $data = $cell->__debugInfo();
+        $this->assertArrayHasKey('plugin', $data);
+        $this->assertArrayHasKey('request', $data);
+        $this->assertArrayHasKey('response', $data);
+        $this->assertEquals('teaserList', $data['action']);
+        $this->assertEquals('teaser_list', $data['template']);
+        $this->assertEquals([], $data['args']);
+    }
+
+    /**
      * Test __toString() hitting an error when rendering views.
      *
      * @return void