Skip to content

Commit ee2c71e

Browse files
committed
test: route model binding without a prefix
1 parent abcc448 commit ee2c71e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/RouteModelBindingTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
->assertContent(value: $customer->name);
1313
});
1414

15+
it('can bind a model from a sqid without a prefix', function (): void {
16+
config()->set('sqids.prefix_class');
17+
18+
$customer = CustomerFactory::new()->create();
19+
20+
$this
21+
->get(uri: "/customers/{$customer->sqid}")
22+
->assertContent(value: $customer->name);
23+
});
24+
1525
it('returns a 404 if the sqid is invalid', function (): void {
1626
$this
1727
->get(uri: "/customers/invalid-sqid")

0 commit comments

Comments
 (0)