Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyPradana committed Oct 14, 2023
1 parent 50fba7a commit e5d1248
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/Http/RedirectResponseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use PHPUnit\Framework\TestCase;
use System\Http\RedirectResponse;
use System\Integrate\Testing\TestResponse;

class RedirectResponseTest extends TestCase
{
/** @test */
public function itCanGetResponeContent()
{
$res = new RedirectResponse('/login');
$redirect = new TestResponse($res);

$redirect->assertSee('Redirecting to /login');
$redirect->assertStatusCode(302);

foreach ($res->getHeaders() as $key => $value) {
if ('Location' === $key) {
$this->assertEquals('/login', $value);
}
}
}
}

0 comments on commit e5d1248

Please sign in to comment.