Skip to content

Commit 2f70aeb

Browse files
committed
Added ability to add server control value
1 parent e3792fe commit 2f70aeb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Query/Builder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,13 +1084,14 @@ public function withDeleted()
10841084
*
10851085
* @param string $oid
10861086
* @param bool $isCritical
1087+
* @param mixed $value
10871088
*
10881089
* @return $this
10891090
*/
1090-
public function addControl($oid, $isCritical = false)
1091+
public function addControl($oid, $isCritical = false, $value = null)
10911092
{
10921093
if (!$this->hasControl($oid)) {
1093-
$this->controls[] = compact('oid', 'isCritical');
1094+
$this->controls[] = compact('oid', 'isCritical', 'value');
10941095
}
10951096

10961097
return $this;

tests/Query/BuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function test_where_deleted()
279279

280280
$b->whereDeleted();
281281

282-
$this->assertEquals([['oid' => '1.2.840.113556.1.4.417', 'isCritical' => true]], $b->controls);
282+
$this->assertEquals([['oid' => '1.2.840.113556.1.4.417', 'isCritical' => true, 'value' => null]], $b->controls);
283283

284284
$this->assertEquals('(isDeleted=TRUE)', $b->getUnescapedQuery());
285285
}
@@ -920,7 +920,7 @@ public function test_controls_can_be_added()
920920
$this->assertEmpty($b->controls);
921921

922922
$b->addControl('foo', true);
923-
$this->assertEquals([['oid' => 'foo', 'isCritical' => true]], $b->controls);
923+
$this->assertEquals([['oid' => 'foo', 'isCritical' => true, 'value' => null]], $b->controls);
924924
}
925925

926926
public function test_has_control()
@@ -939,7 +939,7 @@ public function test_controls_are_not_stacked()
939939
$b->addControl('foo');
940940

941941
$this->assertCount(1, $b->controls);
942-
$this->assertEquals([['oid' => 'foo', 'isCritical' => false]], $b->controls);
942+
$this->assertEquals([['oid' => 'foo', 'isCritical' => false, 'value' => null]], $b->controls);
943943
}
944944

945945
public function test_getting_results_sets_ldap_controls()

0 commit comments

Comments
 (0)