diff --git a/src/View/Helper/BootstrapHtmlHelper.php b/src/View/Helper/BootstrapHtmlHelper.php
index 5d29241..8c542a9 100644
--- a/src/View/Helper/BootstrapHtmlHelper.php
+++ b/src/View/Helper/BootstrapHtmlHelper.php
@@ -86,6 +86,9 @@ public function icon ($icon, $options = []) {
public function faIcon ($icon, $options = []) {
$options = $this->addClass($options, 'fa');
$options = $this->addClass($options, 'fa-'.$icon);
+ $options += [
+ 'aria-hidden' => 'true'
+ ];
return $this->tag('i', '', $options);
}
@@ -98,6 +101,9 @@ public function faIcon ($icon, $options = []) {
public function glIcon ($icon, $options = []) {
$options = $this->addClass($options, 'glyphicon');
$options = $this->addClass($options, 'glyphicon-'.$icon);
+ $options += [
+ 'aria-hidden' => 'true'
+ ];
return $this->tag('i', '', $options);
}
diff --git a/tests/TestCase/View/Helper/BootstrapHtmlHelperTest.php b/tests/TestCase/View/Helper/BootstrapHtmlHelperTest.php
index 1cad192..6618827 100644
--- a/tests/TestCase/View/Helper/BootstrapHtmlHelperTest.php
+++ b/tests/TestCase/View/Helper/BootstrapHtmlHelperTest.php
@@ -55,31 +55,35 @@ public function testIcon () {
// Default icon (Glyphicon)
$this->assertHtml ([
['i' => [
- 'class' => 'glyphicon glyphicon-'.$type
+ 'class' => 'glyphicon glyphicon-'.$type,
+ 'aria-hidden' => 'true'
]],
'/i'
], $this->Html->icon($type));
$this->assertHtml ([
['i' => [
'class' => $options['class'].' glyphicon glyphicon-'.$type,
- 'id' => $options['id']
+ 'id' => $options['id'],
+ 'aria-hidden' => 'true'
]],
'/i'
], $this->Html->icon($type, $options));
// FontAwesome icon
$this->assertHtml ([
['i' => [
- 'class' => 'fa fa-'.$type
+ 'class' => 'fa fa-'.$type,
+ 'aria-hidden' => 'true'
]],
'/i'
], $this->Html->faIcon($type));
$this->assertHtml ([
['i' => [
'class' => $options['class'].' fa fa-'.$type,
- 'id' => $options['id']
+ 'id' => $options['id'],
+ 'aria-hidden' => 'true'
]],
'/i'
- ], $this->Html->faIcon($type, $options));
+ ], $this->Html->faIcon($type, $options));
}
public function testLabel () {
diff --git a/tests/TestCase/View/Helper/BootstrapPaginatorHelperTest.php b/tests/TestCase/View/Helper/BootstrapPaginatorHelperTest.php
index caf507e..8c925b5 100644
--- a/tests/TestCase/View/Helper/BootstrapPaginatorHelperTest.php
+++ b/tests/TestCase/View/Helper/BootstrapPaginatorHelperTest.php
@@ -59,7 +59,8 @@ public function testPrev () {
]],
['a' => true],
['i' => [
- 'class' => 'glyphicon glyphicon-chevron-left'
+ 'class' => 'glyphicon glyphicon-chevron-left',
+ 'aria-hidden' => 'true'
]],
'/i', '/a', '/li'
], $this->Paginator->prev('i:chevron-left'));
@@ -79,7 +80,8 @@ public function testNext () {
'href' => '/index?page=2'
]],
['i' => [
- 'class' => 'glyphicon glyphicon-chevron-right'
+ 'class' => 'glyphicon glyphicon-chevron-right',
+ 'aria-hidden' => 'true'
]],
'/i', '/a', '/li'
], $this->Paginator->next('i:chevron-right'));
diff --git a/tests/TestCase/View/Helper/BootstrapPanelHelperTest.php b/tests/TestCase/View/Helper/BootstrapPanelHelperTest.php
index f04ec6b..b1b98b1 100644
--- a/tests/TestCase/View/Helper/BootstrapPanelHelperTest.php
+++ b/tests/TestCase/View/Helper/BootstrapPanelHelperTest.php
@@ -136,7 +136,8 @@ public function testHeader () {
'class' => 'panel-title'
]],
['i' => [
- 'class' => 'glyphicon glyphicon-home'
+ 'class' => 'glyphicon glyphicon-home',
+ 'aria-hidden' => 'true'
]], '/i', ' Home',
'/h4',
'/div'
@@ -215,7 +216,8 @@ public function testHeader () {
'aria-controls' => '#collapse-2'
]],
['i' => [
- 'class' => 'glyphicon glyphicon-home'
+ 'class' => 'glyphicon glyphicon-home',
+ 'aria-hidden' => 'true'
]], '/i', ' Home',
'/a',
'/h4',
diff --git a/tests/TestCase/View/Helper/BootstrapTraitTest.php b/tests/TestCase/View/Helper/BootstrapTraitTest.php
index 8c29980..56896d3 100644
--- a/tests/TestCase/View/Helper/BootstrapTraitTest.php
+++ b/tests/TestCase/View/Helper/BootstrapTraitTest.php
@@ -82,7 +82,8 @@ public function testEasyIcon() {
'expected' => [
'escape' => false,
'result' => [['i' => [
- 'class' => 'glyphicon glyphicon-plus'
+ 'class' => 'glyphicon glyphicon-plus',
+ 'aria-hidden' => 'true'
]], '/i']
]
]);
@@ -98,7 +99,8 @@ public function testEasyIcon() {
'expected' => [
'escape' => false,
'result' => [['i' => [
- 'class' => 'glyphicon glyphicon-plus'
+ 'class' => 'glyphicon glyphicon-plus',
+ 'aria-hidden' => 'true'
]], '/i', ' Add']
]
]);
@@ -107,7 +109,8 @@ public function testEasyIcon() {
'expected' => [
'escape' => false,
'result' => ['Add ', ['i' => [
- 'class' => 'glyphicon glyphicon-plus'
+ 'class' => 'glyphicon glyphicon-plus',
+ 'aria-hidden' => 'true'
]], '/i']
]
]);
@@ -136,7 +139,8 @@ public function testHelperMethods() {
'class' => 'btn btn-default',
'type' => 'submit'
]], ['i' => [
- 'class' => 'glyphicon glyphicon-plus'
+ 'class' => 'glyphicon glyphicon-plus',
+ 'aria-hidden' => 'true'
]], '/i', '/button'
], $result) ;
$result = $this->Form->input ('fieldname', [
@@ -154,7 +158,10 @@ public function testHelperMethods() {
['span' => [
'class' => 'input-group-addon'
]],
- ['i' => ['class' => 'glyphicon glyphicon-home']], '/i',
+ ['i' => [
+ 'class' => 'glyphicon glyphicon-home',
+ 'aria-hidden' => 'true'
+ ]], '/i',
'/span',
['input' => [
'type' => 'text',
@@ -165,7 +172,10 @@ public function testHelperMethods() {
['span' => [
'class' => 'input-group-addon'
]],
- ['i' => ['class' => 'glyphicon glyphicon-plus']], '/i',
+ ['i' => [
+ 'class' => 'glyphicon glyphicon-plus',
+ 'aria-hidden' => 'true'
+ ]], '/i',
'/span',
'/div',
'/div'