aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/tests/Mapping/AbstractMappingTest.php')
-rw-r--r--apps/user_ldap/tests/Mapping/AbstractMappingTest.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
index 5c3474d9ad2..c9845bb31e5 100644
--- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
+++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
@@ -26,6 +26,7 @@
namespace OCA\User_LDAP\Tests\Mapping;
+use OCA\User_LDAP\Mapping\AbstractMapping;
use OCP\IDBConnection;
abstract class AbstractMappingTest extends \Test\TestCase {
@@ -182,7 +183,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests setDNbyUUID() for successful and unsuccessful update.
*/
- public function testSetMethod() {
+ public function testSetDNMethod() {
list($mapper, $data) = $this->initTest();
$newDN = 'uid=modified,dc=example,dc=org';
@@ -196,7 +197,26 @@ abstract class AbstractMappingTest extends \Test\TestCase {
$this->assertFalse($done);
$name = $mapper->getNameByDN($newDN);
$this->assertFalse($name);
+ }
+
+ /**
+ * tests setUUIDbyDN() for successful and unsuccessful update.
+ */
+ public function testSetUUIDMethod() {
+ /** @var AbstractMapping $mapper */
+ list($mapper, $data) = $this->initTest();
+ $newUUID = 'ABC737-DEF754';
+
+ $done = $mapper->setUUIDbyDN($newUUID, 'uid=notme,dc=example,dc=org');
+ $this->assertFalse($done);
+ $name = $mapper->getNameByUUID($newUUID);
+ $this->assertFalse($name);
+
+ $done = $mapper->setUUIDbyDN($newUUID, $data[0]['dn']);
+ $this->assertTrue($done);
+ $uuid = $mapper->getUUIDByDN($data[0]['dn']);
+ $this->assertSame($uuid, $newUUID);
}
/**