diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-10-30 12:09:31 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2025-06-29 13:20:00 +0200 |
commit | 6336853b35b257b1004a6a0d625e56b113fd1503 (patch) | |
tree | b6c95521f6362f214e9f946b025942201b4f0c45 /tests/unit/Model/AccountTest.php | |
parent | 53634cc1f27e9ed0711b50f9e03745d2949efb14 (diff) | |
download | volse-hubzilla-move-account-processing-to-class.tar.gz volse-hubzilla-move-account-processing-to-class.tar.bz2 volse-hubzilla-move-account-processing-to-class.zip |
Model\Account: Specify types for properties.move-account-processing-to-class
Adds a layer of type safety at the model level.
Diffstat (limited to 'tests/unit/Model/AccountTest.php')
-rw-r--r-- | tests/unit/Model/AccountTest.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit/Model/AccountTest.php b/tests/unit/Model/AccountTest.php index 1da1ab87b..f9b126fa0 100644 --- a/tests/unit/Model/AccountTest.php +++ b/tests/unit/Model/AccountTest.php @@ -37,4 +37,13 @@ class AccountTest extends UnitTestCase { public function test_get_total_number_of_accounts(): void { $this->assertEquals(count($this->fixtures['account']), Account::count()); } + + /** + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function test_construct_account_with_invalid_id(): void { + $this->expectException(\TypeError::class); + + $account = new Account(['account_id' => 'neverwhere']); + } } |