Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed class InputRegistry to WidgetRegistry.

  • Loading branch information...
commit a081ea4fce50b9d26b34ebbbf885ce83cec954d4 1 parent a60d499
@ADmad ADmad authored
View
12 src/View/Helper/FormHelper.php
@@ -29,7 +29,7 @@
use Cake\View\Helper\StringTemplateTrait;
use Cake\View\StringTemplate;
use Cake\View\View;
-use Cake\View\Widget\InputRegistry;
+use Cake\View\Widget\WidgetRegistry;
use DateTime;
use Traversable;
@@ -113,7 +113,7 @@ class FormHelper extends Helper {
/**
* Registry for input widgets.
*
- * @var \Cake\View\Widget\InputRegistry
+ * @var \Cake\View\Widget\WidgetRegistry
*/
protected $_registry;
@@ -180,14 +180,14 @@ public function __construct(View $View, $settings = array()) {
/**
* Set the input registry the helper will use.
*
- * @param \Cake\View\Widget\InputRegistry $instance The registry instance to set.
+ * @param \Cake\View\Widget\WidgetRegistry $instance The registry instance to set.
* @param array $widgets An array of widgets
- * @return \Cake\View\Widget\InputRegistry
+ * @return \Cake\View\Widget\WidgetRegistry
*/
- public function inputRegistry(InputRegistry $instance = null, $widgets = []) {
+ public function inputRegistry(WidgetRegistry $instance = null, $widgets = []) {
if ($instance === null) {
if ($this->_registry === null) {
- $this->_registry = new InputRegistry($this->_templater, $widgets);
+ $this->_registry = new WidgetRegistry($this->_templater, $widgets);
}
return $this->_registry;
}
View
2  src/View/Widget/InputRegistry.php → src/View/Widget/WidgetRegistry.php
@@ -32,7 +32,7 @@
* Each widget should expect a StringTemplate instance as their first
* argument. All other dependencies will be included after.
*/
-class InputRegistry {
+class WidgetRegistry {
/**
* Array of widgets + widget configuration.
View
26 ...estCase/View/Widget/InputRegistryTest.php → ...stCase/View/Widget/WidgetRegistryTest.php
@@ -16,12 +16,12 @@
use Cake\TestSuite\TestCase;
use Cake\View\StringTemplate;
-use Cake\View\Widget\InputRegistry;
+use Cake\View\Widget\WidgetRegistry;
/**
- * InputRegistry test case
+ * WidgetRegistry test case
*/
-class InputRegistryTestCase extends TestCase {
+class WidgetRegistryTestCase extends TestCase {
/**
* setup method
@@ -42,7 +42,7 @@ public function testAddInConstructor() {
$widgets = [
'text' => ['Cake\View\Widget\Basic'],
];
- $inputs = new InputRegistry($this->templates, $widgets);
+ $inputs = new WidgetRegistry($this->templates, $widgets);
$result = $inputs->get('text');
$this->assertInstanceOf('Cake\View\Widget\Basic', $result);
}
@@ -53,7 +53,7 @@ public function testAddInConstructor() {
* @return void
*/
public function testAdd() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$result = $inputs->add([
'text' => ['Cake\View\Widget\Basic'],
]);
@@ -61,7 +61,7 @@ public function testAdd() {
$result = $inputs->get('text');
$this->assertInstanceOf('Cake\View\Widget\WidgetInterface', $result);
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$result = $inputs->add([
'hidden' => 'Cake\View\Widget\Basic',
]);
@@ -78,7 +78,7 @@ public function testAdd() {
* @return void
*/
public function testAddInvalidType() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->add([
'text' => new \StdClass()
]);
@@ -91,7 +91,7 @@ public function testAddInvalidType() {
* @return void
*/
public function testGet() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->add([
'text' => ['Cake\View\Widget\Basic'],
]);
@@ -106,7 +106,7 @@ public function testGet() {
* @return void
*/
public function testGetFallback() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->add([
'_default' => ['Cake\View\Widget\Basic'],
]);
@@ -125,7 +125,7 @@ public function testGetFallback() {
* @return void
*/
public function testGetNoFallbackError() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->clear();
$inputs->get('foo');
}
@@ -136,7 +136,7 @@ public function testGetNoFallbackError() {
* @return void
*/
public function testGetResolveDependency() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->clear();
$inputs->add([
'label' => ['Cake\View\Widget\Label'],
@@ -154,7 +154,7 @@ public function testGetResolveDependency() {
* @return void
*/
public function testGetResolveDependencyMissingClass() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->add(['test' => ['TestApp\View\Derp']]);
$inputs->get('test');
}
@@ -167,7 +167,7 @@ public function testGetResolveDependencyMissingClass() {
* @return void
*/
public function testGetResolveDependencyMissingDependency() {
- $inputs = new InputRegistry($this->templates);
+ $inputs = new WidgetRegistry($this->templates);
$inputs->clear();
$inputs->add(['multicheckbox' => ['Cake\View\Widget\MultiCheckbox', 'label']]);
$inputs->get('multicheckbox');
Please sign in to comment.
Something went wrong with that request. Please try again.