Skip to content

Commit

Permalink
Rename Text => Basic
Browse files Browse the repository at this point in the history
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 bbf9945
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/View/Input/Text.php → src/View/Input/Basic.php
Expand Up @@ -23,7 +23,7 @@
* input elements like hidden, text, email, tel and other
* types.
*/
class Text implements InputInterface {
class Basic implements InputInterface {

/**
* StringTemplate instance.
Expand Down
2 changes: 1 addition & 1 deletion src/View/Input/InputRegistry.php
Expand Up @@ -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'],
];

/**
Expand Down
Expand Up @@ -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();
Expand All @@ -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']
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
14 changes: 7 additions & 7 deletions tests/TestCase/View/Input/InputRegistryTest.php
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}
Expand All @@ -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'));
}

Expand All @@ -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);
Expand Down

0 comments on commit bbf9945

Please sign in to comment.