Skip to content

Commit

Permalink
Add makeFooterIcon() wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
malberts committed Feb 21, 2025
1 parent f33f39b commit f2879b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/ChameleonTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,9 @@ public function getFooterIconsWithImage() {

return $footericons;
}

public function makeFooterIcon( string|array $icon ): string {
return $this->getSkin()->makeFooterIcon( $icon );
}

}
2 changes: 1 addition & 1 deletion src/Components/FooterIcons.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private function getIcons() {

foreach ( $footerIcons as $icon ) {
$lines[] = $this->indent() . '<div>' .
$this->getSkinTemplate()->getSkin()->makeFooterIcon( $icon ) . '</div>';
$this->getSkinTemplate()->makeFooterIcon( $icon ) . '</div>';
}

}
Expand Down
6 changes: 2 additions & 4 deletions tests/phpunit/Unit/Components/FooterIconsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ class FooterIconsTest extends GenericComponentTestCase {
public function testGetHtml() {
$chameleonTemplate = $this->getChameleonSkinTemplateStub();

$skin = $chameleonTemplate->getSkin();

$skin->expects( $this->exactly( 4 ) )
$chameleonTemplate->expects( $this->exactly( 4 ) )
->method( 'makeFooterIcon' )
->withConsecutive(
[ $this->equalTo( 'icon1' ) ],
[ $this->equalTo( 'icon2' ) ],
[ $this->equalTo( 'icon3' ) ],
[ $this->equalTo( 'icon4' ) ]
)
->willReturn( $this->returnValue( 'SomeHTML' ) );
->willReturn( 'SomeHTML' );

$chameleonTemplate->expects( $this->any() )
->method( 'getFooterIconsWithImage' )
Expand Down

0 comments on commit f2879b3

Please sign in to comment.