File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
tests/Integration/Database Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 44
55namespace Tests \Tempest \Integration \Database ;
66
7+ use Tempest \Database \BelongsTo ;
78use Tempest \Database \DatabaseMigration ;
89use Tempest \Database \Exceptions \ModelDidNotHavePrimaryColumn ;
910use Tempest \Database \HasOne ;
@@ -259,7 +260,7 @@ public function test_load_with_relation_works_for_models_with_id(): void
259260 );
260261
261262 model (TestProfile::class)->create (
262- user_id : $ user-> id -> value ,
263+ user : $ user ,
263264 bio: 'Ancient elf mage who loves magic and collecting spells ' ,
264265 age: 1000 ,
265266 );
@@ -330,11 +331,10 @@ final class TestProfile
330331
331332 public ?PrimaryKey $ id = null ;
332333
333- #[HasOne ]
334+ #[BelongsTo(ownerJoin: ' user_id ' ) ]
334335 public ?TestUser $ user ;
335336
336337 public function __construct (
337- public int $ user_id ,
338338 public string $ bio ,
339339 public int $ age ,
340340 ) {}
You can’t perform that action at this time.
0 commit comments