Browse Source

Rename Text => Basic

Calling it text was a bit misleading as it can make many kinds of
*basic* inputs.
mark_story 12 years ago
parent
commit
bbf9945fea

+ 1 - 1
src/View/Input/Text.php

@@ -23,7 +23,7 @@ use Cake\View\Input\InputInterface;
  * input elements like hidden, text, email, tel and other
  * types.
  */
-class Text implements InputInterface {
+class Basic implements InputInterface {
 
 /**
  * StringTemplate instance.

+ 1 - 1
src/View/Input/InputRegistry.php

@@ -45,7 +45,7 @@ class InputRegistry {
 		'multicheckbox' => ['Cake\View\Input\MultiCheckbox', 'label'],
 		'radio' => ['Cake\View\Input\Radio', 'label'],
 		'select' => ['Cake\View\Input\SelectBox'],
-		'_default' => ['Cake\View\Input\Text'],
+		'_default' => ['Cake\View\Input\Basic'],
 	];
 
 /**

+ 7 - 7
tests/TestCase/View/Input/TextTest.php

@@ -15,13 +15,13 @@
 namespace Cake\Test\TestCase\View\Input;
 
 use Cake\TestSuite\TestCase;
-use Cake\View\Input\Text;
+use Cake\View\Input\Basic;
 use Cake\View\StringTemplate;
 
 /**
- * Text input test.
+ * Basic input test.
  */
-class TextTest extends TestCase {
+class BasicTest extends TestCase {
 
 	public function setUp() {
 		parent::setUp();
@@ -37,7 +37,7 @@ class TextTest extends TestCase {
  * @return void
  */
 	public function testRenderSimple() {
-		$text = new Text($this->templates);
+		$text = new Basic($this->templates);
 		$result = $text->render(['name' => 'my_input']);
 		$expected = [
 			'input' => ['type' => 'text', 'name' => 'my_input']
@@ -51,7 +51,7 @@ class TextTest extends TestCase {
  * @return void
  */
 	public function testRenderType() {
-		$text = new Text($this->templates);
+		$text = new Basic($this->templates);
 		$data = [
 			'name' => 'my_input',
 			'type' => 'email',
@@ -69,7 +69,7 @@ class TextTest extends TestCase {
  * @return void
  */
 	public function testRenderWithValue() {
-		$text = new Text($this->templates);
+		$text = new Basic($this->templates);
 		$data = [
 			'name' => 'my_input',
 			'type' => 'email',
@@ -92,7 +92,7 @@ class TextTest extends TestCase {
  * @return void
  */
 	public function testRenderAttributes() {
-		$text = new Text($this->templates);
+		$text = new Basic($this->templates);
 		$data = [
 			'name' => 'my_input',
 			'type' => 'email',

+ 7 - 7
tests/TestCase/View/Input/InputRegistryTest.php

@@ -40,11 +40,11 @@ class InputRegistryTestCase extends TestCase {
  */
 	public function testAddInConstructor() {
 		$widgets = [
-			'text' => ['Cake\View\Input\Text'],
+			'text' => ['Cake\View\Input\Basic'],
 		];
 		$inputs = new InputRegistry($this->templates, $widgets);
 		$result = $inputs->get('text');
-		$this->assertInstanceOf('Cake\View\Input\Text', $result);
+		$this->assertInstanceOf('Cake\View\Input\Basic', $result);
 	}
 
 /**
@@ -55,7 +55,7 @@ class InputRegistryTestCase extends TestCase {
 	public function testAdd() {
 		$inputs = new InputRegistry($this->templates);
 		$result = $inputs->add([
-			'text' => ['Cake\View\Input\Text'],
+			'text' => ['Cake\View\Input\Basic'],
 		]);
 		$this->assertNull($result);
 	}
@@ -68,10 +68,10 @@ class InputRegistryTestCase extends TestCase {
 	public function testGet() {
 		$inputs = new InputRegistry($this->templates);
 		$inputs->add([
-			'text' => ['Cake\View\Input\Text'],
+			'text' => ['Cake\View\Input\Basic'],
 		]);
 		$result = $inputs->get('text');
-		$this->assertInstanceOf('Cake\View\Input\Text', $result);
+		$this->assertInstanceOf('Cake\View\Input\Basic', $result);
 		$this->assertSame($result, $inputs->get('text'));
 	}
 
@@ -83,10 +83,10 @@ class InputRegistryTestCase extends TestCase {
 	public function testGetFallback() {
 		$inputs = new InputRegistry($this->templates);
 		$inputs->add([
-			'_default' => ['Cake\View\Input\Text'],
+			'_default' => ['Cake\View\Input\Basic'],
 		]);
 		$result = $inputs->get('text');
-		$this->assertInstanceOf('Cake\View\Input\Text', $result);
+		$this->assertInstanceOf('Cake\View\Input\Basic', $result);
 
 		$result2 = $inputs->get('hidden');
 		$this->assertSame($result, $result2);