From 066fd50dc41dfe452dc2455e6f5742d52883c0fb Mon Sep 17 00:00:00 2001 From: "Amr A.Mohammed" Date: Fri, 1 Dec 2017 10:53:30 +0200 Subject: [PATCH] update FriendshipsTest.php to match new methods names --- tests/FriendshipsTest.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/FriendshipsTest.php b/tests/FriendshipsTest.php index e3450dc..e709305 100644 --- a/tests/FriendshipsTest.php +++ b/tests/FriendshipsTest.php @@ -14,11 +14,11 @@ public function user_can_send_a_friend_request() $sender->addFriend($recipient); - $this->assertCount(1, $recipient->friendRequestsTo()); - $this->assertCount(1, $sender->friendRequestsFrom()); + $this->assertCount(1, $recipient->friendRequestsReceived()); + $this->assertCount(1, $sender->friendRequestsSent()); - $this->assertNotTrue( $sender->isFriendWith($recipient)); - $this->assertNotTrue( $recipient->isFriendWith($sender)); + $this->assertNotTrue( $sender->isFriendsWith($recipient)); + $this->assertNotTrue( $recipient->isFriendsWith($sender)); } /** @test */ @@ -31,7 +31,7 @@ public function user_can_not_send_a_friend_request_if_frienship_is_pending() $sender->addFriend($recipient); $sender->addFriend($recipient); - $this->assertCount(1, $recipient->friendRequestsTo()); + $this->assertCount(1, $recipient->friendRequestsReceived()); } /** @test */ @@ -43,10 +43,10 @@ public function user_can_send_a_friend_request_if_frienship_is_denied() $sender->addFriend($recipient); $recipient->deleteFriend($sender); - $this->assertCount(0, $recipient->friendRequestsTo()); + $this->assertCount(0, $recipient->friendRequestsReceived()); $sender->addFriend($recipient); - $this->assertCount(1, $recipient->friendRequestsTo()); + $this->assertCount(1, $recipient->friendRequestsReceived()); } /** @test */ @@ -57,10 +57,10 @@ public function user_can_remove_a_friend_request() $sender->addFriend($recipient); $sender->deleteFriend($recipient); - $this->assertCount(0, $recipient->friendRequestsTo()); + $this->assertCount(0, $recipient->friendRequestsReceived()); $sender->addFriend($recipient); - $this->assertCount(1, $recipient->friendRequestsTo()); + $this->assertCount(1, $recipient->friendRequestsReceived()); $recipient->acceptfriend($sender); $this->assertEquals('friends', $recipient->checkFriendship($sender)); @@ -87,8 +87,8 @@ public function user_can_not_send_a_friend_request_to_himself() $user = factory(User::class)->create(); $user->addFriend($user); - $this->assertCount(0, $user->friendRequestsTo()); - $this->assertCount(0, $user->friendRequestsFrom()); + $this->assertCount(0, $user->friendRequestsReceived()); + $this->assertCount(0, $user->friendRequestsSent()); } /** @test */ @@ -103,8 +103,8 @@ public function user_is_friend_with_another_user_if_accepts_a_friend_request() $this->assertEquals('friends', $recipient->checkFriendship($sender)); $this->assertEquals('friends', $sender->checkFriendship($recipient)); - $this->assertTrue( $sender->isFriendWith($recipient)); - $this->assertTrue( $recipient->isFriendWith($sender)); + $this->assertTrue( $sender->isFriendsWith($recipient)); + $this->assertTrue( $recipient->isFriendsWith($sender)); } /** @test */ @@ -116,8 +116,8 @@ public function user_has_not_friend_request_from_if_he_accepted_the_friend_reque $sender->addFriend($recipient); $recipient->acceptFriend($sender); - $this->assertCount(0, $recipient->friendRequestsTo()); - $this->assertCount(0, $sender->friendRequestsFrom()); + $this->assertCount(0, $recipient->friendRequestsReceived()); + $this->assertCount(0, $sender->friendRequestsSent()); } /** @test */ @@ -184,8 +184,8 @@ public function it_returns_friend_requests_from_user() $recipients[0]->acceptFriend($sender); - $this->assertCount(2, $sender->friendRequestsFrom()); - $this->containsOnlyInstancesOf(\App\User::class, $sender->friendRequestsFrom()); + $this->assertCount(2, $sender->friendRequestsSent()); + $this->containsOnlyInstancesOf(\App\User::class, $sender->friendRequestsSent()); } /** @test */ @@ -200,7 +200,7 @@ public function it_returns_friend_requests_to_user() $recipient->acceptFriend($senders[0]); - $this->assertCount(2, $recipient->friendRequestsTo()); - $this->containsOnlyInstancesOf(\App\User::class, $recipient->friendRequestsTo()); + $this->assertCount(2, $recipient->friendRequestsReceived()); + $this->containsOnlyInstancesOf(\App\User::class, $recipient->friendRequestsReceived()); } }