Skip to content

Commit f625e62

Browse files
author
Sébastien Nikolaou
committed
Add failing test for temporary signed URL with expires parameter
1 parent 176904e commit f625e62

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Integration/Routing/UrlSigningTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ public function testTemporarySignedUrls()
3939
$this->assertSame('invalid', $this->get($url)->original);
4040
}
4141

42+
public function testTemporarySignedUrlsWithExpiresParameter()
43+
{
44+
Route::get('/foo/{id}', function (Request $request, $id) {
45+
return $request->hasValidSignature() ? 'valid' : 'invalid';
46+
})->name('foo');
47+
48+
Carbon::setTestNow(Carbon::create(2018, 1, 1));
49+
$this->assertIsString($url = URL::temporarySignedRoute('foo', now()->addMinutes(5), ['id' => 1, 'expires' => 253402300799]));
50+
Carbon::setTestNow(Carbon::create(2018, 1, 1)->addMinutes(10));
51+
$this->assertSame('invalid', $this->get($url)->original);
52+
}
53+
4254
public function testSignedUrlWithUrlWithoutSignatureParameter()
4355
{
4456
Route::get('/foo/{id}', function (Request $request, $id) {

0 commit comments

Comments
 (0)