summaryrefslogtreecommitdiff
path: root/tests/units/Core/User/UserPropertyTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Core/User/UserPropertyTest.php')
-rw-r--r--tests/units/Core/User/UserPropertyTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/units/Core/User/UserPropertyTest.php b/tests/units/Core/User/UserPropertyTest.php
index a2f052f4..30e651cb 100644
--- a/tests/units/Core/User/UserPropertyTest.php
+++ b/tests/units/Core/User/UserPropertyTest.php
@@ -56,6 +56,30 @@ class UserPropertyTest extends Base
);
$this->assertEquals($expected, UserProperty::filterProperties($profile, $properties));
+
+ $profile = array(
+ 'id' => 123,
+ 'username' => 'bob',
+ 'name' => null,
+ 'email' => '',
+ 'other_column' => 'myvalue',
+ 'role' => Role::APP_ADMIN,
+ );
+
+ $properties = array(
+ 'external_id' => '456',
+ 'username' => 'bobby',
+ 'name' => 'Bobby',
+ 'email' => 'admin@localhost',
+ 'role' => null,
+ );
+
+ $expected = array(
+ 'name' => 'Bobby',
+ 'email' => 'admin@localhost',
+ );
+
+ $this->assertEquals($expected, UserProperty::filterProperties($profile, $properties));
}
public function testFilterPropertiesOverrideExistingValueWhenNecessary()