Skip to content

Commit

Permalink
update FriendshipsTest.php to match new methods names
Browse files Browse the repository at this point in the history
  • Loading branch information
merodiro committed Dec 1, 2017
1 parent cdae801 commit 066fd50
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/FriendshipsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand All @@ -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 */
Expand All @@ -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));
Expand All @@ -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 */
Expand All @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand All @@ -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());
}
}

0 comments on commit 066fd50

Please sign in to comment.