mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-07-14 02:01:31 -04:00
22 lines
694 B
PHP
22 lines
694 B
PHP
<?php
|
|
|
|
namespace Gazelle;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class UserRankTest extends TestCase {
|
|
public function testUserRank(): void {
|
|
$weights = array_intersect_key(RANKING_WEIGHT, ['uploaded' => 1, 'downloaded' => 1]);
|
|
$userRank = new UserRank(
|
|
new UserRank\Configuration($weights),
|
|
[
|
|
'downloaded' => 0,
|
|
'uploaded' => STARTING_UPLOAD,
|
|
],
|
|
);
|
|
$this->assertSame(0, $userRank->score(), 'userrank-score');
|
|
$this->assertSame(0, $userRank->rank('uploaded'), 'userrank-uploaded');
|
|
$this->assertSame(STARTING_UPLOAD, $userRank->raw('uploaded'), 'userrank-raw-uploaded');
|
|
}
|
|
}
|