Snippets Groups Projects
Commit dfe132e1 authored by Arthur LORENT's avatar Arthur LORENT :drum:
Browse files

added trim for each detected class for classTag helper

parent 61a88bb3
Branches
Tags 1.0.2
No related merge requests found
......@@ -42,7 +42,7 @@ class HtmlHelper implements Htmlable
. gettype($arg) . ' type given for « ' . $arg . ' » argument.');
}
}
$classArray = array_map('trim', $classArray);
$this->htmlString = new HtmlString('class="' . implode(' ', $classArray) . '"');
return $this;
......
......@@ -15,7 +15,7 @@ class ClassTagTest extends HtmlhelperTestCase
'class1',
['class2', 'class3', null],
null,
['class4', ['class5', 'class6Key' => 'class6']],
['class4', ['class5 ', 'class6Key' => 'class6']],
7
);
$this->assertEquals('class="class1 class2 class3 class4 class5 class6 7"', $html);
......@@ -27,7 +27,7 @@ class ClassTagTest extends HtmlhelperTestCase
'class1',
['class2', 'class3', null],
null,
['class4', ['class5', 'class6Key' => 'class6']],
['class4', ['class5 ', 'class6Key' => 'class6']],
7
)->render();
$this->assertEquals('class="class1 class2 class3 class4 class5 class6 7"', $html);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment