-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1588 from hydephp/improved-view-testing
Improved view testing hydephp/develop@1ec4ca5
- Loading branch information
github-actions
committed
Feb 24, 2024
1 parent
830ad89
commit 59d0329
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Hyde\Framework\Testing\Feature\Views; | ||
|
||
use Hyde\Facades\Config; | ||
use Hyde\Testing\TestCase; | ||
use Hyde\Testing\TestsBladeViews; | ||
|
||
class SidebarFooterTextViewTest extends TestCase | ||
{ | ||
use TestsBladeViews; | ||
|
||
public function testSidebarFooterTextViewWithDefaultConfig() | ||
{ | ||
$view = $this->test(view('hyde::components.docs.sidebar-footer-text')); | ||
|
||
$view->assertSeeHtml('<a href="index.html">Back to home page</a>'); | ||
} | ||
|
||
public function testSidebarFooterTextViewWhenConfigOptionIsTrue() | ||
{ | ||
Config::set('docs.sidebar.footer', true); | ||
|
||
$view = $this->test(view('hyde::components.docs.sidebar-footer-text')); | ||
|
||
$view->assertSeeHtml('<a href="index.html">Back to home page</a>'); | ||
} | ||
|
||
public function testSidebarFooterTextViewWhenConfigOptionIsMarkdownString() | ||
{ | ||
Config::set('docs.sidebar.footer', 'Your Markdown String Here'); | ||
|
||
$view = $this->test(view('hyde::components.docs.sidebar-footer-text')); | ||
|
||
$view->assertSeeText('Your Markdown String Here'); | ||
} | ||
|
||
public function testSidebarFooterTextViewWhenConfigOptionIsFalse() | ||
{ | ||
// This state is handled earlier in the component by the sidebar component so we don't need to test it here. | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |