public function testRelationshipWithBinUuid() { $firstUser = EloquentBinUserModel::create(['username' => 'first-user', 'password' => 'secret']); $secondUser = EloquentBinUserModel::create(['username' => 'second-user', 'password' => 'secret']); $postsForFirstUser = []; $postsForSecondUser = []; for ($i = 0; $i < 10; $i++) { $postsForFirstUser[] = new EloquentBinPostModel(['name' => 'First user - post ' . $i]); $postsForSecondUser[] = EloquentBinPostModel::create(['name' => 'Second user - post ' . $i, 'user_id' => $secondUser->id]); } $firstUser->posts()->saveMany($postsForFirstUser); $this->assertEquals(10, $firstUser->posts()->count()); $this->assertEquals(10, $secondUser->posts()->count()); $foundUser = EloquentBinUserModel::with('posts')->find($firstUser->id); $this->assertNotNull($foundUser); $this->assertEquals(10, count($foundUser->posts)); }