ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
BaseToastSetUp Class Reference
+ Inheritance diagram for BaseToastSetUp:
+ Collaboration diagram for BaseToastSetUp:

Public Member Functions

 getDIC ()
 
 getDummyToastProviderWithToasts (array $toasts)
 

Protected Member Functions

 setUp ()
 

Protected Attributes

ToastProvider $provider
 
ToastFactory $factory
 

Private Attributes

array $toasts = []
 
ILIAS DI UIServices $ui_mock
 

Detailed Description

Definition at line 32 of file BaseToastSetUp.php.

Member Function Documentation

◆ getDIC()

BaseToastSetUp::getDIC ( )

Definition at line 53 of file BaseToastSetUp.php.

References ILIAS\Repository\globalScreen().

Referenced by getDummyToastProviderWithToasts().

54  {
55  $mocks = [
56  'ui' => $this->createMock(\ILIAS\DI\UIServices::class),
57  'ui.factory' => $this->createMock(\ILIAS\UI\Factory::class),
58  'provider_factory'=> $this->createMock(ProviderFactory::class),
59  ];
60  return new class ($mocks) extends ILIAS\DI\Container {
61  public function globalScreen(): Services
62  {
63  return new Services($this['provider_factory'], $this['ui']);
64  }
65  };
66  }
Class Factory.
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class HTTPServicesTest.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDummyToastProviderWithToasts()

BaseToastSetUp::getDummyToastProviderWithToasts ( array  $toasts)

Definition at line 68 of file BaseToastSetUp.php.

References $dic, $provider, $toasts, and getDIC().

Referenced by DummyToastProviderTest\testConstruct(), ToastCollectorTest\testConstruct(), and ToastCollectorTest\testGetToasts().

69  {
70  $dic = $this->getDIC();
71  $provider = new class ($dic) extends AbstractToastProvider {
72  public array $toasts;
73  public function getToasts(): array
74  {
75  return $this->toasts;
76  }
77  };
78  $provider->toasts = $toasts;
79  return $provider;
80  }
ToastProvider $provider
$dic
Definition: result.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

BaseToastSetUp::setUp ( )
protected

Definition at line 43 of file BaseToastSetUp.php.

43  : void
44  {
45  parent::setUp();
46 
47  $this->ui_mock = $this->createMock(\ILIAS\DI\UIServices::class);
48  $this->provider = $this->createMock(ToastProvider::class);
49  $this->provider->expects($this->any())->method('getProviderNameForPresentation')->willReturn('Provider');
50  $this->factory = (new ToastServices($this->ui_mock))->factory();
51  }
Class ChatMainBarProvider .
Class HTTPServicesTest.

Field Documentation

◆ $factory

ToastFactory BaseToastSetUp::$factory
protected

Definition at line 38 of file BaseToastSetUp.php.

◆ $provider

◆ $toasts

array BaseToastSetUp::$toasts = []
private

Definition at line 34 of file BaseToastSetUp.php.

Referenced by getDummyToastProviderWithToasts().

◆ $ui_mock

ILIAS DI UIServices BaseToastSetUp::$ui_mock
private

Definition at line 36 of file BaseToastSetUp.php.


The documentation for this class was generated from the following file: