19 declare(strict_types=1);
    35 require_once __DIR__ . 
'/bootstrap.php';
    43         $this->assertInstanceOf(UserSettings::class, 
new UserSettings(
    44             $this->mock(ilObjUser::class),
    45             $this->mock(SelectSetting::class),
    46             $this->mock(Refinery::class)
    52         $setting = $this->mock(Setting::class);
    53         $convert = $this->mock(Convert::class);
    55         $marshal = $this->mockMethod(Marshal::class, 
'boolean', [], $convert);
    57         $settings = $this->mock(SelectSetting::class);
    58         $settings->expects(self::once())->method(
'typed')->willReturnCallback(
function (
string $key, callable $select) use ($marshal, $convert, 
$setting) {
    59             $this->assertSame(
'consent_withdrawal_requested', $key);
    60             $this->assertSame($convert, $select($marshal));
    65             $this->mock(ilObjUser::class),
    67             $this->mock(Refinery::class)
    70         $this->assertSame(
$setting, $instance->withdrawalRequested());
    78         $by_trying = $this->mock(ByTrying::class);
    79         $by_trying->expects(self::exactly(2))->method(
'transform')->withConsecutive([
'agree date'], [$date])->willReturnOnConsecutiveCalls($return_date, 
'another date');
    81         $user = $this->mock(ilObjUser::class);
    82         $user->expects(self::once())->method(
'getAgreeDate')->willReturn(
'agree date');
    83         $user->expects(self::once())->method(
'setAgreeDate')->with(
'another date');
    84         $user->expects(self::once())->method(
'update');
    86         $refinery = $this->mockTree(Refinery::class, [
'byTrying' => $by_trying]);
    90             $this->mock(SelectSetting::class),
    95         $this->assertSame($return_date, 
$setting->value());
 
testWithdrawalRequested()
 
Refinery Factory $refinery