Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update file paths in FontAwesomeAsset classes. #3

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Css/FontAwesomeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class FontAwesomeAsset extends AssetBundle

public function init(): void
{
$this->css = YII_ENV === 'prod' ? ['/css/all.min.css'] : ['/css/all.css'];
$this->css = YII_ENV === 'prod' ? ['css/all.min.css'] : ['css/all.css'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/*']) : array_merge($this->css, ['/webfonts/*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Css/FontAwesomeBrandAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class FontAwesomeBrandAsset extends AssetBundle
public function __construct()
{
$this->css = YII_ENV === 'prod'
? ['/css/fontawesome.min.css', '/css/brands.min.css'] : ['/css/fontawesome.css', '/css/brands.css'];
? ['css/fontawesome.min.css', 'css/brands.min.css'] : ['css/fontawesome.css', 'css/brands.css'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/fa-brands*']) : array_merge($this->css, ['/webfonts/fa-brands*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Css/FontAwesomeRegularAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class FontAwesomeRegularAsset extends AssetBundle
public function __construct()
{
$this->css = YII_ENV === 'prod'
? ['/css/fontawesome.min.css', '/css/regular.min.css'] : ['/css/fontawesome.css', '/css/regular.css'];
? ['css/fontawesome.min.css', 'css/regular.min.css'] : ['css/fontawesome.css', 'css/regular.css'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/fa-regular*']) : array_merge($this->css, ['/webfonts/fa-regular*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Css/FontAwesomeSolidAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class FontAwesomeSolidAsset extends AssetBundle
public function __construct()
{
$this->css = YII_ENV === 'prod'
? ['/css/fontawesome.min.css', '/css/solid.min.css'] : ['/css/fontawesome.css', '/css/solid.css'];
? ['css/fontawesome.min.css', 'css/solid.min.css'] : ['css/fontawesome.css', 'css/solid.css'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/fa-solid*']) : array_merge($this->css, ['/webfonts/fa-solid*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Js/FontAwesomeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class FontAwesomeAsset extends AssetBundle

public function init(): void
{
$this->css = YII_ENV === 'prod' ? ['/js/all.min.js'] : ['/js/all.js'];
$this->css = YII_ENV === 'prod' ? ['js/all.min.js'] : ['js/all.js'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/*']) : array_merge($this->css, ['/webfonts/*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Js/FontAwesomeBrandAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class FontAwesomeBrandAsset extends AssetBundle
public function __construct()
{
$this->css = YII_ENV === 'prod'
? ['/js/fontawesome.min.js', '/js/brands.min.js'] : ['/js/fontawesome.js', '/js/brands.js'];
? ['js/fontawesome.min.js', 'js/brands.min.js'] : ['js/fontawesome.js', 'js/brands.js'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/fa-brands*']) : array_merge($this->css, ['/webfonts/fa-brands*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Js/FontAwesomeRegularAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class FontAwesomeRegularAsset extends AssetBundle
public function __construct()
{
$this->css = YII_ENV === 'prod'
? ['/js/fontawesome.min.js', '/js/regular.min.js'] : ['/js/fontawesome.js', '/js/regular.js'];
? ['js/fontawesome.min.js', 'js/regular.min.js'] : ['js/fontawesome.js', 'js/regular.js'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/fa-regular*']) : array_merge($this->css, ['/webfonts/fa-regular*']);
Expand Down
2 changes: 1 addition & 1 deletion src/Js/FontAwesomeSolidAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class FontAwesomeSolidAsset extends AssetBundle
public function __construct()
{
$this->css = YII_ENV === 'prod'
? ['/js/fontawesome.min.js', '/js/solid.min.js'] : ['/js/fontawesome.js', '/js/solid.js'];
? ['js/fontawesome.min.js', 'js/solid.min.js'] : ['js/fontawesome.js', 'js/solid.js'];

$this->publishOptions['only'] = YII_ENV === 'prod'
? array_merge($this->css, ['/webfonts/fa-solid*']) : array_merge($this->css, ['/webfonts/fa-solid*']);
Expand Down
66 changes: 14 additions & 52 deletions tests/AssetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,7 @@ public function testCssFontAwesomeAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/css/all.css" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/css/all.css', $result);
}

public function testCssFontAwesomeBrandAssetSimpleDependency(): void
Expand All @@ -197,13 +192,8 @@ public function testCssFontAwesomeBrandAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/css/fontawesome.css" rel="stylesheet">
<link href="/css/brands.css" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/css/fontawesome.css', $result);
$this->assertStringContainsString('/css/brands.css', $result);
}

public function testCssFontAwesomeRegularAssetSimpleDependency(): void
Expand All @@ -230,13 +220,8 @@ public function testCssFontAwesomeRegularAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/css/fontawesome.css" rel="stylesheet">
<link href="/css/regular.css" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/css/fontawesome.css', $result);
$this->assertStringContainsString('/css/regular.css', $result);
}

public function testCssFontAwesomeSolidAssetSimpleDependency(): void
Expand All @@ -263,13 +248,8 @@ public function testCssFontAwesomeSolidAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/css/fontawesome.css" rel="stylesheet">
<link href="/css/solid.css" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/css/fontawesome.css', $result);
$this->assertStringContainsString('/css/solid.css', $result);
}

public function testJsFontAwesomeAssetSimpleDependency(): void
Expand All @@ -296,12 +276,7 @@ public function testJsFontAwesomeAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/js/all.js" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/js/all.js', $result);
}

public function testJsFontAwesomeBrandAssetSimpleDependency(): void
Expand All @@ -328,13 +303,8 @@ public function testJsFontAwesomeBrandAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/js/fontawesome.js" rel="stylesheet">
<link href="/js/brands.js" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/js/fontawesome.js', $result);
$this->assertStringContainsString('/js/brands.js', $result);
}

public function testJsFontAwesomeRegularAssetSimpleDependency(): void
Expand All @@ -361,13 +331,8 @@ public function testJsFontAwesomeRegularAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
<link href="/js/fontawesome.js" rel="stylesheet">
<link href="/js/regular.js" rel="stylesheet">
HTML,
$result,
);
$this->assertStringContainsString('/js/fontawesome.js', $result);
$this->assertStringContainsString('/js/regular.js', $result);
}

public function testJsFontAwesomeSolidAssetSimpleDependency(): void
Expand All @@ -394,10 +359,7 @@ public function testJsFontAwesomeSolidAssetRegister(): void

$result = $view->renderFile(__DIR__ . '/Support/main.php');

$this->assertStringContainsString(
<<<HTML
HTML,
$result,
);
$this->assertStringContainsString('/js/fontawesome.js', $result);
$this->assertStringContainsString('/js/solid.js', $result);
}
}