Skip to content

Commit bbf9945

Browse files
committed
Rename Text => Basic
Calling it text was a bit misleading as it can make many kinds of *basic* inputs.
1 parent 4c24185 commit bbf9945

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/View/Input/Text.php renamed to src/View/Input/Basic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* input elements like hidden, text, email, tel and other
2424
* types.
2525
*/
26-
class Text implements InputInterface {
26+
class Basic implements InputInterface {
2727

2828
/**
2929
* StringTemplate instance.

src/View/Input/InputRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class InputRegistry {
4545
'multicheckbox' => ['Cake\View\Input\MultiCheckbox', 'label'],
4646
'radio' => ['Cake\View\Input\Radio', 'label'],
4747
'select' => ['Cake\View\Input\SelectBox'],
48-
'_default' => ['Cake\View\Input\Text'],
48+
'_default' => ['Cake\View\Input\Basic'],
4949
];
5050

5151
/**

tests/TestCase/View/Input/TextTest.php renamed to tests/TestCase/View/Input/BasicTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
namespace Cake\Test\TestCase\View\Input;
1616

1717
use Cake\TestSuite\TestCase;
18-
use Cake\View\Input\Text;
18+
use Cake\View\Input\Basic;
1919
use Cake\View\StringTemplate;
2020

2121
/**
22-
* Text input test.
22+
* Basic input test.
2323
*/
24-
class TextTest extends TestCase {
24+
class BasicTest extends TestCase {
2525

2626
public function setUp() {
2727
parent::setUp();
@@ -37,7 +37,7 @@ public function setUp() {
3737
* @return void
3838
*/
3939
public function testRenderSimple() {
40-
$text = new Text($this->templates);
40+
$text = new Basic($this->templates);
4141
$result = $text->render(['name' => 'my_input']);
4242
$expected = [
4343
'input' => ['type' => 'text', 'name' => 'my_input']
@@ -51,7 +51,7 @@ public function testRenderSimple() {
5151
* @return void
5252
*/
5353
public function testRenderType() {
54-
$text = new Text($this->templates);
54+
$text = new Basic($this->templates);
5555
$data = [
5656
'name' => 'my_input',
5757
'type' => 'email',
@@ -69,7 +69,7 @@ public function testRenderType() {
6969
* @return void
7070
*/
7171
public function testRenderWithValue() {
72-
$text = new Text($this->templates);
72+
$text = new Basic($this->templates);
7373
$data = [
7474
'name' => 'my_input',
7575
'type' => 'email',
@@ -92,7 +92,7 @@ public function testRenderWithValue() {
9292
* @return void
9393
*/
9494
public function testRenderAttributes() {
95-
$text = new Text($this->templates);
95+
$text = new Basic($this->templates);
9696
$data = [
9797
'name' => 'my_input',
9898
'type' => 'email',

tests/TestCase/View/Input/InputRegistryTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public function setUp() {
4040
*/
4141
public function testAddInConstructor() {
4242
$widgets = [
43-
'text' => ['Cake\View\Input\Text'],
43+
'text' => ['Cake\View\Input\Basic'],
4444
];
4545
$inputs = new InputRegistry($this->templates, $widgets);
4646
$result = $inputs->get('text');
47-
$this->assertInstanceOf('Cake\View\Input\Text', $result);
47+
$this->assertInstanceOf('Cake\View\Input\Basic', $result);
4848
}
4949

5050
/**
@@ -55,7 +55,7 @@ public function testAddInConstructor() {
5555
public function testAdd() {
5656
$inputs = new InputRegistry($this->templates);
5757
$result = $inputs->add([
58-
'text' => ['Cake\View\Input\Text'],
58+
'text' => ['Cake\View\Input\Basic'],
5959
]);
6060
$this->assertNull($result);
6161
}
@@ -68,10 +68,10 @@ public function testAdd() {
6868
public function testGet() {
6969
$inputs = new InputRegistry($this->templates);
7070
$inputs->add([
71-
'text' => ['Cake\View\Input\Text'],
71+
'text' => ['Cake\View\Input\Basic'],
7272
]);
7373
$result = $inputs->get('text');
74-
$this->assertInstanceOf('Cake\View\Input\Text', $result);
74+
$this->assertInstanceOf('Cake\View\Input\Basic', $result);
7575
$this->assertSame($result, $inputs->get('text'));
7676
}
7777

@@ -83,10 +83,10 @@ public function testGet() {
8383
public function testGetFallback() {
8484
$inputs = new InputRegistry($this->templates);
8585
$inputs->add([
86-
'_default' => ['Cake\View\Input\Text'],
86+
'_default' => ['Cake\View\Input\Basic'],
8787
]);
8888
$result = $inputs->get('text');
89-
$this->assertInstanceOf('Cake\View\Input\Text', $result);
89+
$this->assertInstanceOf('Cake\View\Input\Basic', $result);
9090

9191
$result2 = $inputs->get('hidden');
9292
$this->assertSame($result, $result2);

0 commit comments

Comments
 (0)