Skip to content

Commit 5f6b7f0

Browse files
committed
test: add Options classes tests and fix Arr::set return value bug
Add 27 wpunit tests covering get/set/delete/all/reset, defaults, environment isolation, container singletons, and Plugin::option(). Fix Options::set() to capture the return value of Arr::set() which returns a new array rather than mutating by reference.
1 parent 0ad4b27 commit 5f6b7f0

2 files changed

Lines changed: 393 additions & 3 deletions

File tree

src/WorkOS/Options/Options.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ public function get( string $key, $default = null ) {
5757
* @param mixed $value Value to store.
5858
*/
5959
public function set( string $key, $value ): void {
60-
$options = $this->all();
61-
Arr::set( $options, $key, $value );
62-
$this->options = $options;
60+
$this->options = Arr::set( $this->all(), $key, $value );
6361
$this->save();
6462
}
6563

0 commit comments

Comments
 (0)