Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Feb 14, 2025
1 parent b34d49f commit f92ad02
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/Routing/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tests\Routing;

use Exception;
use Facades\Tests\Factories\EntryFactory;
use Illuminate\Support\Facades\Route;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down Expand Up @@ -166,11 +165,14 @@ public function it_renders_a_view_using_a_data_closure()
#[Test]
public function it_throws_exception_if_you_try_to_pass_data_parameter_when_using_view_closure()
{
$this->withoutExceptionHandling();
$this->expectException(Exception::class);
$this->expectExceptionMessage('Parameter [$data] not supported with [$view] closure!');
$this->viewShouldReturnRaw('layout', '{{ template_content }}');
$this->viewShouldReturnRaw('test', 'Hello {{ hello }}');

$response = $this
->get('/you-cannot-use-data-param-with-view-closure')
->assertInternalServerError();

$this->get('/you-cannot-use-data-param-with-view-closure');
$this->assertEquals('Parameter [$data] not supported with [$view] closure!', $response->exception->getMessage());
}

#[Test]
Expand Down

0 comments on commit f92ad02

Please sign in to comment.