Permalink
Browse files

Rename Text => Basic

Calling it text was a bit misleading as it can make many kinds of
*basic* inputs.
  • Loading branch information...
markstory committed Jan 20, 2014
1 parent 4c24185 commit bbf9945fea7be069fa473f46793e0622701cb62f
@@ -23,7 +23,7 @@
* input elements like hidden, text, email, tel and other
* types.
*/
-class Text implements InputInterface {
+class Basic implements InputInterface {
/**
* StringTemplate instance.
@@ -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'],
];
/**
@@ -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 @@ public function setUp() {
* @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 @@ public function testRenderSimple() {
* @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 @@ public function testRenderType() {
* @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 @@ public function testRenderWithValue() {
* @return void
*/
public function testRenderAttributes() {
- $text = new Text($this->templates);
+ $text = new Basic($this->templates);
$data = [
'name' => 'my_input',
'type' => 'email',
@@ -40,11 +40,11 @@ public function setUp() {
*/
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 @@ public function testAddInConstructor() {
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 @@ public function testAdd() {
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 @@ public function testGet() {
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);

0 comments on commit bbf9945

Please sign in to comment.