Skip to content

Commit

Permalink
Use proper helper to mock feature state instead of mocking kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Apr 10, 2024
1 parent f005ebc commit e4094e7
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
namespace Hyde\Framework\Testing\Feature\Views;

use Hyde\Hyde;
use Hyde\Enums\Feature;
use Hyde\Facades\Features;
use Hyde\Testing\TestCase;
use Hyde\Foundation\HydeKernel;
use Hyde\Testing\TestsBladeViews;
use Hyde\Pages\DocumentationPage;

Expand Down Expand Up @@ -60,9 +59,7 @@ public function testSidebarBrandViewWithDefaultHeaderTextAndHomeRoute()

public function testSidebarBrandViewWithoutDarkmodeFeature()
{
$mock = $this->mock(HydeKernel::class)->makePartial();
$mock->shouldReceive('hasFeature')->with(Feature::Darkmode)->andReturn(false);
HydeKernel::setInstance($mock);
Features::mock('darkmode', false);

$view = $this->view(view('hyde::components.docs.sidebar-brand'));

Expand Down

0 comments on commit e4094e7

Please sign in to comment.