diff --git a/app/PM.php b/app/PM.php index 771b0c223..0f31fd032 100644 --- a/app/PM.php +++ b/app/PM.php @@ -17,7 +17,7 @@ class PM extends Base { protected array $info; public function __construct( - protected int $id, + public readonly int $id, protected User $user ) {} diff --git a/tests/phpunit/ApplicantTest.php b/tests/phpunit/ApplicantTest.php index 17544d45f..5f1af3a10 100644 --- a/tests/phpunit/ApplicantTest.php +++ b/tests/phpunit/ApplicantTest.php @@ -44,14 +44,14 @@ class ApplicantTest extends TestCase { $published = $this->roleList[] = $roleManager->create($title, 'this is a phpunit role', true, $this->userList['admin']); $this->assertInstanceOf(ApplicantRole::class, $published, 'applicant-role-instance'); - $this->assertEquals('apply.php?action=view&id=' . $published->id(), $published->location(), 'applicant-role-location'); + $this->assertEquals('apply.php?action=view&id=' . $published->id, $published->location(), 'applicant-role-location'); $this->assertStringContainsString(html_escape($published->location()), $published->link(), 'applicant-role-link'); $this->assertTrue(Helper::recentDate($published->created()), 'applicant-role-created'); $this->assertEquals($published->created(), $published->modified(), 'applicant-role-modified'); $this->assertEquals($title, $published->title(), 'applicant-role-title'); $this->assertEquals('this is a phpunit role', $published->description(), 'applicant-role-description'); $this->assertTrue($published->isPublished(), 'applicant-role-is-published'); - $this->assertEquals($this->userList['admin']->id(), $published->userId(), 'applicant-role-creator'); + $this->assertEquals($this->userList['admin']->id, $published->userId(), 'applicant-role-creator'); $this->assertCount($totalPublished + 1, $roleManager->publishedList(), 'applicant-role-total-published'); $this->assertCount($total + 1, $roleManager->list(), 'applicant-role-total-all'); @@ -62,11 +62,11 @@ class ApplicantTest extends TestCase { $this->assertInstanceOf(Applicant::class, $apply, 'applicant-instance'); $this->assertInstanceOf(Thread::class, $apply->thread(), 'applicant-thread'); $this->assertTrue($manager->userIsApplicant($this->userList['user']), 'applicant-user-applied'); - $this->assertEquals('apply.php?action=view&id=' . $apply->id(), $apply->location(), 'applicant-location'); + $this->assertEquals('apply.php?action=view&id=' . $apply->id, $apply->location(), 'applicant-location'); $this->assertStringContainsString(html_escape($apply->location()), $apply->link(), 'applicant-link'); $this->assertTrue(Helper::recentDate($apply->created()), 'applicant-role-created'); - $this->assertEquals($this->userList['user']->id(), $apply->userId(), 'applicant-user-id'); - $this->assertEquals($apply->threadId(), $apply->thread()->id(), 'applicant-thread-id'); + $this->assertEquals($this->userList['user']->id, $apply->userId(), 'applicant-user-id'); + $this->assertEquals($apply->threadId(), $apply->thread()->id, 'applicant-thread-id'); $this->assertEquals($apply->role()->title(), $published->title(), 'applicant-title'); $this->assertEquals('application message', $apply->body(), 'applicant-body'); $this->assertFalse($apply->isResolved(), 'applicant-is-not-resolved'); @@ -123,7 +123,7 @@ class ApplicantTest extends TestCase { $roleManager->create('phpunit ' . randomString(6), 'this is a phpunit basic role', true, $this->userList['admin']); $basic->setField('viewer_list', '@' . $this->userList['mod']->username()); $this->assertTrue($basic->modify(), 'applicant-role-add-viewer'); - $this->assertEquals([$this->userList['mod']->id()], $basic->viewerList(), 'applicant-role-viewer-list'); + $this->assertEquals([$this->userList['mod']->id], $basic->viewerList(), 'applicant-role-viewer-list'); $this->roleList[] = $admin = $roleManager->create('phpunit ' . randomString(6), 'this is a phpunit admin role', true, $this->userList['admin']); diff --git a/tests/phpunit/BaseObjectTest.php b/tests/phpunit/BaseObjectTest.php index 0cf507ff1..968a03abf 100644 --- a/tests/phpunit/BaseObjectTest.php +++ b/tests/phpunit/BaseObjectTest.php @@ -46,7 +46,7 @@ class BaseObjectTest extends TestCase { $this->objectList[] = Helper::makeUser('bo.' . randomString(6), 'base object'); $this->objectList[] = Helper::makeUser('bo.' . randomString(6), 'base object'); - $idList = array_map(fn($obj) => $obj->id(), $this->objectList); + $idList = array_map(fn($obj) => $obj->id, $this->objectList); $gen = object_generator(new Manager\User(), $idList); $n = 0; foreach ($gen as $user) { diff --git a/tests/phpunit/CollageTest.php b/tests/phpunit/CollageTest.php index 091c932c1..68ea5f1bd 100644 --- a/tests/phpunit/CollageTest.php +++ b/tests/phpunit/CollageTest.php @@ -366,7 +366,7 @@ class CollageTest extends TestCase { $_GET['collage_id'] = $this->collageList[0]->id; $this->assertEquals( [ - 'ID' => $this->collageList[0]->id(), + 'ID' => $this->collageList[0]->id, 'Name' => $this->collageList[0]->name(), 'CategoryID' => $this->collageList[0]->categoryId(), 'Category' => null, diff --git a/tests/phpunit/FriendTest.php b/tests/phpunit/FriendTest.php index f2e15624d..e85cb9a63 100644 --- a/tests/phpunit/FriendTest.php +++ b/tests/phpunit/FriendTest.php @@ -42,14 +42,14 @@ class FriendTest extends TestCase { // get a page $page = $this->friend[0]->page($manager, 10, 0); $this->assertCount(1, $page, 'friend-page'); - $this->assertEquals(0, $page[$this->friend[1]->user()->id()]['mutual'], 'friend-not-mutual'); + $this->assertEquals(0, $page[$this->friend[1]->user()->id]['mutual'], 'friend-not-mutual'); // mutual $this->assertEquals(1, $this->friend[1]->add($this->friend[0]->user()), 'friend-0-add-back'); $this->assertTrue($this->friend[0]->isMutual($this->friend[1]->user()), 'friend-1-is-mutual'); $this->assertTrue($this->friend[1]->isMutual($this->friend[0]->user()), 'friend-reciprocal'); $page = $this->friend[0]->page($manager, 10, 0); - $this->assertEquals(1, $page[$this->friend[1]->user()->id()]['mutual'], 'friend-the-feeling-is-mutual'); + $this->assertEquals(1, $page[$this->friend[1]->user()->id]['mutual'], 'friend-the-feeling-is-mutual'); // if (getenv('CI') === false) { // FIXME: figure out why causes Twig footer() to fail when running in CI diff --git a/tests/phpunit/InboxTest.php b/tests/phpunit/InboxTest.php index 7f92c4e2a..7ee305331 100644 --- a/tests/phpunit/InboxTest.php +++ b/tests/phpunit/InboxTest.php @@ -19,8 +19,8 @@ class InboxTest extends TestCase { 'sender' => Helper::makeUser('inbox.send.' . randomString(6), 'inbox', clearInbox: true), 'receiver' => Helper::makeUser('inbox.recv.' . randomString(6), 'inbox', clearInbox: true), ]; - $senderId = $this->userList['sender']->id(); - $receiverId = $this->userList['receiver']->id(); + $senderId = $this->userList['sender']->id; + $receiverId = $this->userList['receiver']->id; $senderInbox = $this->userList['sender']->inbox(); $this->assertEquals('inbox.php?sort=latest', $senderInbox->folderLink('inbox', false), 'inbox-folder-latest'); @@ -66,7 +66,7 @@ class InboxTest extends TestCase { $this->assertCount(1, $recvList, 'inbox-pm-recv-post'); $this->assertEquals($body, $recvList[0]['body'], 'inbox-pm-recv-body'); $this->assertEquals(1, $receiverInbox->unreadTotal(), 'inbox-unread-count'); - $this->assertEquals(1, $receiverInbox->massRead([$pmSent->id()]), 'inbox-mark-read'); + $this->assertEquals(1, $receiverInbox->massRead([$pmSent->id]), 'inbox-mark-read'); $this->assertEquals(0, $receiverInbox->unreadTotal(), 'inbox-none-unread'); // sentbox @@ -86,9 +86,9 @@ class InboxTest extends TestCase { // reply $userMan = new Manager\User(); $replyBody = 'reply two ' . randomString(10); - $replyId = $userMan->replyPM($senderId, $receiverId, $subject, 'reply one', $pmSent->id()); - $replyId = $userMan->replyPM($senderId, $receiverId, $subject, $replyBody, $pmSent->id()); - $this->assertEquals($replyId, $pmSent->id(), 'inbox-recv-reply'); + $replyId = $userMan->replyPM($senderId, $receiverId, $subject, 'reply one', $pmSent->id); + $replyId = $userMan->replyPM($senderId, $receiverId, $subject, $replyBody, $pmSent->id); + $this->assertEquals($replyId, $pmSent->id, 'inbox-recv-reply'); $senderList = $senderInbox->messageList($pmSenderManager, 2, 0); $this->assertCount(1, $senderList, 'inbox-sender-replylist'); $msgList = $senderInbox->messageList($pmSenderManager, 2, 0); @@ -104,12 +104,13 @@ class InboxTest extends TestCase { foreach ($bodyList as $body) { $pmList[] = $receiverInbox->create($senderInbox->user(), $subject, $body); } - $convList = array_map(fn($p) => $p->id(), $pmList); + $convList = array_map(fn($p) => $p->id, $pmList); $this->assertEquals(4, $receiverInbox->unreadTotal(), 'inbox-more-count'); $this->assertEquals(5, $receiverInbox->messageTotal(), 'inbox-more-message-count'); $rlist = $receiverInbox->messageList($pmReceiverManager, 6, 0); - $flaky = implode(", ", array_map(fn($m) => "id={$m->id()} sent={$m->sentDate()} unr=" . ($m->isUnread() ? 'y' : 'n'), $rlist)); + $flaky = implode(", ", array_map(fn($m) => "id={$m->id} sent={$m->sentDate()} unr=" + . ($m->isUnread() ? 'y' : 'n'), $rlist)); $this->assertFalse($rlist[4]->isUnread(), "inbox-last-is-read $flaky"); $this->assertTrue($rlist[3]->isUnread(), 'inbox-second-last-is-unread'); @@ -131,7 +132,7 @@ class InboxTest extends TestCase { $this->assertEquals(1, $receiverInbox->messageTotal(), 'inbox-search-body'); $rlist = $receiverInbox->messageList($pmReceiverManager, 2, 0); $this->assertCount(1, $rlist, 'inbox-search-list-body'); - $this->assertEquals($convList[1], $rlist[0]->id(), 'inbox-search-found'); + $this->assertEquals($convList[1], $rlist[0]->id, 'inbox-search-found'); // search user $receiverInbox->setSearchField('user')->setSearchTerm('nobody-here'); @@ -146,18 +147,18 @@ class InboxTest extends TestCase { $this->assertCount(4, $rlist, 'inbox-search-list-pm'); // pin - $this->assertEquals(2, $receiverInbox->massTogglePinned([$rlist[1]->id(), $rlist[2]->id()]), 'inbox-pin-2'); + $this->assertEquals(2, $receiverInbox->massTogglePinned([$rlist[1]->id, $rlist[2]->id]), 'inbox-pin-2'); $receiverInbox->setSearchField('subject')->setSearchTerm('')->setUnreadFirst(false); $rlist = $receiverInbox->messageList($pmReceiverManager, 6, 0); $this->assertEquals( - [$convList[2], $convList[1], $convList[3], $convList[0], $pmSent->id()], - [$rlist[0]->id(), $rlist[1]->id(), $rlist[2]->id(), $rlist[3]->id(), $rlist[4]->id()], + [$convList[2], $convList[1], $convList[3], $convList[0], $pmSent->id], + [$rlist[0]->id, $rlist[1]->id, $rlist[2]->id, $rlist[3]->id, $rlist[4]->id], 'inbox-pinned-order-regular' ); $rlist = $receiverInbox->setUnreadFirst(true)->messageList($pmReceiverManager, 6, 0); $this->assertEquals( - [$convList[2], $convList[1], $convList[3], $convList[0], $pmSent->id()], - [$rlist[0]->id(), $rlist[1]->id(), $rlist[2]->id(), $rlist[3]->id(), $rlist[4]->id()], + [$convList[2], $convList[1], $convList[3], $convList[0], $pmSent->id], + [$rlist[0]->id, $rlist[1]->id, $rlist[2]->id, $rlist[3]->id, $rlist[4]->id], 'inbox-pinned-order-unread' ); @@ -165,7 +166,7 @@ class InboxTest extends TestCase { $this->assertEquals( 1, // $rlist[4] a.k.a $pmSent has been read $receiverInbox->massUnread([ - $rlist[2]->id(), $rlist[3]->id(), $rlist[4]->id() + $rlist[2]->id, $rlist[3]->id, $rlist[4]->id ]), 'inbox-toggle-unread' ); @@ -174,7 +175,7 @@ class InboxTest extends TestCase { $this->assertEquals( 2, // $rlist[4] a.k.a $pmSent has been read $receiverInbox->massRemove([ - $rlist[1]->id(), $rlist[3]->id() + $rlist[1]->id, $rlist[3]->id ]), 'inbox-mass-remove' ); diff --git a/tests/phpunit/ReaperTest.php b/tests/phpunit/ReaperTest.php index 5c6d67c9e..cc79405eb 100644 --- a/tests/phpunit/ReaperTest.php +++ b/tests/phpunit/ReaperTest.php @@ -76,7 +76,7 @@ class ReaperTest extends TestCase { UPDATE torrents_leech_stats SET last_action = now() - INTERVAL ? HOUR WHERE TorrentID = ? - ", $interval, $torrent->id() + ", $interval, $torrent->id ); } @@ -85,14 +85,14 @@ class ReaperTest extends TestCase { UPDATE torrent_unseeded SET unseeded_date = ? WHERE torrent_id = ? - ", date('Y-m-d H:i:s', (int)strtotime("-{$hour} hours")), $torrent->id() + ", date('Y-m-d H:i:s', (int)strtotime("-{$hour} hours")), $torrent->id ); } protected function removeUnseededAlert(array $list): void { DB::DB()->prepared_query(" DELETE FROM torrent_unseeded WHERE torrent_id in (" . placeholders($list) . ")", - ...array_map(fn($t) => $t->id(), $list) + ...array_map(fn($t) => $t->id, $list) ); } @@ -113,7 +113,7 @@ class ReaperTest extends TestCase { INNER JOIN torrents_leech_stats tls ON (tls.TorrentID = t.ID) LEFT JOIN torrent_unseeded tu ON (tu.torrent_id = t.ID) WHERE t.ID IN (" . placeholders($torrentList) . ")", - ...array_map(fn($t) => $t->id(), $torrentList) + ...array_map(fn($t) => $t->id, $torrentList) ); echo implode("\t", ['id', 'created', 'createdpostList(1, 0)[0]['body']; $this->assertEquals('You have 2 non-seeded new uploads to rescue', $pm->subject(), 'never-message-2'); $this->assertStringContainsString("Dear {$this->userList[0]->username()}", $body, 'never-body-2-dear'); - $this->assertStringContainsString("[pl]{$this->torrentList[0]->id()}[/pl]", $body, 'never-body-2-pl-0'); - $this->assertStringContainsString("[pl]{$this->torrentList[1]->id()}[/pl]", $body, 'never-body-2-pl-1'); + $this->assertStringContainsString("[pl]{$this->torrentList[0]->id}[/pl]", $body, 'never-body-2-pl-0'); + $this->assertStringContainsString("[pl]{$this->torrentList[1]->id}[/pl]", $body, 'never-body-2-pl-1'); $pm->remove(); // reseed one of the torrents by the uploader @@ -263,11 +263,11 @@ class ReaperTest extends TestCase { $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('You have a non-seeded new upload scheduled for deletion very soon', $pm->subject(), 'never-message-final-subject'); $this->assertStringContainsString("Dear {$this->userList[0]->username()}", $body, 'never-body-3-dear'); - $this->assertStringContainsString("[pl]{$this->torrentList[1]->id()}[/pl]", $body, 'never-body-3-pl-1'); + $this->assertStringContainsString("[pl]{$this->torrentList[1]->id}[/pl]", $body, 'never-body-3-pl-1'); $pm->remove(); $this->modifyUnseededInterval($this->torrentList[1], REMOVE_NEVER_SEEDED_HOUR + 1); - $id = $this->torrentList[1]->id(); + $id = $this->torrentList[1]->id; $list = $reaper->reaperList( state: ReaperState::NEVER, interval: REMOVE_NEVER_SEEDED_HOUR, @@ -279,7 +279,7 @@ class ReaperTest extends TestCase { $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('1 of your uploads has been deleted for inactivity (never seeded)', $pm->subject(), 'never-remove-message'); $this->assertStringContainsString("Dear {$this->userList[0]->username()}", $body, 'never-remove-body-dear'); - $this->assertStringContainsString("[url=torrents.php?id={$this->torrentList[1]->group()->id()}]", $body, 'never-remove-body-pl'); + $this->assertStringContainsString("[url=torrents.php?id={$this->torrentList[1]->group()->id}]", $body, 'never-remove-body-pl'); $pm->remove(); $deleted = $torMan->findById($id); @@ -339,8 +339,8 @@ class ReaperTest extends TestCase { $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('There are 2 unseeded uploads to rescue', $pm->subject(), 'unseeded-initial-0-rescue'); $this->assertStringContainsString("You have 2 uploads that are not currently seeding by you (or anyone else)", $body, 'unseeded-initial-0-body'); - $this->assertStringContainsString("[pl]{$this->torrentList[0]->id()}[/pl]", $body, 'unseeded-initial-0-body-pl-0'); - $this->assertStringContainsString("[pl]{$this->torrentList[1]->id()}[/pl]", $body, 'unseeded-initial-0-body-pl-1'); + $this->assertStringContainsString("[pl]{$this->torrentList[0]->id}[/pl]", $body, 'unseeded-initial-0-body-pl-0'); + $this->assertStringContainsString("[pl]{$this->torrentList[1]->id}[/pl]", $body, 'unseeded-initial-0-body-pl-1'); $pm->remove(); $this->assertEquals(1, $inboxList[1]->messageTotal(), 'unseeded-initial-1-inbox'); @@ -348,8 +348,8 @@ class ReaperTest extends TestCase { $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('You have 2 unseeded snatches to save', $pm->subject(), 'unseeded-initial-1-rescue'); $this->assertStringContainsString("In the past, you snatched 2 uploads that are no longer being seeded", $body, 'unseeded-initial-1-body'); - $this->assertStringContainsString("[pl]{$this->torrentList[0]->id()}[/pl]", $body, 'unseeded-initial-1-body-pl-0'); - $this->assertStringContainsString("[pl]{$this->torrentList[1]->id()}[/pl]", $body, 'unseeded-initial-1-body-pl-1'); + $this->assertStringContainsString("[pl]{$this->torrentList[0]->id}[/pl]", $body, 'unseeded-initial-1-body-pl-0'); + $this->assertStringContainsString("[pl]{$this->torrentList[1]->id}[/pl]", $body, 'unseeded-initial-1-body-pl-1'); $pm->remove(); $initialClaim = $reaper->claimStats(); @@ -366,15 +366,15 @@ class ReaperTest extends TestCase { $win = $reaper->claim(); $this->assertCount(1, $win, 'unseeded-claim-win-count'); [$torrentId, $userId, $bp] = $win[0]; - $this->assertEquals($this->torrentList[0]->id(), $torrentId, 'unseeded-claim-win-torrent'); - $this->assertEquals($this->userList[1]->id(), $userId, 'unseeded-claim-win-user'); + $this->assertEquals($this->torrentList[0]->id, $torrentId, 'unseeded-claim-win-torrent'); + $this->assertEquals($this->userList[1]->id, $userId, 'unseeded-claim-win-user'); $this->assertEquals($this->userList[1]->flush()->bonusPointsTotal(), $bonus + $bp, 'unseeded-claim-win-bp'); // message $pm = $inboxList[1]->messageList($pmMan[1], 1, 0)[0]; $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals("Thank you for reseeding {$this->torrentList[0]->group()->name()}!", $pm->subject(), 'unseeded-initial-1-thx'); - $this->assertStringContainsString("[pl]{$this->torrentList[0]->id()}[/pl]", $body, 'unseeded-initial-1-body-pl-thx'); + $this->assertStringContainsString("[pl]{$this->torrentList[0]->id}[/pl]", $body, 'unseeded-initial-1-body-pl-thx'); $this->assertStringContainsString("$bp bonus points", $body, 'unseeded-initial-1-body-bp-thx'); $pm->remove(); @@ -410,14 +410,14 @@ class ReaperTest extends TestCase { $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('There is an unseeded upload scheduled for deletion very soon', $pm->subject(), 'unseeded-final-0-rescue'); $this->assertStringContainsString("You have an upload that is still not currently seeding by you (or anyone else)", $body, 'unseeded-final-0-body'); - $this->assertStringContainsString("[pl]{$this->torrentList[1]->id()}[/pl]", $body, 'unseeded-final-0-body-pl-1'); + $this->assertStringContainsString("[pl]{$this->torrentList[1]->id}[/pl]", $body, 'unseeded-final-0-body-pl-1'); $pm->remove(); $this->assertEquals(0, $inboxList[1]->messageTotal(), 'unseeded-final-no-snatcher-inbox'); // too late $this->modifyUnseededInterval($this->torrentList[1], REMOVE_UNSEEDED_HOUR + 1); - $id = $this->torrentList[1]->id(); + $id = $this->torrentList[1]->id; $list = $reaper->reaperList( state: ReaperState::UNSEEDED, interval: REMOVE_UNSEEDED_HOUR, @@ -429,14 +429,14 @@ class ReaperTest extends TestCase { $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('1 of your uploads has been deleted for inactivity (unseeded)', $pm->subject(), 'never-remove-message'); $this->assertStringContainsString("Dear {$this->userList[0]->username()}", $body, 'never-remove-body-dear'); - $this->assertStringContainsString("[url=torrents.php?id={$this->torrentList[1]->group()->id()}]", $body, 'never-remove-body-pl'); + $this->assertStringContainsString("[url=torrents.php?id={$this->torrentList[1]->group()->id}]", $body, 'never-remove-body-pl'); $pm->remove(); $pm = $inboxList[1]->messageList($pmMan[1], 1, 0)[0]; $body = $pm->postList(1, 0)[0]['body']; $this->assertEquals('1 of your snatches was deleted for inactivity', $pm->subject(), 'never-remove-snatcher-message'); $this->assertStringContainsString("Dear {$this->userList[1]->username()}", $body, 'never-remove-snatcher-body-dear'); - $this->assertStringContainsString("[url=torrents.php?id={$this->torrentList[1]->group()->id()}]", $body, 'never-remove-snatcher-body-pl'); + $this->assertStringContainsString("[url=torrents.php?id={$this->torrentList[1]->group()->id}]", $body, 'never-remove-snatcher-body-pl'); $pm->remove(); $deleted = $torMan->findById($id); @@ -507,7 +507,7 @@ class ReaperTest extends TestCase { $reaper = new Torrent\Reaper(new Manager\Torrent(), new Manager\User()); $reaper->process($reaper->initialUnseededList(), ReaperState::UNSEEDED, ReaperNotify::INITIAL); - $uploaderId = $this->userList[0]->id(); + $uploaderId = $this->userList[0]->id; $initial = array_filter( $reaper->unseederList(), fn($user) => $user['user_id'] == $uploaderId diff --git a/tests/phpunit/ReportAutoTest.php b/tests/phpunit/ReportAutoTest.php index 01ceabe44..28b5745ea 100644 --- a/tests/phpunit/ReportAutoTest.php +++ b/tests/phpunit/ReportAutoTest.php @@ -27,12 +27,12 @@ class ReportAutoTest extends TestCase { $r = $raMan->create($this->user1, $type, ["someinterestingkey" => 1234]); $this->assertEquals(Enum\ReportAutoState::open, $r->state(), 'reportauto-new-state'); - $this->assertEquals($type->id(), $r->typeId(), 'reportauto-new-typeid'); + $this->assertEquals($type->id, $r->typeId(), 'reportauto-new-typeid'); $this->assertFalse($r->isClaimed(), 'reportauto-new-claimed'); $this->assertFalse($r->isResolved(), 'reportauto-new-resolved'); $this->assertFalse($r->hasComments(), 'reportauto-new-comments'); $this->assertNull($r->ownerId(), 'reportauto-new-owner'); - $this->assertEquals($this->user1->id(), $r->userId(), 'reportauto-new-user'); + $this->assertEquals($this->user1->id, $r->userId(), 'reportauto-new-user'); $this->assertEquals("[ReportAutoTest] $name", $r->text(), 'reportauto-new-text'); $this->assertEquals(["someinterestingkey" => 1234], $r->data(), 'reportauto-new-data'); $this->assertStringContainsString('someinterestingkey', $r->details(), 'reportauto-new-details-1'); @@ -48,10 +48,10 @@ class ReportAutoTest extends TestCase { $r = $raMan->create($this->user1, $type, ["someinterestingkey" => 1234]); $r->resolve($this->user2); $this->assertTrue($r->isResolved(), 'reportauto-resolve-1'); - $this->assertEquals($this->user2->id(), $r->ownerId(), 'reportauto-resolve-2'); + $this->assertEquals($this->user2->id, $r->ownerId(), 'reportauto-resolve-2'); $r->unresolve($this->user2); $this->assertFalse($r->isResolved(), 'reportauto-resolve-3'); - $this->assertEquals($this->user2->id(), $r->ownerId(), 'reportauto-resolve-4'); + $this->assertEquals($this->user2->id, $r->ownerId(), 'reportauto-resolve-4'); $this->assertTrue($r->isClaimed(), 'reportauto-resolve-5'); } @@ -64,7 +64,7 @@ class ReportAutoTest extends TestCase { $r = $raMan->create($this->user1, $type, ["someinterestingkey" => 1234]); $r->claim($this->user2); $this->assertTrue($r->isClaimed(), 'reportauto-claim-1'); - $this->assertEquals($this->user2->id(), $r->ownerId(), 'reportauto-claim-2'); + $this->assertEquals($this->user2->id, $r->ownerId(), 'reportauto-claim-2'); $r->unclaim(); $this->assertFalse($r->isClaimed(), 'reportauto-claim-3'); $this->assertNull($r->ownerId(), 'reportauto-claim-4'); @@ -82,7 +82,7 @@ class ReportAutoTest extends TestCase { $this->assertTrue($r->hasComments(), 'reportauto-comments-2'); $comments = $r->comments(); $this->assertEquals(1, count($comments), 'reportauto-comments-3'); - $this->assertEquals($this->user2->id(), $comments[0]['id_user'], 'reportauto-comments-4'); + $this->assertEquals($this->user2->id, $comments[0]['id_user'], 'reportauto-comments-4'); $this->assertEquals("testcomment", $comments[0]['comment'], 'reportauto-comments-5'); } } diff --git a/tests/phpunit/StaffBlogTest.php b/tests/phpunit/StaffBlogTest.php index 29e2ecb84..8968fb7b4 100644 --- a/tests/phpunit/StaffBlogTest.php +++ b/tests/phpunit/StaffBlogTest.php @@ -29,11 +29,11 @@ class StaffBlogTest extends TestCase { $this->assertInstanceOf(StaffBlog::class, $blog, 'staff-blog-create'); $this->assertEquals('phpunit staff blog', $blog->title(), 'staff-blog-title'); $this->assertEquals('body text', $blog->body(), 'staff-blog-text'); - $this->assertEquals($this->userList['admin']->id(), $blog->userId(), 'staff-blog-user-id'); + $this->assertEquals($this->userList['admin']->id, $blog->userId(), 'staff-blog-user-id'); $this->assertTrue(Helper::recentDate($blog->created()), 'staff-blog-created'); $this->assertGreaterThan(time() - 10, $blog->epoch(), 'staff-blog-epoch'); - $location = 'staffblog.php#blog' . $blog->id(); + $location = 'staffblog.php#blog' . $blog->id; $this->assertEquals($location, $blog->location(), 'staff-blog-location'); $this->assertEquals(SITE_URL . "/$location", $blog->publicLocation(), 'staff-blog-public-location'); $this->assertEquals($location, $blog->url(), 'staff-blog-url'); @@ -60,7 +60,7 @@ class StaffBlogTest extends TestCase { $this->assertEquals($newBody, $blog->body(), 'staff-blog-new-body'); $list = $manager->blogList(); - $this->assertEquals($blog->id(), $list[0]->id(), 'staff-blog-latest'); + $this->assertEquals($blog->id, $list[0]->id, 'staff-blog-latest'); $this->assertEquals(1, $blog->remove(), 'staff-blog-removed'); } diff --git a/tests/phpunit/StaffGroupTest.php b/tests/phpunit/StaffGroupTest.php index 7a138163c..1aa8bdbd6 100644 --- a/tests/phpunit/StaffGroupTest.php +++ b/tests/phpunit/StaffGroupTest.php @@ -15,9 +15,9 @@ class StaffGroupTest extends TestCase { $staffList = $manager->groupList(); $this->assertEquals(count($initial) + 1, count($staffList), 'staff-group-added'); - $find = $manager->findById($sg->id()); + $find = $manager->findById($sg->id); $this->assertInstanceOf(StaffGroup::class, $find, 'staff-group-find'); - $this->assertNull($manager->findById($sg->id() + 1), 'staff-group-null'); + $this->assertNull($manager->findById($sg->id + 1), 'staff-group-null'); $this->assertEquals(1, $find->remove(), 'staff-group-removed'); $this->assertEquals(count($initial), count($manager->groupList()), 'staff-group-restored'); diff --git a/tests/phpunit/StaffPMTest.php b/tests/phpunit/StaffPMTest.php index 1580f9d39..2eb4cb578 100644 --- a/tests/phpunit/StaffPMTest.php +++ b/tests/phpunit/StaffPMTest.php @@ -33,7 +33,7 @@ class StaffPMTest extends TestCase { FROM staff_pm_conversations spc INNER JOIN staff_pm_messages spm ON (spm.ConvID = spc.ID) WHERE spm.UserID IN (?, ?, ?, ?) - ", $this->fls->id(), $this->mod->id(), $this->sysop->id(), $this->user->id + ", $this->fls->id, $this->mod->id, $this->sysop->id, $this->user->id ); $this->fls->remove(); $this->mod->remove(); @@ -59,7 +59,7 @@ class StaffPMTest extends TestCase { $this->assertFalse($spm->isResolved(), 'spm-fls-unresolved'); $this->assertFalse($spm->unassigned(), 'spm-fls-unassigned'); - $this->assertEquals($spm->id(), $this->spMan->findById($spm->id())?->id(), 'spm-fls-find'); + $this->assertEquals($spm->id, $this->spMan->findById($spm->id)?->id, 'spm-fls-find'); $list = $this->spMan->findAllByUser($this->user); $this->assertCount(1, $list, 'spm-user-list-total'); $this->assertEquals($spm->subject(), $list[0]->subject(), 'spm-user-list-first'); @@ -83,8 +83,8 @@ class StaffPMTest extends TestCase { $thread = $spm->thread(); $this->assertCount(3, $thread, 'spm-thread-total'); $this->assertEquals($this->user->id, $thread[0]['user_id'], 'spm-thread-0'); - $this->assertEquals($this->fls->id(), $thread[1]['user_id'], 'spm-thread-1'); - $this->assertEquals($this->mod->id(), $thread[2]['user_id'], 'spm-thread-2'); + $this->assertEquals($this->fls->id, $thread[1]['user_id'], 'spm-thread-1'); + $this->assertEquals($this->mod->id, $thread[2]['user_id'], 'spm-thread-2'); $last = end($thread); $pm = $this->spMan->findByPostId($last['id']); @@ -164,9 +164,9 @@ class StaffPMTest extends TestCase { $this->assertEquals(1, $this->spMan->countByStatus($this->fls, ['Resolved']), 'spm-fls-status-now-resolved'); $this->spMan->setSearchStatusList($this->fls, ['Resolved']); $list = $this->spMan->page($this->fls, 2, 0); - $this->assertEquals($spm->id(), $list[0]['id']); + $this->assertEquals($spm->id, $list[0]['id']); - $historyFls = $this->spMan->staffHistory($level, [$this->fls->id()], 1 /* day */); + $historyFls = $this->spMan->staffHistory($level, [$this->fls->id], 1 /* day */); $this->assertEquals(1, $historyFls[0]['total'], 'spm-fls-staff-history-message'); $this->assertEquals(0, $historyFls[0]['total2'], 'spm-fls-staff-history-conv'); diff --git a/tests/phpunit/TorrentTest.php b/tests/phpunit/TorrentTest.php index a56b912f2..2bfe29b99 100644 --- a/tests/phpunit/TorrentTest.php +++ b/tests/phpunit/TorrentTest.php @@ -369,27 +369,27 @@ class TorrentTest extends TestCase { public function testLogfileList(): void { $logfileSummary = new LogfileSummary([ - 'error' => [UPLOAD_ERR_OK], - 'name' => ['valid_log_eac.log'], - 'tmp_name' => [__DIR__ . '/../fixture/valid_log_eac.log'], - ]); - $torrentLogManager = new Manager\TorrentLog(); - $checkerVersion = Logchecker::getLogcheckerVersion(); - foreach ($logfileSummary->all() as $logfile) { - $torrentLogManager->create($this->torrent, $logfile, $checkerVersion); - } - $expected = [ - 'has_riplog' => false, - 'adjustment_details' => [], - 'adjusted' => false, - 'adjusted_checksum' => false, - 'checksum' => true, - 'details' => [], - ]; - $logfileList = $this->torrent->logfileList(); - $this->assertCount(1, $logfileList); - $this->assertArrayIsEqualToArrayOnlyConsideringListOfKeys($expected, $logfileList[0], array_keys($expected)); - $this->assertNotEmpty($logfileList[0]['html_log']); + 'error' => [UPLOAD_ERR_OK], + 'name' => ['valid_log_eac.log'], + 'tmp_name' => [__DIR__ . '/../fixture/valid_log_eac.log'], + ]); + $torrentLogManager = new Manager\TorrentLog(); + $checkerVersion = Logchecker::getLogcheckerVersion(); + foreach ($logfileSummary->all() as $logfile) { + $torrentLogManager->create($this->torrent, $logfile, $checkerVersion); + } + $expected = [ + 'has_riplog' => false, + 'adjustment_details' => [], + 'adjusted' => false, + 'adjusted_checksum' => false, + 'checksum' => true, + 'details' => [], + ]; + $logfileList = $this->torrent->logfileList(); + $this->assertCount(1, $logfileList); + $this->assertArrayIsEqualToArrayOnlyConsideringListOfKeys($expected, $logfileList[0], array_keys($expected)); + $this->assertNotEmpty($logfileList[0]['html_log']); } public function testLogfileHashList(): void { @@ -405,7 +405,7 @@ class TorrentTest extends TestCase { $torrentLog = $torrentLogManager->create($this->torrent, $logfile, $checkerVersion); // Because RipLog::put relies on move_uploaded_file, the create method above fails to put the log file // into place, so we do this copy afterwards. - $ripLog = new File\RipLog($torrentLog->torrentId(), $torrentLog->id()); + $ripLog = new File\RipLog($torrentLog->torrentId(), $torrentLog->id); copy(__DIR__ . '/../fixture/valid_log_eac.log', $ripLog->path()); } $this->assertEquals([hash_file('sha256', __DIR__ . '/../fixture/valid_log_eac.log')], $this->torrent->logfileHashList()); diff --git a/tests/phpunit/TrackerTest.php b/tests/phpunit/TrackerTest.php index ff97f430e..0dc0858ca 100644 --- a/tests/phpunit/TrackerTest.php +++ b/tests/phpunit/TrackerTest.php @@ -52,7 +52,7 @@ class TrackerTest extends TestCase { $this->assertTrue($tracker->addToken($this->torrent, $this->user), 'tracker-add-token'); $report = $tracker->torrentReport($this->torrent); $this->assertCount(9, array_keys($report), 'tracker-tinfo-count'); - $this->assertEquals($this->torrent->id(), $report['id'], 'tracker-tinfo-id'); + $this->assertEquals($this->torrent->id, $report['id'], 'tracker-tinfo-id'); $this->assertCount(0, $report['leecher_list'], 'tracker-tinfo-leecher'); $this->assertCount(0, $report['seeder_list'], 'tracker-tinfo-seeder'); $this->assertEquals([$this->user->id], $report['fltoken_list'], 'tracker-tinfo-fltoken'); @@ -175,8 +175,8 @@ class TrackerTest extends TestCase { $download = new Download($this->torrent, new User\UserclassRateLimit($downloader), true); $this->assertEquals(DownloadStatus::ok, $download->status(), 'tracker-downloader-enough-tokens'); - $userId = $downloader->id(); - $torrentId = $this->torrent->id(); + $userId = $downloader->id; + $torrentId = $this->torrent->id; $fakeId = $torrentId + 1; $this->assertEquals(1, $tracker->expireFreeleechTokens("$userId:$torrentId,$userId:$fakeId"), 'tracker-expire-tokens'); diff --git a/tests/phpunit/UserActivityTest.php b/tests/phpunit/UserActivityTest.php index ed0a0ca77..069b0c7c8 100644 --- a/tests/phpunit/UserActivityTest.php +++ b/tests/phpunit/UserActivityTest.php @@ -91,7 +91,7 @@ class UserActivityTest extends TestCase { $this->assertEquals('You have a new message', $alertInbox->title(), 'alert-inbox-unread'); // read it - $read = new Manager\PM($user)->findById($pm->id()); + $read = new Manager\PM($user)->findById($pm->id); $this->assertInstanceOf(PM::class, $read, 'inbox-unread-pm'); $this->assertEquals(1, $read->markRead(), 'alert-pm-read'); } diff --git a/tests/phpunit/UserHistoryTest.php b/tests/phpunit/UserHistoryTest.php index b64e5325e..b1295364b 100644 --- a/tests/phpunit/UserHistoryTest.php +++ b/tests/phpunit/UserHistoryTest.php @@ -58,7 +58,7 @@ class UserHistoryTest extends TestCase { $duplicate = $history->emailDuplicate(new Search\ASN()); $this->assertCount(1, $duplicate, 'email-duplicate-count'); - $this->assertEquals($this->userList[0]->id(), $duplicate[0]['user_id'], 'email-duplicate-user-id'); + $this->assertEquals($this->userList[0]->id, $duplicate[0]['user_id'], 'email-duplicate-user-id'); } public function testEmailReset(): void { diff --git a/tests/phpunit/UserLinkTest.php b/tests/phpunit/UserLinkTest.php index c9d75827e..6367b943c 100644 --- a/tests/phpunit/UserLinkTest.php +++ b/tests/phpunit/UserLinkTest.php @@ -68,12 +68,12 @@ class UserLinkTest extends TestCase { $this->assertEquals($comment, $info['comment'], 'user-link-info-comment'); $this->assertCount(1, $info['list'], 'user-link-info-list'); $this->assertEquals( - [$this->userList[1]->id() => $this->userList[1]->username()], + [$this->userList[1]->id => $this->userList[1]->username()], $info['list'], 'user-link-info-user' ); $this->assertEquals( - [$this->userList[0]->id() => $this->userList[0]->username()], + [$this->userList[0]->id => $this->userList[0]->username()], new User\UserLink($this->userList[1])->info()['list'], 'user-link-info-other-user' ); @@ -130,18 +130,18 @@ class UserLinkTest extends TestCase { ); $this->assertEquals( [ - $this->userList[2]->id() => $this->userList[2]->username(), - $this->userList[3]->id() => $this->userList[3]->username(), - $this->userList[4]->id() => $this->userList[4]->username(), + $this->userList[2]->id => $this->userList[2]->username(), + $this->userList[3]->id => $this->userList[3]->username(), + $this->userList[4]->id => $this->userList[4]->username(), ], $linka->info()['list'], 'user-link-merged-1' ); $this->assertEquals( [ - $this->userList[1]->id() => $this->userList[1]->username(), - $this->userList[2]->id() => $this->userList[2]->username(), - $this->userList[3]->id() => $this->userList[3]->username(), + $this->userList[1]->id => $this->userList[1]->username(), + $this->userList[2]->id => $this->userList[2]->username(), + $this->userList[3]->id => $this->userList[3]->username(), ], new User\UserLink($this->userList[4])->info()['list'], 'user-link-merged-4' diff --git a/tests/phpunit/UserSeedboxTest.php b/tests/phpunit/UserSeedboxTest.php index 49d8f5be3..679335d97 100644 --- a/tests/phpunit/UserSeedboxTest.php +++ b/tests/phpunit/UserSeedboxTest.php @@ -54,7 +54,7 @@ class UserSeedboxTest extends TestCase { INSERT INTO xbt_files_users (fid, uid, useragent, peer_id, ip, active, remaining, timespent, mtime) VALUES (?, ?, ?, ?, ?, 1, 0, 1, unix_timestamp(now() - interval 1 hour)) - ", $torrent->id(), $this->user->id, $ua, $peerId, $ip + ", $torrent->id, $this->user->id, $ua, $peerId, $ip ); } @@ -114,18 +114,26 @@ class UserSeedboxTest extends TestCase { // union (torrentList[1] in common) $seedbox->setSource($hostList[$key1]['id'])->setTarget($hostList[$key2]['id'])->setUnion(true); - $this->assertEquals([$this->torrentList[1]->id()], $seedbox->idList(), 'seedbox-both'); + $this->assertEquals([$this->torrentList[1]->id], $seedbox->idList(), 'seedbox-both'); // intersection (point of view sbox-1) $seedbox->setUnion(false); - $this->assertEquals([$this->torrentList[0]->id()], $seedbox->idList(), 'seedbox-1-not-2'); + $this->assertEquals([$this->torrentList[0]->id], $seedbox->idList(), 'seedbox-1-not-2'); // intersection (point of view sbox-2) $seedbox->setSource($hostList[$key2]['id'])->setTarget($hostList[$key1]['id']); - $this->assertEquals([$this->torrentList[2]->id(), $this->torrentList[3]->id()], $seedbox->idList(), 'seedbox-2-not-1'); + $this->assertEquals( + [$this->torrentList[2]->id, $this->torrentList[3]->id], + $seedbox->idList(), + 'seedbox-2-not-1' + ); $list = $seedbox->torrentList(new Manager\Torrent(), 3, 0); - $this->assertEquals([$this->torrentList[2]->id(), $this->torrentList[3]->id()], array_map(fn($t) => $t['id'], $list), 'seedbox-list'); + $this->assertEquals( + [$this->torrentList[2]->id, $this->torrentList[3]->id], + array_map(fn($t) => $t['id'], $list), + 'seedbox-list', + ); } public function testUserSeederList(): void { diff --git a/tests/phpunit/manager/DuplicateIpTest.php b/tests/phpunit/manager/DuplicateIpTest.php index 85cf4f2c8..b4abf9613 100644 --- a/tests/phpunit/manager/DuplicateIpTest.php +++ b/tests/phpunit/manager/DuplicateIpTest.php @@ -28,12 +28,12 @@ class DuplicateIpTest extends TestCase { (?, '$ip', now() - interval 10 day, now() - interval 1 day), (?, '$ip', now() - interval 10 day, now() - interval 1 day), (?, '$ip', now() - interval 10 day, now() - interval 1 day) - ", ...array_map(fn($u) => $u->id(), $this->userList) + ", ...array_map(fn($u) => $u->id, $this->userList) ); } public function tearDown(): void { - $idList = array_map(fn($u) => $u->id(), $this->userList); + $idList = array_map(fn($u) => $u->id, $this->userList); DB::DB()->prepared_query(" DELETE FROM users_history_ips WHERE UserID IN (" . placeholders($idList) . ") ", ...$idList diff --git a/tests/phpunit/manager/TGroupManagerTest.php b/tests/phpunit/manager/TGroupManagerTest.php index 7d6b37d52..bd4c443ab 100644 --- a/tests/phpunit/manager/TGroupManagerTest.php +++ b/tests/phpunit/manager/TGroupManagerTest.php @@ -39,7 +39,7 @@ class TGroupManagerTest extends TestCase { public function testFindByTorrentId(): void { $manager = new Manager\TGroup(); - $torrentId = $this->torrentList[0]->id(); + $torrentId = $this->torrentList[0]->id; $this->assertInstanceOf( TGroup::class, $manager->findByTorrentId($torrentId), diff --git a/tests/phpunit/manager/TorrentLogTest.php b/tests/phpunit/manager/TorrentLogTest.php index 6af9e2ac5..a5997c55d 100644 --- a/tests/phpunit/manager/TorrentLogTest.php +++ b/tests/phpunit/manager/TorrentLogTest.php @@ -36,9 +36,9 @@ class TorrentLogTest extends TestCase { foreach ($logfileSummary->all() as $logfile) { $torrentLog = $torrentLogManager->create($torrent, $logfile, $checkerVersion); } - $torrentLog2 = $torrentLogManager->findById($torrent, $torrentLog->id()); + $torrentLog2 = $torrentLogManager->findById($torrent, $torrentLog->id); $this->assertInstanceOf(TorrentLog::class, $torrentLog2); - $this->assertEquals($torrentLog->id(), $torrentLog2->id()); + $this->assertEquals($torrentLog->id, $torrentLog2->id); $this->assertEquals($torrentLog->link(), $torrentLog2->link()); } finally { if (isset($tgroup)) { diff --git a/tests/phpunit/render/RenderUserTest.php b/tests/phpunit/render/RenderUserTest.php index 2c3c93d16..6952fe620 100644 --- a/tests/phpunit/render/RenderUserTest.php +++ b/tests/phpunit/render/RenderUserTest.php @@ -96,13 +96,13 @@ class RenderUserTest extends TestCase { $this->userReports = [ $reportMan->create( $this->userList['admin'], - $this->userList['user']->id(), + $this->userList['user']->id, "user", randomString(6), ), $reportMan->create( $this->userList['admin'], - $this->userList['user']->id(), + $this->userList['user']->id, "user", randomString(500) ), diff --git a/tests/phpunit/search/ReportAutoTest.php b/tests/phpunit/search/ReportAutoTest.php index 2e6f162ff..d40c0afb5 100644 --- a/tests/phpunit/search/ReportAutoTest.php +++ b/tests/phpunit/search/ReportAutoTest.php @@ -50,8 +50,8 @@ class SearchReportAutoTest extends TestCase { protected function matchThingList(array $thingList, User|ReportAuto\Type $matcher, int $n, string $msg): void { foreach ($thingList as $list) { - match ($list[0]->id()) { - $matcher->id() => $this->assertEquals($n, $list[1], "rasearch-$msg"), + match ($list[0]->id) { + $matcher->id => $this->assertEquals($n, $list[1], "rasearch-$msg"), default => $this->fail("rasearch-$msg-fail") }; } @@ -129,9 +129,9 @@ class SearchReportAutoTest extends TestCase { $search->setOwner(self::$user2); foreach ($search->userTotalList() as $userList) { - match ($userList[0]->id()) { - self::$user1->id() => $this->assertEquals(2, $userList[1], 'rasearch-closed-2-1'), - self::$user2->id() => $this->assertEquals(2, $userList[1], 'rasearch-closed-2-2'), + match ($userList[0]->id) { + self::$user1->id => $this->assertEquals(2, $userList[1], 'rasearch-closed-2-1'), + self::$user2->id => $this->assertEquals(2, $userList[1], 'rasearch-closed-2-2'), default => $this->fail('rasearch-closed-2-fail') }; } @@ -143,9 +143,9 @@ class SearchReportAutoTest extends TestCase { $search->setOwner(self::$user2); foreach ($search->userTotalList() as $userList) { - match ($userList[0]->id()) { - self::$user1->id() => $this->assertEquals(2, $userList[1], 'rasearch-claimed-1-1'), - self::$user2->id() => $this->assertEquals(1, $userList[1], 'rasearch-claimed-1-2'), + match ($userList[0]->id) { + self::$user1->id => $this->assertEquals(2, $userList[1], 'rasearch-claimed-1-1'), + self::$user2->id => $this->assertEquals(1, $userList[1], 'rasearch-claimed-1-2'), default => $this->fail('rasearch-claimed-1-fail') }; } @@ -170,7 +170,7 @@ class SearchReportAutoTest extends TestCase { public function testId(): void { $search = new Search\ReportAuto(self::$raMan, self::$ratMan); - $search->setId(self::$report->id()); + $search->setId(self::$report->id); $this->matchThingList( $search->typeTotalList(), self::$ratMan->findById(self::$report->typeId()), diff --git a/tests/phpunit/search/UserTorrentTest.php b/tests/phpunit/search/UserTorrentTest.php index d835948a9..b8fa0eab9 100644 --- a/tests/phpunit/search/UserTorrentTest.php +++ b/tests/phpunit/search/UserTorrentTest.php @@ -49,7 +49,7 @@ class UserTorrentTest extends TestCase { $search = new Search\UserTorrent($this->user, UserTorrentSearch::seeding); $this->assertEquals('seeding', $search->label(), 'search-utor-label-seeding'); $this->assertEquals( - [$this->torrentList[1]->id()], + [$this->torrentList[1]->id], $search->idList(), 'search-utor-list-seeding' ); @@ -60,7 +60,7 @@ class UserTorrentTest extends TestCase { $search = new Search\UserTorrent($this->user, UserTorrentSearch::snatched); $this->assertEquals('snatched', $search->label(), 'search-utor-label-snatched'); $this->assertEquals( - [$this->torrentList[0]->id()], + [$this->torrentList[0]->id], $search->idList(), 'search-utor-list-snatched' ); @@ -70,7 +70,7 @@ class UserTorrentTest extends TestCase { $search = new Search\UserTorrent($this->user, UserTorrentSearch::uploaded); $this->assertEquals('uploaded', $search->label(), 'search-utor-label-uploaded'); $this->assertEquals( - array_map(fn ($t) => $t->id(), $this->torrentList), + array_map(fn ($t) => $t->id, $this->torrentList), $search->idList(), 'search-utor-list-uploaded' );