attribute tables are managed by deriving a base class

This commit is contained in:
Spine
2025-05-07 08:08:43 +00:00
parent 7c0ecff7fa
commit c3df1da1b7
22 changed files with 254 additions and 229 deletions

View File

@@ -53,20 +53,16 @@ class UserTest extends TestCase {
$id = $this->user->id;
$username = $this->user->username();
$this->assertEquals(1, $this->user->remove(), 'user-remove');
$this->assertEquals(1, $this->user->remove(), 'user-remove-exists');
$this->assertNull((new Manager\User())->findById($id), 'user-is-removed');
$this->assertNull((new Manager\User())->findByUsername($username), 'username-is-removed');
unset($this->user);
}
public function testAttr(): void {
$this->assertFalse($this->user->hasUnlimitedDownload(), 'uattr-hasUnlimitedDownload');
$this->user->toggleUnlimitedDownload(true);
$this->assertTrue($this->user->hasUnlimitedDownload(), 'uattr-not-hasUnlimitedDownload');
$this->assertTrue($this->user->hasAcceptFL(), 'uattr-has-FL');
$this->user->toggleAcceptFL(false);
$this->assertFalse($this->user->hasAcceptFL(), 'uattr-has-not-FL');
$this->assertFalse($this->user->hasAttr('unlimited-download'), 'uattr-hasUnlimitedDownload');
$this->user->toggleAttr('unlimited-download', true);
$this->assertTrue($this->user->hasAttr('unlimited-download'), 'uattr-not-hasUnlimitedDownload');
$this->assertNull($this->user->option('nosuchoption'), 'uattr-nosuchoption');