Skip to content

Commit

Permalink
Oups !
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Jun 8, 2022
1 parent ac4fd78 commit 0be9be1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions Tests/Twig/Extension/AssetsTwigExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,36 @@ public function testRenderIcon(): void {
*
* @return void
*/
public function testRenderIconWithDefault(): void {
public function testRenderIconWithBootstrapIcon(): void {

$res = '<span class="glyphicon glyphicon-home" aria-hidden="true"></span>';
$res = '<i class="bi bi-house"></i>';

$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "home"));
$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "bi:house"));
}

/**
* Tests renderIcon()
*
* @return void
*/
public function testRenderIconWithGlyphicon(): void {
public function testRenderIconWithDefault(): void {

$res = '<span class="glyphicon glyphicon-home" aria-hidden="true"></span>';

$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "b:home"));
$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "g:home"));
$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "home"));
}

/**
* Tests renderIcon()
*
* @return void
*/
public function testRenderIconWithIcon(): void {
public function testRenderIconWithGlyphicon(): void {

$res = '<i class="bi bi-house"></i>';
$res = '<span class="glyphicon glyphicon-home" aria-hidden="true"></span>';

$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "bi:house"));
$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "b:home"));
$this->assertEquals($res, AssetsTwigExtension::renderIcon($this->twigEnvironment, "g:home"));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Twig/Extension/AssetsTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public function getFilters(): array {
*/
public function getFunctions(): array {
return [
new TwigFunction("bootstrapRenderIcon", [$this, "coreRenderIconFunction"], ["is_safe" => ["html"]]),
new TwigFunction("bsRenderIcon", [$this, "coreRenderIconFunction"], ["is_safe" => ["html"]]),
new TwigFunction("bootstrapRenderIcon", [$this, "bootstrapRenderIconFunction"], ["is_safe" => ["html"]]),
new TwigFunction("bsRenderIcon", [$this, "bootstrapRenderIconFunction"], ["is_safe" => ["html"]]),
];
}

Expand Down

0 comments on commit 0be9be1

Please sign in to comment.