Skip to content

Commit

Permalink
Assert that response is instance of TimberResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
joelambert committed Mar 20, 2024
1 parent 8e0f530 commit d6cba01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/Unit/Http/Middleware/PasswordProtectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Rareloop\Lumberjack\Http\Middleware\PasswordProtected;
use Rareloop\Lumberjack\Http\Responses\TimberResponse;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;

/**
Expand Down Expand Up @@ -108,8 +109,10 @@ public function it_renders_the_password_template_when_needed()
$handler->shouldReceive('handle')->never();

$middleware = new PasswordProtected;
$response = $middleware->process($request, $handler);

$this->assertSame('testing123', $middleware->process($request, $handler)->getBody()->getContents());
$this->assertInstanceOf(TimberResponse::class, $response);
$this->assertSame('testing123', $response->getBody()->getContents());
$this->assertTrue(Filters\applied('lumberjack/password_protect_template') > 0);
}
}

0 comments on commit d6cba01

Please sign in to comment.