19 declare(strict_types=1);
    33         bool $throw_exception = 
false    36             public array $transferred_md = [];
    37             public array $error_thrown = [];
    39             public function __construct(
protected bool $throw_exception)
    43             public function transferMD(
    48                 bool $throw_error_if_invalid
    50                 if ($this->throw_exception) {
    51                     throw new \ilMDRepositoryException(
'failed');
    54                 $this->transferred_md[] = [
    55                     'from_set' => $from_set,
    56                     'to_obj_id' => $to_obj_id,
    57                     'to_sub_id' => $to_sub_id,
    60                 $this->error_thrown[] = $throw_error_if_invalid;
    63         return new class ($from_set, $repo) extends 
Derivator {
    66                 return $this->repository;
    76         $derivator->forObject(78, 5, 
'to_type');
    78         $this->assertCount(1, $derivator->exposeRepository()->transferred_md);
    81                 'from_set' => $from_set,
    84                 'to_type' => 
'to_type'    86             $derivator->exposeRepository()->transferred_md[0]
    88         $this->assertCount(1, $derivator->exposeRepository()->error_thrown);
    89         $this->assertTrue($derivator->exposeRepository()->error_thrown[0]);
    96         $derivator->forObject(78, 0, 
'to_type');
    98         $this->assertCount(1, $derivator->exposeRepository()->transferred_md);
   101                 'from_set' => $from_set,
   104                 'to_type' => 
'to_type'   106             $derivator->exposeRepository()->transferred_md[0]
   108         $this->assertCount(1, $derivator->exposeRepository()->error_thrown);
   109         $this->assertTrue($derivator->exposeRepository()->error_thrown[0]);
   117         $this->expectException(\ilMDServicesException::class);
   118         $derivator->forObject(78, 0, 
'to_type');
 
__construct()
Constructor setup ILIAS global object  public.