Skip to content

Commit ee4ef96

Browse files
committed
Added testing for getFriendRequests
1 parent 508dcc7 commit ee4ef96

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

PAFLib/test/index.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,23 @@
4343
echo "<br>The name of the given player is: " . $givenPlayer->getName();
4444
echo "<br>The id of the given player is: " . $givenPlayer->getID();
4545
$friends = $givenPlayer->getFriends();
46-
echo "</br>Friends:";
46+
echo "</br>Friends: ";
4747
if (is_array($friends)) {
4848
foreach ($friends as $friend) {
4949
echo "<br> - " . $friend->getName();
5050
}
5151
} else {
5252
echo "The player does not have added friends yet.";
5353
}
54+
$friendRequests = $givenPlayer->getFriendRequests();
55+
echo "</br>Friend requests: ";
56+
if (is_array($friendRequests)) {
57+
foreach ($friendRequests as $friendRequests) {
58+
echo "<br> - " . $friendRequests->getName();
59+
}
60+
} else {
61+
echo "The player did not receive any friends requests.";
62+
}
5463
?>
5564
</body>
5665
</html>

0 commit comments

Comments
 (0)