summaryrefslogtreecommitdiffstats
path: root/tests/lib/Accounts/AccountPropertyTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Accounts/AccountPropertyTest.php')
-rw-r--r--tests/lib/Accounts/AccountPropertyTest.php35
1 files changed, 28 insertions, 7 deletions
diff --git a/tests/lib/Accounts/AccountPropertyTest.php b/tests/lib/Accounts/AccountPropertyTest.php
index 84059bbc35d..50c3b8f84a4 100644
--- a/tests/lib/Accounts/AccountPropertyTest.php
+++ b/tests/lib/Accounts/AccountPropertyTest.php
@@ -38,7 +38,8 @@ class AccountPropertyTest extends TestCase {
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
IAccountManager::SCOPE_PUBLISHED,
- IAccountManager::VERIFIED
+ IAccountManager::VERIFIED,
+ ''
);
$this->assertEquals(IAccountManager::PROPERTY_WEBSITE, $accountProperty->getName());
$this->assertEquals('https://example.com', $accountProperty->getValue());
@@ -51,7 +52,8 @@ class AccountPropertyTest extends TestCase {
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
IAccountManager::SCOPE_PUBLISHED,
- IAccountManager::VERIFIED
+ IAccountManager::VERIFIED,
+ ''
);
$actualReturn = $accountProperty->setValue('https://example.org');
$this->assertEquals('https://example.org', $accountProperty->getValue());
@@ -63,7 +65,8 @@ class AccountPropertyTest extends TestCase {
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
IAccountManager::SCOPE_PUBLISHED,
- IAccountManager::VERIFIED
+ IAccountManager::VERIFIED,
+ ''
);
$actualReturn = $accountProperty->setScope(IAccountManager::SCOPE_LOCAL);
$this->assertEquals(IAccountManager::SCOPE_LOCAL, $accountProperty->getScope());
@@ -98,7 +101,8 @@ class AccountPropertyTest extends TestCase {
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
$storedScope,
- IAccountManager::VERIFIED
+ IAccountManager::VERIFIED,
+ ''
);
$this->assertEquals($returnedScope, $accountProperty->getScope());
}
@@ -108,25 +112,42 @@ class AccountPropertyTest extends TestCase {
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
IAccountManager::SCOPE_PUBLISHED,
- IAccountManager::VERIFIED
+ IAccountManager::VERIFIED,
+ ''
);
$actualReturn = $accountProperty->setVerified(IAccountManager::NOT_VERIFIED);
$this->assertEquals(IAccountManager::NOT_VERIFIED, $accountProperty->getVerified());
$this->assertEquals(IAccountManager::NOT_VERIFIED, $actualReturn->getVerified());
}
+ public function testSetVerificationData() {
+ $accountProperty = new AccountProperty(
+ IAccountManager::PROPERTY_WEBSITE,
+ 'https://example.com',
+ IAccountManager::SCOPE_PUBLISHED,
+ IAccountManager::VERIFIED,
+ ''
+ );
+ $token = uniqid();
+ $actualReturn = $accountProperty->setVerificationData($token);
+ $this->assertEquals($token, $accountProperty->getVerificationData());
+ $this->assertEquals($token, $actualReturn->getVerificationData());
+ }
+
public function testJsonSerialize() {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
IAccountManager::SCOPE_PUBLISHED,
- IAccountManager::VERIFIED
+ IAccountManager::VERIFIED,
+ '60a7a633b74af',
);
$this->assertEquals([
'name' => IAccountManager::PROPERTY_WEBSITE,
'value' => 'https://example.com',
'scope' => IAccountManager::SCOPE_PUBLISHED,
- 'verified' => IAccountManager::VERIFIED
+ 'verified' => IAccountManager::VERIFIED,
+ 'verificationData' => '60a7a633b74af'
], $accountProperty->jsonSerialize());
}
}