19 declare(strict_types=1);
32 $access = $this->getMockBuilder(ilAccessHandler::class)->disableOriginalConstructor()->getMock();
34 $this->assertInstanceOf(Readable::class,
new Readable($access));
39 $access = $this->getMockBuilder(ilAccessHandler::class)->disableOriginalConstructor()->getMock();
40 $access->method(
'checkAccess')->with(
'read',
'', 123)->willReturn(
true);
42 $this->assertTrue((
new Readable($access))->references([123]));
47 $access = $this->getMockBuilder(ilAccessHandler::class)->disableOriginalConstructor()->getMock();
49 $access->method(
'checkAccess')->with(
'read',
'', 456)->willReturn(
true);
51 $references_of = fn(
int $object_id) => 123 !== $object_id ?: [456];
53 $this->assertTrue((
new Readable($access, $references_of))->objectId(123));