->select('*')
->from($this->tableName)
->orderBy('status_timestamp', 'DESC')
- ->where($qb->expr()->notIn('status', $qb->createNamedParameter([StatusService::ONLINE, StatusService::AWAY], IQueryBuilder::PARAM_STR_ARRAY)))
+ ->where($qb->expr()->notIn('status', $qb->createNamedParameter([StatusService::ONLINE, StatusService::AWAY, StatusService::OFFLINE], IQueryBuilder::PARAM_STR_ARRAY)))
->orWhere($qb->expr()->isNotNull('message_id'))
->orWhere($qb->expr()->isNotNull('custom_icon'))
->orWhere($qb->expr()->isNotNull('custom_message'));
$allResults = $this->mapper->findAllRecent(2, 0);
$this->assertCount(2, $allResults);
- $this->assertEquals('user1', $allResults[0]->getUserId());
- $this->assertEquals('user2', $allResults[1]->getUserId());
+ $this->assertEquals('user2', $allResults[0]->getUserId());
+ $this->assertEquals('user1', $allResults[1]->getUserId());
}
public function testGetFind(): void {
$user2Status = $this->mapper->findByUserId('user2');
$this->assertEquals('user2', $user2Status->getUserId());
$this->assertEquals('away', $user2Status->getStatus());
- $this->assertEquals(5000, $user2Status->getStatusTimestamp());
+ $this->assertEquals(6000, $user2Status->getStatusTimestamp());
$this->assertEquals(false, $user2Status->getIsUserDefined());
$this->assertEquals('🏝', $user2Status->getCustomIcon());
$this->assertEquals('On vacation', $user2Status->getCustomMessage());
$user2Status = $statuses[1];
$this->assertEquals('user2', $user2Status->getUserId());
$this->assertEquals('away', $user2Status->getStatus());
- $this->assertEquals(5000, $user2Status->getStatusTimestamp());
+ $this->assertEquals(6000, $user2Status->getStatusTimestamp());
$this->assertEquals(false, $user2Status->getIsUserDefined());
$this->assertEquals('🏝', $user2Status->getCustomIcon());
$this->assertEquals('On vacation', $user2Status->getCustomMessage());
$userStatus3 = new UserStatus();
$userStatus3->setUserId('user2');
$userStatus3->setStatus('away');
- $userStatus3->setStatusTimestamp(5000);
+ $userStatus3->setStatusTimestamp(6000);
$userStatus3->setIsUserDefined(false);
$userStatus3->setCustomIcon('🏝');
$userStatus3->setCustomMessage('On vacation');