Skip to content

Commit fa0ec49

Browse files
This should fail in the CI
1 parent 2e367d4 commit fa0ec49

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/UserAgentTest.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* Contains the UserAgentTest class.
7+
*
8+
* @copyright Copyright (c) 2024 Attila Fulop
9+
* @author Attila Fulop
10+
* @license MIT
11+
* @since 2024-12-13
12+
*
13+
*/
14+
15+
namespace Konekt\History\Tests;
16+
17+
use Illuminate\Http\Request;
18+
use Konekt\History\History;
19+
use Konekt\History\Tests\Dummies\SampleTask;
20+
21+
class UserAgentTest extends TestCase
22+
{
23+
private const STUPID_UA_STRING = 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/21G93 [FBAN/FBIOS;FBAV/492.0.0.101.111;FBBV/670308045;FBDV/iPhone14,5;FBMD/iPhone;FBSN/iOS;FBSV/17.6.1;FBSS/3;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/673456666]';
24+
25+
/** @test */
26+
public function this_should_fail_with_postgres_at_least()
27+
{
28+
$request = Request::create('/example-route', 'GET', [], [], [], [
29+
'HTTP_USER_AGENT' => self::STUPID_UA_STRING,
30+
]);
31+
app()->forgetInstance('request');
32+
app()->singleton('request', fn () => $request);
33+
34+
$task = SampleTask::create(['title' => 'Task With a stupid Browser Agent String', 'status' => 'in-progress']);
35+
$entry = History::begin($task);
36+
$entry = $entry->fresh();
37+
38+
$this->assertEquals(self::STUPID_UA_STRING, $entry->user_agent);
39+
}
40+
41+
}

0 commit comments

Comments
 (0)