Skip to content

Commit fdd927b

Browse files
committed
Add another test
1 parent 9b21936 commit fdd927b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/Unit/Models/ModelRenameTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,29 @@ public function test_rename_escaping_parent()
184184
$this->assertTrue($model->wasRecentlyRenamed);
185185
}
186186

187+
public function test_rename_with_base_dn_substitution()
188+
{
189+
Container::addConnection(
190+
new Connection(['base_dn' => 'dc=local,dc=com'])
191+
);
192+
193+
DirectoryFake::setup()
194+
->getLdapConnection()
195+
->expect(
196+
LdapFake::operation('rename')
197+
->with('cn=John Doe,dc=acme,dc=org', 'cn=Jane Doe', 'ou=Accounting,dc=local,dc=com')
198+
->andReturnTrue()
199+
);
200+
201+
$model = (new Entry)->setRawAttributes([
202+
'dn' => 'cn=John Doe,dc=acme,dc=org',
203+
]);
204+
205+
$model->rename('Jane Doe', 'ou=Accounting,{base}');
206+
207+
$this->assertEquals('cn=Jane Doe,ou=Accounting,dc=local,dc=com', $model->getDn());
208+
}
209+
187210
public function test_move()
188211
{
189212
DirectoryFake::setup()

0 commit comments

Comments
 (0)