44
55declare (strict_types=1 );
66
7- namespace Hyde \Framework \Testing \Feature ;
7+ namespace Hyde \Framework \Testing \Feature \ Views ;
88
9- use Hyde \Framework \Features \Navigation \DocumentationSidebar ;
10- use Hyde \Hyde ;
9+ use Throwable ;
1110use Hyde \Testing \TestCase ;
1211use Illuminate \Contracts \View \View ;
13- use Throwable ;
12+ use Hyde \ Framework \ Features \ Navigation \ DocumentationSidebar ;
1413
1514/**
1615 * Very high level test of the sidebar views and their combinations of layouts.
@@ -39,8 +38,7 @@ public function testBaseSidebar()
3938 ->assertSeeHtml ('<a href="index.html">Back to home page</a> ' )
4039 ->assertSeeHtml ('<span class="sr-only">Toggle dark theme</span> ' )
4140 ->assertDontSee ('<a href="docs/index.html"> ' )
42- ->assertDontSee ('<li class="sidebar-item ' )
43- ->allGood ();
41+ ->assertDontSee ('<li class="sidebar-item ' );
4442
4543 $ this ->assertViewWasRendered (view ('hyde::components.docs.sidebar-items ' , [
4644 'sidebar ' => DocumentationSidebar::create (),
@@ -66,8 +64,7 @@ public function testBaseSidebarWithCustomFooterText()
6664 $ this ->renderComponent (view ('hyde::components.docs.sidebar ' ))
6765 ->assertSeeHtml ('<footer id="sidebar-footer" ' )
6866 ->assertSeeHtml ('<p>My <strong>Markdown</strong> Footer Text</p> ' )
69- ->assertDontSee ('Back to home page ' )
70- ->allGood ();
67+ ->assertDontSee ('Back to home page ' );
7168 }
7269
7370 public function testBaseSidebarCustomHeaderBrand ()
@@ -76,8 +73,7 @@ public function testBaseSidebarCustomHeaderBrand()
7673
7774 $ this ->renderComponent (view ('hyde::components.docs.sidebar ' ))
7875 ->assertSeeText ('My Custom Header ' )
79- ->assertDontSee ('HydePHP Docs ' )
80- ->allGood ();
76+ ->assertDontSee ('HydePHP Docs ' );
8177
8278 $ this ->assertViewWasRendered (view ('hyde::components.docs.sidebar-brand ' ));
8379 }
@@ -92,8 +88,7 @@ public function testBaseSidebarWithItems()
9288 ->assertSeeHtml ('<a href="docs/index.html"> ' )
9389 ->assertSeeHtml ('<nav id="sidebar-navigation" ' )
9490 ->assertSeeHtml ('<ul id="sidebar-items" role="list" class="pl-2"> ' )
95- ->assertSeeHtml ('<li class="sidebar-item ' )
96- ->allGood ();
91+ ->assertSeeHtml ('<li class="sidebar-item ' );
9792
9893 $ this ->assertViewWasRendered (view ('hyde::components.docs.sidebar-items ' , [
9994 'sidebar ' => DocumentationSidebar::create (),
@@ -120,8 +115,7 @@ public function testSidebarWithGroupedItems()
120115 ->assertSeeHtml ('class="sidebar-group-toggle ' )
121116 ->assertSeeHtml ('class="sidebar-group-toggle-icon ' )
122117 ->assertSeeHtml ('class="sidebar-group-items ' )
123- ->assertSee ('groupOpen ' )
124- ->allGood ();
118+ ->assertSee ('groupOpen ' );
125119
126120 $ this ->assertViewWasRendered (view ('hyde::components.docs.sidebar-items ' , [
127121 'sidebar ' => DocumentationSidebar::create (),
@@ -152,8 +146,7 @@ public function testSidebarWithNonCollapsibleGroupedItems()
152146 ->assertSeeHtml ('class="sidebar-group-items ' )
153147 ->assertDontSee ('sidebar-group-toggle ' )
154148 ->assertDontSee ('sidebar-group-toggle-icon ' )
155- ->assertDontSee ('groupOpen ' )
156- ->allGood ();
149+ ->assertDontSee ('groupOpen ' );
157150
158151 $ this ->assertViewWasRendered (view ('hyde::components.docs.sidebar-items ' , [
159152 'sidebar ' => DocumentationSidebar::create (),
@@ -167,16 +160,7 @@ protected function renderComponent(View $view): self
167160 {
168161 try {
169162 $ this ->html = $ view ->render ();
170- /** @noinspection LaravelFunctionsInspection */
171- if (env ('TEST_HTML_DEBUG ' , false )) {
172- file_put_contents (Hyde::path ('_site/test.html ' ), $ this ->html );
173- echo "\e[0;32mCreated file: \e[0m " .realpath (Hyde::path ('_site/test.html ' ));
174- }
175163 } catch (Throwable $ exception ) {
176- /** @noinspection LaravelFunctionsInspection */
177- if (env ('TEST_HTML_DEBUG ' , false )) {
178- throw $ exception ;
179- }
180164 $ this ->fail ($ exception ->getMessage ());
181165 }
182166
@@ -226,11 +210,4 @@ protected function assertDontSee(string $text): self
226210
227211 return $ this ;
228212 }
229-
230- protected function allGood (): self
231- {
232- // Just an empty helper so we get easier Git diffs when adding new assertions.
233-
234- return $ this ;
235- }
236213}
0 commit comments