mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Applying patch from ticket #2496, adding test for it
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4893 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5692e7f344
commit
da0dacb013
2 changed files with 4 additions and 1 deletions
|
@ -300,7 +300,7 @@ class FormHelper extends AppHelper {
|
|||
$tagName = implode('.', array_filter(array($this->model(), $this->field())));
|
||||
}
|
||||
|
||||
if ($text == null) {
|
||||
if ($text === null) {
|
||||
if (strpos($tagName, '/') !== false || strpos($tagName, '.') !== false) {
|
||||
list( , $text) = preg_split('/[\/\.]+/', $tagName);
|
||||
} else {
|
||||
|
|
|
@ -430,6 +430,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Form->label('first_name', 'Your first name', array('class' => 'my-class', 'id' => 'LabelID'));
|
||||
$this->assertEqual($result, '<label for="first_name" class="my-class" id="LabelID">Your first name</label>');
|
||||
|
||||
$result = $this->Form->label('first_name', '');
|
||||
$this->assertEqual($result, '<label for="first_name"></label>');
|
||||
}
|
||||
|
||||
function testTextbox() {
|
||||
|
|
Loading…
Reference in a new issue