ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 = []
 
UIServices $ui_mock
 

Detailed Description

Definition at line 34 of file BaseToastSetUp.php.

Member Function Documentation

◆ getDIC()

BaseToastSetUp::getDIC ( )

Definition at line 55 of file BaseToastSetUp.php.

References ILIAS\Repository\globalScreen().

Referenced by getDummyToastProviderWithToasts().

55  : Container
56  {
57  $mocks = [
58  'ui' => $this->createMock(UIServices::class),
59  'ui.factory' => $this->createMock(Factory::class),
60  'provider_factory' => $this->createMock(ProviderFactory::class),
61  ];
62  return new class ($mocks) extends Container {
63  public function globalScreen(): Services
64  {
65  return new Services($this['provider_factory'], $this['ui']);
66  }
67  };
68  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDummyToastProviderWithToasts()

BaseToastSetUp::getDummyToastProviderWithToasts ( array  $toasts)

Definition at line 70 of file BaseToastSetUp.php.

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

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

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

◆ setUp()

BaseToastSetUp::setUp ( )
protected

Definition at line 45 of file BaseToastSetUp.php.

References factory().

45  : void
46  {
47  parent::setUp();
48 
49  $this->ui_mock = $this->createMock(UIServices::class);
50  $this->provider = $this->createMock(ToastProvider::class);
51  $this->provider->expects($this->any())->method('getProviderNameForPresentation')->willReturn('Provider');
52  $this->factory = (new ToastServices($this->ui_mock))->factory();
53  }
factory()
+ Here is the call graph for this function:

Field Documentation

◆ $factory

ToastFactory BaseToastSetUp::$factory
protected

Definition at line 40 of file BaseToastSetUp.php.

◆ $provider

◆ $toasts

array BaseToastSetUp::$toasts = []
private

Definition at line 36 of file BaseToastSetUp.php.

Referenced by getDummyToastProviderWithToasts().

◆ $ui_mock

UIServices BaseToastSetUp::$ui_mock
private

Definition at line 38 of file BaseToastSetUp.php.


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