Skip to content

Commit 066fd50

Browse files
committed
update FriendshipsTest.php to match new methods names
1 parent cdae801 commit 066fd50

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

tests/FriendshipsTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public function user_can_send_a_friend_request()
1414

1515
$sender->addFriend($recipient);
1616

17-
$this->assertCount(1, $recipient->friendRequestsTo());
18-
$this->assertCount(1, $sender->friendRequestsFrom());
17+
$this->assertCount(1, $recipient->friendRequestsReceived());
18+
$this->assertCount(1, $sender->friendRequestsSent());
1919

20-
$this->assertNotTrue( $sender->isFriendWith($recipient));
21-
$this->assertNotTrue( $recipient->isFriendWith($sender));
20+
$this->assertNotTrue( $sender->isFriendsWith($recipient));
21+
$this->assertNotTrue( $recipient->isFriendsWith($sender));
2222
}
2323

2424
/** @test */
@@ -31,7 +31,7 @@ public function user_can_not_send_a_friend_request_if_frienship_is_pending()
3131
$sender->addFriend($recipient);
3232
$sender->addFriend($recipient);
3333

34-
$this->assertCount(1, $recipient->friendRequestsTo());
34+
$this->assertCount(1, $recipient->friendRequestsReceived());
3535
}
3636

3737
/** @test */
@@ -43,10 +43,10 @@ public function user_can_send_a_friend_request_if_frienship_is_denied()
4343
$sender->addFriend($recipient);
4444

4545
$recipient->deleteFriend($sender);
46-
$this->assertCount(0, $recipient->friendRequestsTo());
46+
$this->assertCount(0, $recipient->friendRequestsReceived());
4747

4848
$sender->addFriend($recipient);
49-
$this->assertCount(1, $recipient->friendRequestsTo());
49+
$this->assertCount(1, $recipient->friendRequestsReceived());
5050
}
5151

5252
/** @test */
@@ -57,10 +57,10 @@ public function user_can_remove_a_friend_request()
5757

5858
$sender->addFriend($recipient);
5959
$sender->deleteFriend($recipient);
60-
$this->assertCount(0, $recipient->friendRequestsTo());
60+
$this->assertCount(0, $recipient->friendRequestsReceived());
6161

6262
$sender->addFriend($recipient);
63-
$this->assertCount(1, $recipient->friendRequestsTo());
63+
$this->assertCount(1, $recipient->friendRequestsReceived());
6464

6565
$recipient->acceptfriend($sender);
6666
$this->assertEquals('friends', $recipient->checkFriendship($sender));
@@ -87,8 +87,8 @@ public function user_can_not_send_a_friend_request_to_himself()
8787
$user = factory(User::class)->create();
8888
$user->addFriend($user);
8989

90-
$this->assertCount(0, $user->friendRequestsTo());
91-
$this->assertCount(0, $user->friendRequestsFrom());
90+
$this->assertCount(0, $user->friendRequestsReceived());
91+
$this->assertCount(0, $user->friendRequestsSent());
9292
}
9393

9494
/** @test */
@@ -103,8 +103,8 @@ public function user_is_friend_with_another_user_if_accepts_a_friend_request()
103103
$this->assertEquals('friends', $recipient->checkFriendship($sender));
104104
$this->assertEquals('friends', $sender->checkFriendship($recipient));
105105

106-
$this->assertTrue( $sender->isFriendWith($recipient));
107-
$this->assertTrue( $recipient->isFriendWith($sender));
106+
$this->assertTrue( $sender->isFriendsWith($recipient));
107+
$this->assertTrue( $recipient->isFriendsWith($sender));
108108
}
109109

110110
/** @test */
@@ -116,8 +116,8 @@ public function user_has_not_friend_request_from_if_he_accepted_the_friend_reque
116116
$sender->addFriend($recipient);
117117
$recipient->acceptFriend($sender);
118118

119-
$this->assertCount(0, $recipient->friendRequestsTo());
120-
$this->assertCount(0, $sender->friendRequestsFrom());
119+
$this->assertCount(0, $recipient->friendRequestsReceived());
120+
$this->assertCount(0, $sender->friendRequestsSent());
121121
}
122122

123123
/** @test */
@@ -184,8 +184,8 @@ public function it_returns_friend_requests_from_user()
184184

185185
$recipients[0]->acceptFriend($sender);
186186

187-
$this->assertCount(2, $sender->friendRequestsFrom());
188-
$this->containsOnlyInstancesOf(\App\User::class, $sender->friendRequestsFrom());
187+
$this->assertCount(2, $sender->friendRequestsSent());
188+
$this->containsOnlyInstancesOf(\App\User::class, $sender->friendRequestsSent());
189189
}
190190

191191
/** @test */
@@ -200,7 +200,7 @@ public function it_returns_friend_requests_to_user()
200200

201201
$recipient->acceptFriend($senders[0]);
202202

203-
$this->assertCount(2, $recipient->friendRequestsTo());
204-
$this->containsOnlyInstancesOf(\App\User::class, $recipient->friendRequestsTo());
203+
$this->assertCount(2, $recipient->friendRequestsReceived());
204+
$this->containsOnlyInstancesOf(\App\User::class, $recipient->friendRequestsReceived());
205205
}
206206
}

0 commit comments

Comments
 (0)