Skip to content

Commit 8988538

Browse files
committed
Merge pull request #38 from chrispitt/add-some-tests
Fixed that last batch.
2 parents 535b3fb + 72c6cd4 commit 8988538

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/Tricks/Repositories/Eloquent/ProfileRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function createFromGithubData(OAuthUser $details, User $user, $token)
5353
$profile->description = $details->description;
5454
$profile->image_url = $details->imageUrl;
5555
$profile->access_token = $token;
56-
$profile->user = $user;
56+
$profile->user_id = $user->id;
5757

5858
$profile->save();
5959

app/tests/Tricks/Repositories/Eloquent/ProfileRepositoryTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public function testCreateFromGithubData()
6464
$userMock = Mockery::mock('Tricks\User')
6565
->makePartial();
6666

67+
$userMock->id = 1;
68+
6769
$profileMock = Mockery::mock('Tricks\Profile')
6870
->makePartial();
6971

@@ -106,8 +108,8 @@ public function testCreateFromGithubData()
106108
);
107109

108110
$this->assertSame(
109-
$userMock,
110-
$profileMock->user
111+
$userMock->id,
112+
$profileMock->user_id
111113
);
112114
}
113115

0 commit comments

Comments
 (0)