Browse Source

Removed deprecated property Controller::$helpers.

ADmad 8 years ago
parent
commit
3d29000fef

+ 0 - 16
src/Controller/Controller.php

@@ -105,22 +105,6 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
     protected $name;
 
     /**
-     * An array containing the names of helpers this controller uses. The array elements should
-     * not contain the "Helper" part of the class name.
-     *
-     * Example:
-     * ```
-     * public $helpers = ['Form', 'Html', 'Time'];
-     * ```
-     *
-     * @var array
-     * @link https://book.cakephp.org/3.0/en/controllers.html#configuring-helpers-to-load
-     *
-     * @deprecated 3.0.0 You should configure helpers in your AppView::initialize() method.
-     */
-    public $helpers = [];
-
-    /**
      * An instance of a \Cake\Http\ServerRequest object that contains information about the current request.
      * This object contains all the information about a request and several methods for reading
      * additional information about the request.

+ 1 - 1
src/View/ViewVarsTrait.php

@@ -78,7 +78,7 @@ trait ViewVarsTrait
             }
         }
 
-        foreach (['name', 'helpers', 'plugin'] as $prop) {
+        foreach (['name', 'plugin'] as $prop) {
             if (isset($this->{$prop})) {
                 $method = 'set' . ucfirst($prop);
                 $builder->{$method}($this->{$prop});

+ 2 - 2
tests/TestCase/Controller/ControllerTest.php

@@ -759,8 +759,8 @@ class ControllerTest extends TestCase
 
         $this->assertEquals([], $Controller->paginate);
 
-        $this->assertNotContains('Paginator', $Controller->helpers);
-        $this->assertArrayNotHasKey('Paginator', $Controller->helpers);
+        $this->assertNotContains('Paginator', $Controller->viewBuilder()->getHelpers());
+        $this->assertArrayNotHasKey('Paginator', $Controller->viewBuilder()->getHelpers());
 
         $results = $Controller->paginate('Posts');
         $this->assertInstanceOf('Cake\Datasource\ResultSetInterface', $results);