-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added two functions for unread messages in thread #110
Conversation
{ | ||
$messages = $this->messages()->get(); | ||
$participant = $this->getParticipantFromUser($user_id); | ||
if(!$participant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Expected 1 space after IF keyword; 0 found
- Inline control structures are not allowed
@Kenny11CZ thanks for the PR! I'll take a look at this over the weekend. Can you run this through the PSR2 formatter in the mean time? It would also be helpful to see some tests, but it's not required if you can't and/or don't have time. I can add them in later. |
@@ -307,16 +316,16 @@ protected function createSelectString($columns) | |||
switch ($dbDriver) { | |||
case 'pgsql': | |||
case 'sqlite': | |||
$columnString = implode(" || ' ' || " . $tablePrefix . $usersTable . '.', $columns); | |||
$selectString = '(' . $tablePrefix . $usersTable . '.' . $columnString . ') as name'; | |||
$columnString = implode(" || ' ' || ".$tablePrefix.$usersTable.'.', $columns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 16 spaces, found 12
So PSR-2 format is done, but i don't know how to do the test... Link me some websites, and I'll look at it. |
@Kenny11CZ Something like free video tutorial about unit testing or try to look for others by the word |
@@ -285,4 +285,61 @@ public function it_should_check_users_and_participants() | |||
$this->assertTrue($thread->hasParticipant(2)); | |||
$this->assertFalse($thread->hasParticipant(3)); | |||
} | |||
|
|||
public function it_should_get_all_unread_messages_for_user() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name EloquentThreadTest::it_should_get_all_unread_messages_for_user
is not in camel caps format
So, I have added tests to QloquentThreadTest file. But i don't have clean laravel instalation so I can't run it... Can someone check it, if it is alright? For today I go sleep, it's 3am and I am very sleepy. gn.. |
@Kenny11CZ can you please run: |
Yeeeey, finaly made it merge-able... |
It would be great to see this merged. |
Added functions for unread messages in thread model
I'm going to merge this in, but I'm going to keep it in |
Added functions for unread messages in thread model
#80 #109
Two new functions:
userUnreadMessages($user_id)
userUnreadMessagesCount($user_i