userclass promotion takes into account spent request votes

This commit is contained in:
Spine
2024-01-23 10:01:21 +00:00
parent 7a1f29637f
commit 092f2fce2b
10 changed files with 169 additions and 37 deletions

View File

@@ -230,6 +230,16 @@ class UserTest extends TestCase {
$this->assertNull($this->user->title(), 'utest-null-title');
}
public function testUpDown(): void {
$this->assertEquals(STARTING_UPLOAD, $this->user->uploadedSize(), 'utest-initial-up');
$this->assertEquals(0, $this->user->downloadedSize(), 'utest-initial-down');
$this->user->setField('leech_upload', STARTING_UPLOAD * 4)
->setField('leech_download', STARTING_UPLOAD * 2)
->modify();
$this->assertEquals(STARTING_UPLOAD * 4, $this->user->uploadedSize(), 'utest-modified-up');
$this->assertEquals(STARTING_UPLOAD * 2, $this->user->downloadedSize(), 'utest-modified-down');
}
public function testAvatar(): void {
$userMan = new \Gazelle\Manager\User;
$this->assertEquals('', $this->user->avatar(), 'utest-avatar-blank');