Skip to content
Permalink
Browse files

Improved icon handling

  • Loading branch information...
Thoulah committed May 13, 2019
1 parent 02571f8 commit 7ea4582f340fdaa71071c333ae3b851c9c2fa117
@@ -31,7 +31,7 @@
"kop/yii2-scroll-pager": "*",
"nezhelskoy/yii2-highlight": "*",
"zenorocha/clipboardjs": "^2.0",
"himiklab/yii2-recaptcha-widget": "*"
"himiklab/yii2-recaptcha-widget": "~2.0.0"
},
"require-dev": {
"yiisoft/yii2-debug": "*"

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -54,20 +54,20 @@ h1, h2, h3, h4, h5, h6, .breadcrumb, label {
}
}

svg.fa {
.icon {
display: inline-block;
font-size: inherit;
height: 1em;
overflow: visible;
vertical-align: -.125em;

@for $i from 1 through 20 {
&.w-#{$i} {
&-w-#{$i} {
width: $i * .0625em;
}
}

&.fa-fw {
&-fw {
text-align: center;
width: (20em / 16);
}
@@ -109,15 +109,16 @@ public function actionArtistInfo() {
foreach ($query->each() as $artist) :
$response = Webrequest::getLastfmApi('artist.getInfo', ['mbid' => $artist->mbid]);
if (!$response->isOK) :
if (!$response->isOK || ArrayHelper::getValue($response->data, '@attributes.status') !== 'ok') :
Console::write($artist->parent, [Console::FG_GREEN], 5);
Console::writeError("ERROR!", [Console::BOLD, Console::FG_RED, CONSOLE::BLINK]);
continue;
endif;
$artistInfo = LyricsArtistInfo::findOne(['parent' => $artist->parent]);
$artistInfo->mbid = ArrayHelper::getValue($response->data, 'artist.mbid');
$artistInfo->summary = trim(ArrayHelper::getValue($response->data, 'artist.bio.summary'));
$artistInfo->bio_summary = trim(ArrayHelper::getValue($response->data, 'artist.bio.summary')) ?? null;
$artistInfo->bio_full = trim(ArrayHelper::getValue($response->data, 'artist.bio.content')) ?? null;
$artistInfo->save();
endforeach;
}
@@ -7,8 +7,7 @@
class Icon {
public function show(string $name, array $options = []): string {
$classPrefix = ArrayHelper::remove($options, 'prefix', 'fas fa-');
$style = $this->getStyle((explode(' ', $classPrefix))[0]);
$style = ArrayHelper::remove($options, 'style', 'solid');
if (!file_exists(Yii::getAlias("@bower/fontawesome/svgs/{$style}/{$name}.svg")))
return $this->show('question-circle', $options);
@@ -17,9 +16,8 @@ public function show(string $name, array $options = []): string {
foreach ($doc->getElementsByTagName('svg') as $svg) :
$svg->setAttribute('aria-hidden', 'true');
list($width, $height) = StringHelper::explode($svg->getAttribute('viewBox'), ' ', function($e) { return ltrim($e, '0'); }, true);
$svg->setAttribute('class', trim(implode(' ', ['fa', 'w-'.ceil($width / $height * 16), ArrayHelper::remove($options, 'class')])));
$svg->setAttribute('class', trim(implode(' ', ['icon', 'icon-w-'.ceil($width / $height * 16), ArrayHelper::remove($options, 'class')])));
$svg->setAttribute('data-icon', $name);
$svg->setAttribute('data-prefix', (explode(' ', $classPrefix))[0]);
$svg->setAttribute('role', 'img');
foreach ($options as $key => $value)
$svg->setAttribute($key, $value);
@@ -30,18 +28,8 @@ public function show(string $name, array $options = []): string {
}
public function fieldAddon(string $name, array $options = []): string {
Html::addCssClass($options, 'icon-fw');
$icon = Html::tag('div', $this->show($name, $options), ['class' => 'input-group-text']);
return Html::tag('div', $icon, ['class' => 'input-group-prepend']);
}
private function getStyle(string $prefix): string {
switch ($prefix) :
case 'fab':
return 'brands';
case 'far':
return 'regular';
default:
return 'solid';
endswitch;
}
}
@@ -46,8 +46,8 @@ public function getUrlList($items = null): array {
private function getData(): array {
return [
['label' => Yii::$app->icon->show('newspaper', ['class' => 'mr-1']).Html::tag('span', Yii::t('mr42', 'Articles')), 'url' => ['/articles/index'], 'visible' => true],
['label' => Yii::$app->icon->show('calculator', ['class' => 'mr-1']).Html::tag('span', Yii::t('mr42', 'Calculator')), 'url' => null,
['label' => Yii::$app->icon->show('newspaper', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::t('mr42', 'Articles')), 'url' => ['/articles/index'], 'visible' => true],
['label' => Yii::$app->icon->show('calculator', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::t('mr42', 'Calculator')), 'url' => null,
'items' => [
['label' => Yii::t('mr42', 'Date (add/subtract)'), 'url' => ['/calculator/date']],
['label' => Yii::t('mr42', 'Date to Date (duration)'), 'url' => ['/calculator/duration']],
@@ -57,7 +57,7 @@ private function getData(): array {
['label' => Yii::t('mr42', 'Wifi Protected Access Pre-Shared Key'), 'url' => ['/calculator/wpapsk']],
],
],
['label' => Yii::$app->icon->show('wrench', ['class' => 'mr-1']).Html::tag('span', Yii::t('mr42', 'Tools')), 'url' => null,
['label' => Yii::$app->icon->show('wrench', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::t('mr42', 'Tools')), 'url' => null,
'items' => [
['label' => Yii::t('mr42', 'Barcode Generator'), 'url' => ['/tools/barcode']],
['label' => Yii::t('mr42', 'Browser Headers'), 'url' => ['/tools/headers']],
@@ -69,13 +69,13 @@ private function getData(): array {
['label' => Yii::t('mr42', 'QR Code Generator'), 'url' => ['/tools/qr']],
],
],
['label' => Yii::$app->icon->show('music', ['class' => 'mr-1']).Html::tag('span', Yii::t('mr42', 'Music')), 'url' => null,
['label' => Yii::$app->icon->show('music', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::t('mr42', 'Music')), 'url' => null,
'items' => [
['label' => Yii::t('mr42', 'Collection'), 'url' => ['/music/collection']],
['label' => Yii::t('mr42', 'Lyrics'), 'url' => ['/music/lyrics'], 'visible' => true],
],
],
['label' => Yii::$app->icon->show('share-alt', ['class' => 'mr-1']).Html::tag('span', Yii::$app->name), 'url' => null,
['label' => Yii::$app->icon->show('share-alt', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::$app->name), 'url' => null,
'items' => [
['label' => Yii::t('mr42', 'Contact'), 'url' => ['/my/contact']],
['label' => Yii::t('mr42', 'My Pi'), 'url' => ['/my/pi']],
@@ -86,7 +86,7 @@ private function getData(): array {
private function getUserMenu(): array {
if ($this->isGuest())
return [['label' => Yii::$app->icon->show('sign-in-alt', ['class' => 'mr-1']).Html::tag('span', Yii::t('usuario', 'Login')), 'url' => ['/user/security/login'], 'visible' => true]];
return [['label' => Yii::$app->icon->show('sign-in-alt', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::t('usuario', 'Login')), 'url' => ['/user/security/login'], 'visible' => true]];
if ($this->isAdmin()) :
$subMenu[] = ['label' => Yii::t('mr42', 'Create Article'), 'url' => ['/articles/create']];
@@ -104,7 +104,7 @@ private function getUserMenu(): array {
$unread = $this->isAdmin() ? ArticlesComments::find()->where(['not', ['active' => true]])->count() : 0;
$unreadBadge = $unread > 0 ? Html::tag('sup', $unread, ['class' => 'badge badge-info ml-1']) : '';
return [['label' => Yii::$app->icon->show('user-circle', ['class' => 'mr-1']).Html::tag('span', Yii::$app->user->identity->username.$unreadBadge), 'url' => null, 'items' => $subMenu]];
return [['label' => Yii::$app->icon->show('user-circle', ['class' => 'icon-fw mr-1']).Html::tag('span', Yii::$app->user->identity->username.$unreadBadge), 'url' => null, 'items' => $subMenu]];
}
private function isAdmin(): bool {
@@ -4,15 +4,17 @@
use yii\db\ActiveQuery;
class LyricsArtistInfo extends \yii\db\ActiveRecord {
public $summaryParsed;
public $bioSummaryParsed;
public $bioFullParsed;
public static function tableName(): string {
return '{{%lyrics_artistinfo}}';
}
public function afterFind(): void {
parent::afterFind();
$this->summaryParsed = Yii::$app->formatter->cleanInput($this->summary ?? '', 'gfm-comment', true);
$this->bioSummaryParsed = Yii::$app->formatter->cleanInput($this->bio_summary ?? '', 'gfm-comment', true);
$this->bioFullParsed = Yii::$app->formatter->cleanInput($this->bio_full ?? '', 'gfm-comment', true);
}
public static function find(): ActiveQuery {
@@ -18,7 +18,7 @@ public function display(int $userid): string {
return Item::widget([
'body' => RecentTracksWidget::widget(['tracks' => self::find()->where(['userid' => $userid])->orderBy(['count' => SORT_DESC])->limit($this->limit)->all()]),
'header' => Yii::$app->icon->show('lastfm-square', ['class' => 'mr-1', 'prefix' => 'fab fa-']).Yii::t('mr42', 'Recently Played Tracks'),
'header' => Yii::$app->icon->show('lastfm-square', ['class' => 'mr-1', 'style' => 'brands']).Yii::t('mr42', 'Recently Played Tracks'),
]);
}
@@ -3,20 +3,21 @@
use PHPUnit\Framework\TestCase;
class IconTest extends TestCase {
private $solidIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" class="fa w-14" data-icon="rss" data-prefix="fas" role="img"><path d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z" fill="currentColor"/></svg>';
private $brandIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" aria-hidden="true" class="fa w-16" data-icon="github" data-prefix="fab" role="img"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z" fill="currentColor"/></svg>';
private $fallbackIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" aria-hidden="true" class="fa w-16" data-icon="question-circle" data-prefix="fas" role="img"><path d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z" fill="currentColor"/></svg>';
private $iconWithClass = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" class="fa w-14 testClass" data-icon="align-justify" data-prefix="fas" role="img"><path d="M0 84V44c0-8.837 7.163-16 16-16h416c8.837 0 16 7.163 16 16v40c0 8.837-7.163 16-16 16H16c-8.837 0-16-7.163-16-16zm16 144h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 256h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0-128h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" fill="currentColor"/></svg>';
private $solidIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" class="icon icon-w-14" data-icon="rss" role="img"><path d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z" fill="currentColor"/></svg>';
private $solidIconFw = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" class="icon icon-w-14 icon-fw" data-icon="rss" role="img"><path d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z" fill="currentColor"/></svg>';
private $brandIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" aria-hidden="true" class="icon icon-w-16" data-icon="github" role="img"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z" fill="currentColor"/></svg>';
private $fallbackIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" aria-hidden="true" class="icon icon-w-16" data-icon="question-circle" role="img"><path d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z" fill="currentColor"/></svg>';
private $iconWithClass = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" class="icon icon-w-14 testClass" data-icon="align-justify" role="img"><path d="M0 84V44c0-8.837 7.163-16 16-16h416c8.837 0 16 7.163 16 16v40c0 8.837-7.163 16-16 16H16c-8.837 0-16-7.163-16-16zm16 144h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 256h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0-128h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" fill="currentColor"/></svg>';
public function testIcons() {
$this->assertEquals($this->solidIcon, \Yii::$app->icon->show('rss'));
$this->assertEquals($this->brandIcon, \Yii::$app->icon->show('github', ['prefix' => 'fab fa-']));
$this->assertEquals($this->brandIcon, \Yii::$app->icon->show('github', ['style' => 'brands']));
$this->assertEquals($this->fallbackIcon, \Yii::$app->icon->show('this.icon.does.not.exist'));
$this->assertEquals($this->fallbackIcon, \Yii::$app->icon->show('this.icon.does.not.exist', ['prefix' => 'fab fa-']));
$this->assertEquals($this->fallbackIcon, \Yii::$app->icon->show('this.icon.does.not.exist', ['style' => 'brands']));
$this->assertEquals($this->iconWithClass, \Yii::$app->icon->show('align-justify', ['class' => 'testClass']));
}
public function testFieldAddon() {
$this->assertEquals('<div class="input-group-prepend"><div class="input-group-text">'.$this->solidIcon.'</div></div>', \Yii::$app->icon->fieldAddon('rss'));
$this->assertEquals('<div class="input-group-prepend"><div class="input-group-text">'.$this->solidIconFw.'</div></div>', \Yii::$app->icon->fieldAddon('rss'));
}
}
Oops, something went wrong.

0 comments on commit 7ea4582

Please sign in to comment.
You can’t perform that action at this time.