We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a755314 commit 0c30958Copy full SHA for 0c30958
src/Laravel/Tests/EloquentTest.php
@@ -447,6 +447,17 @@ public function testBelongsTo(): void
447
$this->assertEquals($json['sons'][0], '/api/grand_sons/1');
448
}
449
450
+ public function testHasMany(): void
451
+ {
452
+ GrandSonFactory::new()->count(1)->create();
453
+
454
+ $res = $this->get('/api/grand_fathers/1/grand_sons', ['Accept' => ['application/ld+json']]);
455
+ $json = $res->json();
456
+ $this->assertEquals($json['@id'], '/api/grand_fathers/1/grand_sons');
457
+ $this->assertEquals($json['totalItems'], 1);
458
+ $this->assertEquals($json['member'][0]['@id'], '/api/grand_sons/1');
459
+ }
460
461
public function testRelationIsHandledOnCreateWithNestedData(): void
462
{
463
$cartData = [
0 commit comments