19 declare(strict_types=1);
    36 require_once __DIR__ . 
'/ContainerMock.php';
    44         $this->assertInstanceOf(Provide::class, 
new Provide(
'foo', $this->mock(Internal::class), $this->mock(Container::class)));
    49         $container = $this->mockTree(Container::class, [
'ctrl' => $this->mock(ilCtrl::class)]);
    50         $container->expects(self::once())->method(
'offsetGet')->with(
'ilAuthSession')->willReturn($this->mock(ilAuthSession::class));
    52         $instance = 
new Provide(
'foo', $this->mockMethod(Internal::class, 
'get', [
'withdraw'], 
'foo'), 
$container);
    54         $this->assertInstanceOf(ProvideWithdrawal::class, $instance->withdrawal());
    59         $container = $this->mockTree(Container::class, [
'ctrl' => $this->mock(ilCtrl::class)]);
    61         $this->assertInstanceOf(ProvidePublicPage::class, (
new Provide(
'foo', $this->mockMethod(
    64             [
'public-page', 
'foo'],
    71         $document = $this->mock(ProvideDocument::class);
    72         $internal = $this->mockMethod(Internal::class, 
'get', [
'document', 
'foo'], $document);
    74         $instance = 
new Provide(
'foo', $internal, $this->mock(Container::class));
    75         $this->assertSame($document, $instance->document());
    80         $history = $this->mock(ProvideHistory::class);
    81         $internal = $this->mockMethod(Internal::class, 
'get', [
'history', 
'foo'], $history);
    83         $instance = 
new Provide(
'foo', $internal, $this->mock(Container::class));
    84         $this->assertSame($history, $instance->history());
    89         $document = $this->mock(ProvideDocument::class);
    91         $internal = $this->mock(Internal::class);
    92         $internal->expects(self::exactly(2))->method(
'get')->withConsecutive([
'document', 
'foo'], [
'writable-document', 
'foo'])->willReturn($document);
    94         $instance = 
new Provide(
'foo', $internal, $this->mock(Container::class));
    95         $instance->document();
    96         $instance->allowEditing()->document();
   101         $public_api = $this->mock(PublicApi::class);
   102         $internal = $this->mockMethod(Internal::class, 
'get', [
'public-api', 
'foo'], $public_api);
   104         $instance = 
new Provide(
'foo', $internal, $this->mock(Container::class));
   106         $this->assertSame($public_api, $instance->publicApi());
   111         $this->assertSame(
'foo', (
new Provide(
'foo', $this->mock(Internal::class), $this->mock(Container::class)))->
id());