Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-02-17 20:45:33 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-02-17 20:45:33 +0300
commit497ee3e3e64a07c1684f4ec87aa7621d743c37e6 (patch)
tree538d5ee36d20caff89605b86d3ae506afccf7a09 /apps/user_ldap/tests/Mapping/AbstractMappingTest.php
parent45615cc940acce6ddab4c84b8f0fd38299125f37 (diff)
Add repair steps
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
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);
}
/**