File tree Expand file tree Collapse file tree 4 files changed +34
-28
lines changed
Expand file tree Collapse file tree 4 files changed +34
-28
lines changed Original file line number Diff line number Diff line change 44
55use Illuminate \Support \Facades \View ;
66use Qirolab \Theme \Theme ;
7+ use Qirolab \Theme \ThemeServiceProvider ;
78
89class ClearThemeTest extends TestCase
910{
10- /**
11- * Define environment setup.
12- *
13- * @param \Illuminate\Foundation\Application $app
14- * @return void
15- */
16- protected function getEnvironmentSetUp ($ app )
11+ protected function getPackageProviders ($ app )
1712 {
1813 $ app ['config ' ]->set ('theme.active ' , 'child-theme ' );
1914 $ app ['config ' ]->set ('theme.parent ' , 'parent-theme ' );
15+
16+ return [
17+ ThemeServiceProvider::class,
18+ ];
2019 }
2120
2221 /** @test **/
Original file line number Diff line number Diff line change 44
55use Illuminate \Support \Facades \View ;
66use Qirolab \Theme \Theme ;
7+ use Qirolab \Theme \ThemeServiceProvider ;
78
89class ParentThemeTest extends TestCase
910{
10- /**
11- * Define environment setup.
12- *
13- * @param \Illuminate\Foundation\Application $app
14- * @return void
15- */
16- protected function getEnvironmentSetUp ($ app )
11+ protected function getPackageProviders ($ app )
1712 {
1813 $ app ['config ' ]->set ('theme.active ' , 'child-theme ' );
1914 $ app ['config ' ]->set ('theme.parent ' , 'parent-theme ' );
15+
16+ return [
17+ ThemeServiceProvider::class,
18+ ];
2019 }
2120
2221 /** @test **/
Original file line number Diff line number Diff line change 55use Illuminate \Support \Facades \Route ;
66use Qirolab \Theme \Middleware \ThemeMiddleware ;
77use Qirolab \Theme \Theme ;
8+ use Qirolab \Theme \ThemeServiceProvider ;
89
910class ThemeMiddlewareTest extends TestCase
1011{
@@ -21,16 +22,14 @@ public function setUp(): void
2122 })->middleware ('theme:frontend,parent ' );
2223 }
2324
24- /**
25- * Define environment setup.
26- *
27- * @param \Illuminate\Foundation\Application $app
28- * @return void
29- */
30- protected function getEnvironmentSetUp ($ app )
25+ protected function getPackageProviders ($ app )
3126 {
3227 $ app ['router ' ]->aliasMiddleware ('theme ' , ThemeMiddleware::class);
3328 $ app ['config ' ]->set ('theme.active ' , 'default ' );
29+
30+ return [
31+ ThemeServiceProvider::class,
32+ ];
3433 }
3534
3635 /** @test **/
Original file line number Diff line number Diff line change 44
55use Illuminate \Support \Facades \View ;
66use Qirolab \Theme \Theme ;
7+ use Qirolab \Theme \ThemeServiceProvider ;
78use Qirolab \Theme \ThemeViewFinder ;
89
910class ThemeTest extends TestCase
1011{
11- /**
12- * Define environment setup.
13- *
14- * @param \Illuminate\Foundation\Application $app
15- * @return void
16- */
17- protected function getEnvironmentSetUp ($ app )
12+ protected function getPackageProviders ($ app )
1813 {
1914 $ app ['config ' ]->set ('theme.active ' , 'default ' );
15+
16+ return [
17+ ThemeServiceProvider::class,
18+ ];
2019 }
2120
2221 /** @test **/
@@ -117,4 +116,14 @@ public function on_change_view_finder_active_theme_returns_null()
117116
118117 $ this ->assertNull (Theme::active ());
119118 }
119+
120+ /** @test **/
121+ public function it_returns_all_view_paths ()
122+ {
123+ $ this ->assertCount (2 , Theme::getViewPaths ());
124+
125+ Theme::set ('child ' , 'parent ' );
126+
127+ $ this ->assertCount (3 , Theme::getViewPaths ());
128+ }
120129}
You can’t perform that action at this time.
0 commit comments