Skip to content

Commit

Permalink
Add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Nov 7, 2023
1 parent 9b21936 commit fdd927b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Unit/Models/ModelRenameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,29 @@ public function test_rename_escaping_parent()
$this->assertTrue($model->wasRecentlyRenamed);
}

public function test_rename_with_base_dn_substitution()
{
Container::addConnection(
new Connection(['base_dn' => 'dc=local,dc=com'])
);

DirectoryFake::setup()
->getLdapConnection()
->expect(
LdapFake::operation('rename')
->with('cn=John Doe,dc=acme,dc=org', 'cn=Jane Doe', 'ou=Accounting,dc=local,dc=com')
->andReturnTrue()
);

$model = (new Entry)->setRawAttributes([
'dn' => 'cn=John Doe,dc=acme,dc=org',
]);

$model->rename('Jane Doe', 'ou=Accounting,{base}');

$this->assertEquals('cn=Jane Doe,ou=Accounting,dc=local,dc=com', $model->getDn());
}

public function test_move()
{
DirectoryFake::setup()
Expand Down

0 comments on commit fdd927b

Please sign in to comment.