From 8fe914f07e1b4d41c02e127e2242e0a770535455 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 15 Mar 2018 14:16:43 +0100 Subject: LDAP backend to emit announce and revoke signals on mapping changes Signed-off-by: Arthur Schiwon --- .../tests/Mapping/AbstractMappingTest.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'apps/user_ldap/tests/Mapping') diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php index d3d33a82da9..54d8b49cdc8 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php @@ -234,6 +234,29 @@ abstract class AbstractMappingTest extends \Test\TestCase { } } + /** + * tests clear() for successful update. + */ + public function testClearCb() { + list($mapper, $data) = $this->initTest(); + + $callbackCalls = 0; + $test = $this; + + $callback = function (string $id) use ($test, &$callbackCalls) { + $test->assertTrue(trim($id) !== ''); + $callbackCalls++; + }; + + $done = $mapper->clearCb($callback, $callback); + $this->assertTrue($done); + $this->assertSame(count($data) * 2, $callbackCalls); + foreach($data as $entry) { + $name = $mapper->getNameByUUID($entry['uuid']); + $this->assertFalse($name); + } + } + /** * tests getList() method */ -- cgit v1.2.3